A .NET 10 Clean Architecture template implementing Domain-Driven Design with CQRS and Vertical Slice Architecture.
📘 For AI Assistants (Google Antigravity, Cursor, Claude, Qwen, Gemini, etc.): Always reference
CLAUDE.mdbefore working on this codebase. It is the concise entry point to architecture patterns, naming conventions, layer dependencies, and development standards. Seedocs/index.mdfor the full documentation index.
- SharedKernel — common DDD abstractions (
Entity,ValueObject,Result<T>,Error,IDomainEvent,EncryptedString). - Domain — sample entities, domain events, and value objects with pure business logic.
- Application — CQRS handlers, cross-cutting concerns (logging, validation), and example use cases.
- Infrastructure — authentication, permission authorization, EF Core + PostgreSQL, Serilog, and Outbox processing.
- Web.Api — minimal API endpoints using the
IEndpointpattern. - Observability — Serilog structured logging with Seq (http://localhost:8081 by default).
- Tests — architecture, unit (NetArchTest, NSubstitute, Shouldly), and API integration tests (Testcontainers).
- CI — GitHub Actions for build, test, and code-coverage reporting.
- .NET 10 SDK — the template targets .NET 10.
- Podman — the default container runtime .NET Aspire uses to run Postgres, pgweb, and Seq. The Podman machine must be running. Docker can be used instead by overriding the runtime; see docs/DevelopmentGuideline.md for runtime selection details.
dotnet build CleanArchitecture.slnx # Build
dotnet test CleanArchitecture.slnx # Run all tests
dotnet run --project src/AppHost # Run the full stack with .NET AspireSee docs/DevelopmentGuideline.md for the full command set, formatting, testing requirements, and EF Core migration workflow.
GitHub Actions builds the solution, runs all tests (including architecture tests), and publishes coverage on every push and pull request:
- Coverage report (main branch): https://quannv108.github.io/clean-architecture-template/
- PR summary: coverage is added automatically to pull request checks.
- Artifacts: coverage reports are downloadable from the Actions tab.
Generate coverage locally with ./scripts/ci-local.sh (Linux/macOS) or scripts\ci-local.bat (Windows). The manual
command set is documented in docs/DevelopmentGuideline.md.
Start at docs/index.md for the full index. Highlights:
- Architecture — layers, CQRS/decorator pipeline, data access, domain events, conventions.
- Vertical Slice Structure — feature organization and placement rules.
- Feature Templates — step-by-step templates for adding Simple/Medium/Complex features.