EugenioBandeira.CleanArchTemplate
1.1.5
dotnet new install EugenioBandeira.CleanArchTemplate@1.1.5
This package contains a .NET Template Package you can call from the shell/command line.
EugenioBandeira.CleanArchTemplate
.NET 10 dotnet new template for building production-ready Web APIs with Clean Architecture and .NET Aspire.
Prerequisites
- .NET 10 SDK
- .NET Aspire workload:
dotnet workload install aspire
Installation
dotnet new install EugenioBandeira.CleanArchTemplate
Usage
dotnet new clean-arch -n MyProject
What You Get
| Concern | What's included |
|---|---|
| Architecture | Clean Architecture, IHandler<TRequest, TResponse> pattern |
| Error Handling | ErrorOr result type, GlobalExceptionHandler, RFC 7807 ProblemDetails |
| Validation | FluentValidation wired into handlers |
| Logging | Serilog with structured output, correlation ID enrichment |
| Observability | OpenTelemetry (traces, metrics, logs) via .NET Aspire ServiceDefaults |
| API | Minimal APIs, URL versioning (/api/v1), Scalar (OpenAPI), rate limiting, CORS |
| Health Checks | /health, /alive, /api/v1/health |
| Repository Pattern | Segregated interfaces per operation (IAddRepository, IGetByIdRepository, etc.) |
| Tests | xUnit, Moq, FluentAssertions, Bogus — unit + integration test projects |
| Git Hooks | Pre-commit hook that blocks commits on build failure, auto-configured on first dotnet build |
| Infrastructure | Dockerfile, Kubernetes manifests (Kustomize), IaC folder |
Generated Structure
MyProject/
├── 01 - aspire/
│ ├── 01 - AppHost/ # Aspire orchestration host
│ └── 02 - ServiceDefaults/ # Shared OTEL, health checks, service discovery
├── 02 - src/
│ ├── 01 - Api/ # Endpoints, middlewares, extensions
│ ├── 02 - Application/ # Handlers, validators, mappers
│ ├── 03 - Domain/ # Entities, interfaces, constants
│ ├── 04 - IoC/ # Dependency injection wiring
│ └── 05 - Infrastructure/ # Repository implementations
├── 03 - tests/
│ ├── 01 - Common/ # Shared test builders
│ ├── 02 - Validators/ # FluentValidation tests
│ ├── 03 - Handlers/ # Handler unit tests
│ ├── 04 - Repositories/ # Repository tests
│ └── 05 - Integration/ # API integration tests
├── docs/ # Architecture docs and ADRs
├── iac/ # Infrastructure as Code
├── k8s/ # Kubernetes manifests
└── Dockerfile
Post-Generation Setup
- Update
ConnectionStrings.DefaultConnectioninappsettings.json - Implement
ExampleRepository.cswith your chosen persistence technology - Register the repository in
InfrastructureDependencyInjection.cs - Update
Cors.AllowedOriginswith your frontend URL - Update
OpenApicontact info inappsettings.json - Set
OTEL_EXPORTER_OTLP_ENDPOINTto enable observability export (optional) - Replace the
Example*stubs with your own features
Full documentation, architecture details, middleware descriptions, and the step-by-step guide for adding new features are in the generated project's
README.md.
Contributing
- Fork and branch from
master:
git checkout -b feat/your-feature
- Make changes inside
templates/clean-arch/ - Verify the template builds:
dotnet build templates/clean-arch/CleanArch.slnx -c Release
Running
dotnet buildonce also configures the pre-commit git hook automatically viaDirectory.Build.props. From that point on, commits that break the build are blocked locally.
- Commit using Conventional Commits and open a PR targeting
master - After merging, the
releaseworkflow automatically bumpsPackageVersionand publishes to NuGet:fix:,refactor:,chore:→ patch bumpfeat:→ minor bumpfeat!:/BREAKING CHANGE→ major bump
License
MIT © eugeniobandeira
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.5 | 210 | 7/21/2026 |
| 1.1.4 | 178 | 7/21/2026 |
| 1.1.3 | 181 | 7/21/2026 |
| 1.1.2 | 210 | 7/4/2026 |
| 1.1.1 | 217 | 7/2/2026 |
| 1.1.0 | 236 | 6/24/2026 |
| 1.0.7 | 235 | 6/21/2026 |
| 1.0.6 | 238 | 6/20/2026 |
| 1.0.5 | 231 | 6/20/2026 |
| 1.0.4 | 239 | 6/10/2026 |
| 1.0.3 | 245 | 6/10/2026 |
| 1.0.2 | 249 | 6/7/2026 |
| 1.0.1 | 250 | 6/7/2026 |
| 1.0.0 | 246 | 6/7/2026 |