FastAPI project to manage restaurants, products and offers 🍔
It was based on this backend challenge and a opportunity to learn and apply some concepts of FastAPI.
My inicial studies of FastAPI is at fastapi-studies repository
- Python (
3.10.7) - Poetry
- FastAPI
- SQLModel & Alembic
- Pytest
- PostgreSQL
- Docker & Docker Compose
- Prometheus & Grafana
Based on the ER Model there are 5 folder to separate contexts:
- Restaurants and restaurant schedules
- Products
- Offers and offers schedules
- Categories
- Users
The ADRs are at adr/ folder and documents the main decisions of this project.
FastAPI generates an OpenAPI docs on /docs endpoint.
More about monitoring setup can be found at docs/monitoring.md.
To show all Makefile commands:
make helpTo install Python and Pyenv:
pyenv install 3.10.7
pyenv virtualenv 3.10.7 rafood-api
pyenv activate rafood-apiTo install the application:
make buildTo run the API and dependencies with Docker:
make startTo stop the API and dependencies:
make stopYou can also use restart and build commands.
To check API logs:
make logsTo create a new revision (migration file based on the models definitions):
make create-migration name=<revision-name>To migrate or rollback
make migrate
make rollbackThe pre-commit is enable to run linter before each commit, but you can run any time. To run linter manually:
make lintTo run tests with pytest:
make testBe sure to have database container running with make start
Made for studies by RafaelEmery
