A complete .NET 10 CMMS starter with automated architecture tests, outbox pattern, and event-driven cross-aggregate coordination — pragmatic DDD without over-engineering.
Microservices-ready · Evolved into CleanArchitecture-DDD-CQRS-Microservices
Everything you need to start a maintainable .NET application — with tests that enforce the rules.
Domain, Application, Infrastructure, and API layers with dependency inversion and clear boundaries.
Aggregates, value objects, domain events, and rich domain models with encapsulated business rules.
EF Core for writes, Dapper for reads. Flexible read sources — replicas, Redis, Elasticsearch.
Guaranteed integration event delivery. Swap the publisher for message bus when you go microservices.
Dual handlers: transactional domain events and async integration events via outbox.
Automated boundary enforcement at compile time. The key differentiator of this template.
Clean Architecture layers with CQRS write and read paths, domain events, and outbox delivery.
High-level system architecture — layers, CQRS, and event flow.
Write path — commands, domain events, integration events, and outbox.
Read path — flexible data sources with eventual consistency.
Command sequence — end-to-end request flow.
See the patterns deep dive and ADRs for details.
Domain events coordinate state across aggregates within ACID transactions. See ADR-001.
SQL Server RowVersion prevents lost updates on concurrent writes. See ADR-002.
Clear separation between transactional and async side effects. See ADR-003.
Result pattern with exportable error codes for frontend localization. See ADR-005.
Run the full stack with Docker in two commands.
git clone https://github.com/mohd2sh/CleanArchitecture-DDD-CQRS.git
cd CleanArchitecture-DDD-CQRS
docker-compose up
Includes: SQL Server 2022, API service, automatic migrations and seeding.
Local dev: dotnet run --project src/CleanArchitecture.Cmms.Api
Prerequisites: .NET 10 SDK, Docker Desktop (recommended)
The template separates Domain, Application, Infrastructure, and API layers with strict dependency rules. Automated architecture tests enforce boundaries at compile time.
Commands use EF Core with write repositories. Queries use Dapper with read repositories. Architecture tests prevent read/write coupling.
Integration events are written to an outbox table in the same transaction as business data. A background processor delivers them with at-least-once semantics.
Run docker-compose up or dotnet run --project src/CleanArchitecture.Cmms.Api. See the Quick Start section.
Yes. See CleanArchitecture-DDD-CQRS-Microservices for the evolved implementation with saga orchestration and MassTransit.
Automated tests enforcing DDD rules at compile time — value object immutability, layer dependencies, CQRS separation, and bounded context isolation.