A complete Blog & User Management System built with FastAPI, Async SQLAlchemy, PostgreSQL, and JWT Authentication.
This project provides a clean and scalable backend for managing blog posts, user accounts, authentication, permissions, and more.
This API provides all essential features required for a modern blog platform:
- User registration & authentication
- Profile management
- Blog CRUD operations
- Publish/draft status
- Permissions & ownership checks
- Pagination (Offset + Cursor)
- Robust database structure with async support
- User registration & login with JWT tokens
- Update user profile (PUT & PATCH)
- Profile image support
- Email verification flag
- Prevent users from editing/deleting other users
- Secure password hashing
last_loginauto-update on login
- Create, read, update, delete blog posts
- Only the author can edit/delete their own posts
is_publishedfilter for public blogs- Pagination:
- Offset-based
- Cursor-based (recommended for large datasets)
- Tag support
- Views counter
- Fully async database operations
| Component | Technology |
|---|---|
| Backend Framework | FastAPI |
| ORM | SQLAlchemy 2.0 (Async) |
| Database | PostgreSQL |
| Authentication | JWT |
| Validation | Pydantic |
| Documentation | Swagger / ReDoc |
| Testing | Pytest |
.
├── app
│ ├── user
│ │ ├── models.py
│ │ ├── routers.py
│ │ ├── schemas.py
│ │ └── __init__.py
│ │
│ ├── blog
│ │ ├── models.py
│ │ ├── routers.py
│ │ ├── schemas.py
│ │ └── __init__.py
│ │
│ ├── database.py
│ ├── main.py
│ └── __init__.py
│
├
│── requirements.txt
└── README.md
│
├── Dockerfile
└── docker-compose.yml
