Skip to content

shaliamekh/clean-architecture-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clean Architecture on Python with FastAPI

CI

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”.

Local setup

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

Clean up

Remove the mongodb container

  docker rm -f mongo-auctions

Contributors 2

  •  
  •  

Languages