Demo of a full asynchronous backend API server based on FastAPI and SQLAlchemy.
- fastapi for routing,
- sqlalchemy for ORM and everything database related,
- pydantic for serialization,
- granian for ASGI web server,
- slowapi for rate limiting.
- pytest for running tests,
- factoryboy for integration testing all orm related behaviour,
- faker for generating relevant fake data.
- postgis (geospatial enriched PostgreSQL)
- mise for managing environment variables, python version and tasks,
- poetry for dependency management.
- vscode (with vim motions) for development.
I am used to work with kubernetes, so upon release this image would be pushed to a container registry and then deployed on a k8s cluster from a gitlab or github job/action. Consequently, this explain the absence of a concurrency configuration for granian as scaling would be done at the k8s level.
Docker is required.
- Mount the stack by running:
docker compose -f docker/compose.yaml up
- Seed the database by running:
seed
(current package should be installed)
API interactive swagger should be available at http://localhost:8000/api/docs, use the following credentials to get a token for authenticated routes:
- username: alex@nd.re
- pwd: aloha
- cli
This project is inspired by netflix's dispatch repo.