Skip to content

[2022] Python example of the clean architecture (use-cased based "hexagonal architecture" or "ports & adapters architecture") with both an http controller and a Kafka controller.

Notifications You must be signed in to change notification settings

julienharbulot/clean-architecture-example

Repository files navigation

Clean Architecture Example Project

This project was created as an example implementation of the Clean Architecture (as well as Hexagonal Architecture, Ports & Adapters Architecture) with an http controller.

Installation:

pip install -r pip-requirements.txt

Running the http server:

python -m src.http_app

Running the example script:

python demo_http_queries.py

Running the unit tests:

./scripts/tests.sh

Design

General overview

  • Project configuration and entrypoint happens in __main__.App
  • The controller is implemented in http_controller.py, it builds the request model object and forwards it to the use case
  • Each use case is implemented in its own package: create_user, activate_user, get_user

General Overview

Use-case overview

Use-case Overview

About

[2022] Python example of the clean architecture (use-cased based "hexagonal architecture" or "ports & adapters architecture") with both an http controller and a Kafka controller.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published