This is basic social media backend API made using FastApi and using PostgreSQL as the database.
- JWT Token Authentication.
- Create User.
- Login User.
- Get all Posts.
- Get Post using id.
- Update Post.
- Delete Post.
- Vote on the Post (upvote)
alembic/
│
├── versions/
├── README.md
├── script.py.mako
└── env.py
app/
│
├── routers/
│ │
│ ├── __init__.py
│ ├── auth.py
│ ├── post.py
│ ├── user.py
│ └── vote.py
├── __init__.py
├── config.py
├── database.py
├── main.py
├── models.py
├── oauth2.py
├── schemas.py
└── utils.py
alembic.ini
README.md
requirements.txt
Install python normally or through Anaconda.
Use the requirements.txt file and run the command below:
pip install -r reqiurements.txt
Run using the following steps:
- Clone the repository:
git clone https://github.com/usman619/fast_api
cd fast_api
- Using uvicorn command:
uvicorn app.main:app
uvicorn app.main:app --reload
- Using fastapi command to get both Api and Api docs link:
# Development
fastapi dev app/main.py
# Production
fastapi run app/main.py