MinimalClean/README.template.md
Welcome to your new project generated with the Minimal Clean Architecture template!
This is a streamlined, single-project Vertical Slice Architecture (VSA) that follows Clean Architecture principles without the overhead of multiple projects. Perfect for smaller applications, MVPs, or teams that want architectural guidance without complex project boundaries.
# Build the solution
dotnet build
# Run the application
dotnet run --project src/MinimalClean.Architecture.Web
# Or run with Aspire (if using)
dotnet run --project src/MinimalClean.Architecture.AspireHost
This template uses SQL Server in a container managed by Aspire. When you run the Aspire AppHost, it automatically starts a SQL Server container and creates the database.
dotnet run --project src/MinimalClean.Architecture.AspireHost
The SQL Server container and database are automatically provisioned and migrations are applied on startup.
If running the Web project without Aspire, update appsettings.json to use LocalDB:
dotnet ef database update -c AppDbContext -p src/MinimalClean.Architecture.Web -s src/MinimalClean.Architecture.Web
dotnet run --project src/MinimalClean.Architecture.Web
This template uses a single Web project organized by vertical slices (features):
src/MinimalClean.Architecture.Web/
├── Domain/ # Domain entities and aggregates
│ ├── CartAggregate/
│ ├── OrderAggregate/
│ └── ProductAggregate/
├── Infrastructure/ # Data access and external services
│ ├── Data/
│ │ ├── AppDbContext.cs
│ │ ├── Config/ # EF Core configurations
│ │ └── Migrations/
│ └── Email/ # Email services
├── Endpoints/ # API endpoints (FastEndpoints)
│ ├── Cart/
│ ├── Order/
│ └── Product/
└── Program.cs # Application startup
Single project vertical slice architecture
This minimal template simplifies the full Clean Architecture template:
| Full Template | Minimal Template |
|---|---|
| 4+ projects (Core, UseCases, Infrastructure, Web) | 1 Web project |
| Repository pattern with Specifications | Repository pattern with Specifications if needed |
| Extensive use of interfaces and abstractions | Pragmatic abstractions where needed |
| Separate Use Cases project with Mediator | Optional Mediator; logic can be in endpoints |
| Complex domain patterns (Aggregates, Value Objects, Domain Events) | Pragmatic DDD patterns (Aggregates, Value Objects) |
Use Minimal Clean Architecture when:
Use Full Clean Architecture when:
Domain/YourFeatureAggregate/Infrastructure/Data/Config/dotnet ef migrations add AddYourFeatureEndpoints/YourFeature/Update appsettings.json:
{
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=YourDb;Trusted_Connection=true;"
}
}
dotnet test
As your application grows, you can migrate to the full Clean Architecture template:
Learn more: Clean Architecture Template
Happy Coding! 🚀