This repository serves as an illustrative example of implementing Clean Architecture principles in a Python application using FastAPI. It accompanies the Medium article “Clean Architecture with Python”.
Create a virtual environment and install dependencies
python3 -m venv venv && venv/bin/pip install -r src/requirements.txt
Launch a mongodb instance using Docker
docker run --rm -d -p 27017:27017 --name=mongo-auctions mongo:8.0.4
Run tests
venv/bin/pytest src/tests
Start FastAPI application
venv/bin/fastapi dev src/drivers/rest/main.py
Remove the mongodb container
docker rm -f mongo-auctions