Inspired by Eric Evans and Vladik Khononov's books.
The purpose of this repository is to show the way of implementing supporting enterprise applications in the Python programming language.
Feel free to contribute!
What is the supporting application?
A domain is consists of multiple subdomains. Each subdomain corresponds to a different part of the business. According to Domain Driven Design there are 3 types of subdomains:
- Core subdomains - are one of the most important subdomains for business. That is what differentiates your product from products of competitors.
- Generic subdomains - are also important for business, but there are a lot of ready-for-use solutions. There is no need for optimization and every competitor does it in the same way. For example, authentication/authorization systems or message brokers.
- Supporting subdomains - are the subdomains which have no ready-for-use solutions and also have no complex logic. This type of subdomain doesn't give any competitive advantage to the business side.
Usually, to implement core applications, developers use complex patterns (such as Aggregate, CQRS, Event Sourcing and so on), but for supporting applications there is no need to do so. We can use much simpler patterns, such as Transaction Script for domain layer.
-
Clone the project:
git clone https://github.com/akhundMurad/supporting-crud-python-example.git
-
Setup environment variables (example).
-
Install Poetry package manager:
curl -sSL https://install.python-poetry.org | python3 -
-
Setup poetry config:
poetry config virtualenvs.in-project true
-
Set environment in VSCode:
Click CTRL + SHIFT + P
And then select virtual environment:
-
Install dependencies:
poetry install
-
Apply migrations:
poetry run alembic upgrade head
-
Start the server:
uvicorn src.presentation.api.asgi:asgi