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;
- Install poetry: https://python-poetry.org/docs/#installation
- Inside the
py_clean_arch
dir callpoetry shell
andpoetry 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 thepy_clean_arch
dir using thepython infra/http/django_http_server/manage.py migrate
command; - Inside the
py_clean_arch
dir run the project by callingpython 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.