This project is designed to practice Test-Driven Development. It uses Docker Compose to launch the whole backend stack, so please make sure that Docker is installed.
- Develop an asynchronous RESTful API with FastAPI and async ORM
- Use Makefile for task automation and environment management
- Implement Test-Driven Development (TDD) practice
- Test the FastAPI application with Pytest
- Run unit and integration tests with code coverage tracking
- Use Ruff and Pre-commit hooks for code linting and formatting checks
- Automate testing with Tox
- Use Poetry to manage python packages
- Handle database migrations with Alembic
- Dockerize FastAPI, PostgreSQL and Redis for containerized deployment
- Design the email service with the Strategy Pattern for scalable email generation and delivery
Refer to the .env.example
file for the required variables. It is recommended to use direnv for managing environment variables.
To start the whole stack, run:
$ make up
To take down the stack, run:
$ make down
To view logs for a specific service, use logs-{service}
. You can also customize the number of log lines to display with the log_lines
argument:
$ make logs-api log_lines=50
Swagger UI is available at http://127.0.0.1:8000/docs. You can use it to test the API endpoints and explore the API documentation.
To run the tests:
$ make test