Skip to content

An example of the Uncle Bob's Clean Architecture implementing to FastAPI, Django and Flask

Notifications You must be signed in to change notification settings

erickod/py_clean_arch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About this project

This project is an use example of the Uncle Bob's Clean Architecture, and here we are using some dependencies:

  • FastApi
  • Django
  • Flask

There's an abstraction called HttpServer implemented to each framework above, and this abstraction works with a controller implementing it's own route;

Also you'll see the HealthCheckUseCase and the HealthCheckController as an example/way of how implement your own routes;

How run this project

  • Install poetry: https://python-poetry.org/docs/#installation
  • Inside the py_clean_arch dir call poetry shell and poetry install
  • Go to the main.py file and choose one of the servers (FastApiHttpServer, FlaskHttpServer, DjangoHttpServer) and let the others commented:
  • If your chooice was the DjangoHttpServer, run the default Django migrations inside the py_clean_arch dir using the python infra/http/django_http_server/manage.py migrate command;
  • Inside the py_clean_arch dir run the project by calling python main.py
  • To check the server running make a GET request to the /health_check/ endpoint and you'll get it:
{"http_server": "DjangoHttpServer", "status": "running"}

I hope it helps. Feel free to propose any changes.

About

An example of the Uncle Bob's Clean Architecture implementing to FastAPI, Django and Flask

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages