pckv / repost-fastapi Goto Github PK
View Code? Open in Web Editor NEWFastAPI backend for Repost
License: MIT License
FastAPI backend for Repost
License: MIT License
/resubs
Public schema:
Features:
/users
Public schema:
Features:
Get user dependency should handle error when it doesn't exist
Depends on #19
Currently, we are using starlette's status fields. This means that starlette is a dependency and should be in requirements.txt (if FastAPI stops using starlette at some point, it would be incompatible). FastAPI has its own status
, so we should be using that.
Same for any others that we may be using. PyCharm will show where these are.
(this is not actually required for our project, but it would be a good consideration for a project with a longer lifespan)
/resubs/{resub}/posts/{post}/comments
Public schema:
Features:
{id}/vote
/{id}/reply
Features:
/users/me
)Requires a schema, defined the same way as EditResub and EditPost.
Endpoints should have parameters limit
and offset
These should not be part of the api module. Needs a new file, like repost.security
or similar
Model should for the most part reflect the API schema. Models should be in repost.models.resubs
, and CRUD functions should be in repost.crud.resubs
.
Further discussion must be made to decide columns: discussion in Discord.
In Spring OAuth2 Boot, invalid credentials is a 400 Bad Request, whereas it's a 401 Unauthorized in our FastAPI implementaion. 400 makes more sense for this.
In Spring OAuth2 Boot, invalid tokens are always a 401 Unauthorized, even for unparsable tokens. This kinda makes sense, so we can implement that here too.
Model should for the most part reflect the API schema. Models should be in repost.models.users
, and CRUD functions should be in repost.crud.users
.
Further discussion must be made to decide columns: discussion in Discord.
If a user is deleted, the token should be invalid and therefore yield a 401 Unauthorized
response. Currently, we would have to document a 404 on every authorized endpoint as well, which makes little sense.
For there to be communication between front-end and back-end, CORS has to be allowed for localhost with the port 63342. (Port may be changed later)
/resubs/{resub}/posts
Public schema:
a post requires at least one of url
, content
Features:
Votes table should relate to comment and posts. Models should be in repost.models.votes
, and CRUD functions should be in repost.crud.votes
.
Further discussion must be made to decide columns: discussion in Discord.
When validating, users should be verified existing in the database, but a separate issue is created for this: #18
Model should for the most part reflect the API schema. Models should be in repost.models.posts
, and CRUD functions should be in repost.crud.posts
.
Further discussion must be made to decide columns: discussion in Discord.
This should probably be defined in repost.database. Tables don't need to be modelled yet, but the database should be able to be accessed from a future CRUD setup.
Model should for the most part reflect the API schema. Models should be in repost.models.comments
, and CRUD functions should be in repost.crud.comments
.
Further discussion must be made to decide columns: discussion in Discord.
Internally, FastAPI uses 401 UNAUTHORIZED for authorization. 403 FORBIDDEN in these cases should be 401 (so we still use 403 if an authorized user tries to delete someone else's post etc)
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.