Skip to content

Ubademy/ubademy.service.pytemplate

Repository files navigation

ubademy.service.pytemplate

codecov Tests Linters Deploy

This is a template repository for a REST api on python.

Technologies

Architecture

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

Run

docker-compose build

docker-compose up

Access api swagger at: http://127.0.0.1:8000/docs#/

Tests

make test

Reformat

make fmt

Lint

make lint

About

Template repository for Rest api on python

Resources

Stars

Watchers

Forks