A FastAPI application
- The project is a web API backend application.
- It is a social media type application in which users can see and posts any form of data.
- Users can vote on posts
- They can retrieve all the posts while applying many filters
- Based on an emerging framework for Python called FastAPI
- Entire project uses Python as a sole language
- Automatic documentation generation by Swagger
- Live data validation by Pydantic Python library.
- Database used – PostgreSQL
- Login implementation using web standard JSON Web Tokens.
- Object-Relational Mapper SQLAlchemy for used for all SQL CRUD operations.
- Implementation of Database migration tool Alembic in the project in order to support future scale up or roll down.
- Use of environment variables
- Hashed password
App was deployed publicly on https://alpha-api-social.herokuapp.com but since Heroku removed its free tier, the domain has been taken down.
Run the application locally by downloading the code.
Go to /docs route to use interactive documentation to get the feel of it.
- Create an account by providing a JSON data of email and password at /users endpoint
- Log yourself in. Provide username, which is in this case email, and password. Your session is valid till 12 hours
- Send a POST request on /posts endpoint to post content. You must provide Title and Content in the body of the request in JSON format.
- Now you can send GET request for individual or all posts.
- To vote on a post, send POST request with JSON providing post id you want to vote on.