Expense tracking API with FastAPI
intermediate3 weeksPythonSQL
A documented REST API for expenses and budgets with auth, pagination and reports.
Why build it
Shows you can design an API properly: validation, auth, pagination, migrations and tests, not just return JSON.
Features
- JWT auth
- CRUD for expenses and categories
- Monthly budget with alerts
- Pagination and filtering
- Report endpoint grouped by category
Roadmap
- p1
Foundations
- FastAPI project layout
- SQLAlchemy models and Alembic migrations
- Pydantic schemas
- p2
Auth
- Password hashing with argon2
- JWT access tokens
- Per-user data isolation tests
- p3
Features
- Expense CRUD with filters
- Cursor pagination
- Report queries with GROUP BY
- p4
Production
- pytest with a test database
- Dockerfile
- CI in GitHub Actions
- Deploy
Common pitfalls
- Forgetting to scope every query to the current user
- Offset pagination that gets slow and inconsistent on big tables
Skills you will practise
- REST design
- ORM and migrations
- Auth
- CI