Full version, ...
Create an ERP to manage a factory that produces beer ... what else?
The idea behind this architecture style is simple:
- Low Coupling: Each module should be independent of other modules in the system
- High Cohesion: Components of the module are all related thus making it easier to understand what module does as a self-contained subsystem (SRP)
From a high level, the architecture defines an API, two modules, and a common event bus for communication (IMediatr):
Each module is separated into some projects, which are implemented as separate binaries:
Facade
for handling all requestsDomain
for domain logic and as a handler for all CommandsMessages
for the definitions of Commands and Events classesReadModel
for the handlers of DomainEvents and the readmodel managementSharedKernel
that contains domainId, Dtos, and all shared components
Are special tests that ensure that the architecture, defined at the beginning of the project, remains valid.
In this solution we used two different libraries
- NetArchtest is a fluent API for .Net Standard that can enforce architectural rules in unit tests. It's inspired by the ArchUnit library for java
- docker build -t brewup .
- docker run --rm -p 8000:80 brewup