4slimbu / limbook-api Goto Github PK
View Code? Open in Web Editor NEWApi for social networking app
License: MIT License
Api for social networking app
License: MIT License
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedTable) relation "image" does not exist
[SQL:
CREATE TABLE post_image (
post_id INTEGER NOT NULL,
image_id INTEGER NOT NULL,
PRIMARY KEY (post_id, image_id),
FOREIGN KEY(image_id) REFERENCES image (id),
FOREIGN KEY(post_id) REFERENCES post (id) ON DELETE cascade
)
For each user there should be an activity log:
e.g:
Table schema:
id, user_id, activity, created_at
Activity can be json like:
{ activity: "commented", "post_id": 1, "post_title": "my post"}
As of now, we are checking the file extension to allow only certain file type to be uploaded. We can do much better.
An issue occured where all tests passed using sqlite but failed on production.
Friend.is_friend == 1 in one query passed for sqlite but failed for postgres due to boolean field constraint.
To prevent such issues. Production and Test environ should be as similar as possible
The api end point should be:
/v1/api-endpoint
instead of just: /api-endpoint
It's better if later have to support multiple versions.
As of now model.py has all the Models. It can be divided into smaller models for each package.
When I right click the test directory and run tests, it doesn't find test. However, If I right click the test file and run test, it works.
Always returns bad request
Right now there is no image manger to handle file upload. We need to create one that has easy api to create file of different sizes and retrieve them. e.g:
image = Image->add(image)
image->save(app.config.get('image_sizes'))
image = Image->query->get_using_id(image_id)
Instead of saving images locally, saving it on s3 is a better choice
Functions to generate post, comment and react for testing or automation purpose is generating post_id and user_id using rand_int which cannot be linked to Post or User object. If it can be linked to Post or User object, then it can be really helpful in seeding purpose.
Right now other than model, everything is function based.
Transform the code to OOP
Not sure but may be:
As of now tests have redundant functions and variables. A base test class can be created to organize those things.
Post not found after making request in test.
Instance <Post at 0x7fc0ec09f090> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3
I am seeing payload.get('sub') in a lot of places. Its time to extract it to its own method that returns the user_id and throws 401 otherwise.
We need scheduler to do background tasks like:
Suggestion:
If you look at the permission testing for any route, you can see that its testing permission from the token. We need to mock permission so that we can see against which permission we are testing.
Use pivot table between user model to achieve the result.
User should be able to send friend message to other users.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.