This is a template repository for a REST api on python.
Directory structure (based on Onion Architecture):
├── main.py
├── app
│ ├── domain
│ │ └── course
│ │ ├── course.py # Entity
│ │ ├── course_exception.py # Exception definitions
│ │ └── course_repository.py # Repository interface
│ ├── infrastructure
│ │ └── sqlite
│ │ ├── course
│ │ │ ├── course_dto.py # DTO using SQLAlchemy
│ │ │ ├── course_query_service.py # Query service implementation
│ │ │ └── course_repository.py # Repository implementation
│ │ └── database.py
│ ├── presentation
│ │ └── schema
│ │ └── course
│ │ └── course_error_message.py
│ └── usecase
│ └── course
│ ├── course_command_model.py # Write models including schemas of the RESTFul API
│ ├── course_command_usecase.py
│ ├── course_query_model.py # Read models including schemas
│ ├── course_query_service.py # Query service interface
│ └── course_query_usecase.py
└── tests
docker-compose build
docker-compose up
Access api swagger at: http://127.0.0.1:8000/docs#/
make test
make fmt
make lint