https://github.com/shaliamekh/clean-architecture-fastapi
Medium article "Clean Architecture with Python"
https://github.com/shaliamekh/clean-architecture-fastapi
clean-architecture fastapi mongodb python tdd
Last synced: about 2 months ago
JSON representation
Medium article "Clean Architecture with Python"
- Host: GitHub
- URL: https://github.com/shaliamekh/clean-architecture-fastapi
- Owner: shaliamekh
- Created: 2024-03-18T08:14:30.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-25T20:32:12.000Z (4 months ago)
- Last Synced: 2025-03-27T21:05:03.890Z (2 months ago)
- Topics: clean-architecture, fastapi, mongodb, python, tdd
- Language: Python
- Homepage: https://medium.com/@shaliamekh/clean-architecture-with-python-d62712fd8d4f
- Size: 25.4 KB
- Stars: 54
- Watchers: 1
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Clean Architecture on Python with FastAPI
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”](https://medium.com/@shaliamekh/clean-architecture-with-python-d62712fd8d4f).## Local setup
Create a virtual environment and install dependencies
```shell
python3 -m venv venv && venv/bin/pip install -r src/requirements.txt
```
Launch a mongodb instance using Docker
```shell
docker run --rm -d -p 27017:27017 --name=mongo-auctions mongo:8.0.4
```Run tests
```shell
venv/bin/pytest src/tests
```Start FastAPI application
```shell
venv/bin/fastapi dev src/drivers/rest/main.py
```## Clean up
Remove the mongodb container
```shell
docker rm -f mongo-auctions
```