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
- Python (3.10)
- Poetry
- FastAPI
- Pydantic
- SQLAlchemy
- Alembic
- Pre-commit
- PostgreSQL
- Docker & Docker Compose
FastAPI generates an OpenAPI docs on /docs
endpoint.
Based on the ER Model there are 5 folder to separate contexts:
- Restaurants and restaurant schedules
- Products
- Offers and offers schedules
- Categories
- Users
To install the app:
poetry install
To run poetry shell:
make shell
To run the API:
make run
To start and stop the Docker dependencies:
make dep-start
make dep-stop
To create a new revision (migration file based on the models definitions):
make create-migration name=<revision-name>
To migrate or rollback
make migrate
make rollback
The pre-commit
is enable to run linter before each commit, but you can run any time. To run linter manually:
make lint
⌛ To be defined
- Query params on lists endpoints
- Improve body data validation
- Return all relations correctly on 'get by ID' endpoints
- Refactor to use services and core classes
- Fix on error on alembic
env.py
file - Add tests for all endpoints and contracts
- Improve exception handling errors
- Improve logging
- Solve minor TODOs
- Write README docs
Made with 🔮 for studies by RafaelEmery