<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Choosing a Template on Ardalis Clean Architecture</title><link>https://28d2d298.cleanarchitecture.pages.dev/templates/</link><description>Recent content in Choosing a Template on Ardalis Clean Architecture</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://28d2d298.cleanarchitecture.pages.dev/templates/index.xml" rel="self" type="application/rss+xml"/><item><title>Clean Architecture (clean-arch)</title><link>https://28d2d298.cleanarchitecture.pages.dev/templates/clean-architecture/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://28d2d298.cleanarchitecture.pages.dev/templates/clean-architecture/</guid><description>&lt;h1 id="clean-architecture-template-clean-arch"&gt;Clean Architecture Template (&lt;code&gt;clean-arch&lt;/code&gt;)&lt;a class="anchor" href="#clean-architecture-template-clean-arch" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dotnet new install Ardalis.CleanArchitecture.Template
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dotnet new clean-arch -o Your.ProjectName&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The full template generates a multi-project solution where each layer is its own project, so the compiler enforces which layers may depend on which.&lt;/p&gt;
&lt;h2 id="solution-structure"&gt;Solution structure&lt;a class="anchor" href="#solution-structure" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Your.ProjectName/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── src/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.Core/ Domain model: aggregates, value objects, events, specifications, interfaces
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.UseCases/ Application layer: commands, queries, and their handlers (CQRS)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.Infrastructure/ EF Core, repositories, query services, email
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.Web/ ASP.NET Core host: FastEndpoints API, DI and middleware configuration
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.AspireHost/ .NET Aspire app host: SQL Server and Papercut SMTP containers
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ └── Your.ProjectName.ServiceDefaults/ Aspire service defaults: OpenTelemetry, health checks, resilience
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── tests/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.UnitTests/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.IntegrationTests/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.FunctionalTests/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ └── Your.ProjectName.AspireTests/ Placeholder for Aspire tests (not in the .slnx by default)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── Directory.Build.props Target framework, nullable, warnings as errors, Central Package Management
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── Directory.Packages.props Every NuGet package version, in one place
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── global.json .NET SDK version
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── nuget.config Package sources (nuget.org)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── .runsettings Parallel test execution settings
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└── Your.ProjectName.slnx&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="project-dependencies"&gt;Project dependencies&lt;a class="anchor" href="#project-dependencies" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Dependencies point inward, toward Core. Core depends on no other project in the solution.&lt;/p&gt;</description></item><item><title>Minimal Clean (min-clean)</title><link>https://28d2d298.cleanarchitecture.pages.dev/templates/minimal-clean/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://28d2d298.cleanarchitecture.pages.dev/templates/minimal-clean/</guid><description>&lt;h1 id="minimal-clean-architecture-template-min-clean"&gt;Minimal Clean Architecture Template (&lt;code&gt;min-clean&lt;/code&gt;)&lt;a class="anchor" href="#minimal-clean-architecture-template-min-clean" aria-label="Link"&gt;&lt;/a&gt;&lt;/h1&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dotnet new install Ardalis.MinimalClean.Template
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;dotnet new min-clean -o Your.ProjectName&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="overview"&gt;Overview&lt;a class="anchor" href="#overview" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;strong&gt;Minimal Clean Architecture&lt;/strong&gt; template takes a simplified, pragmatic approach to Clean Architecture for ASP.NET Core applications. It keeps the core principles (separation of concerns, dependency inversion, and testability) while reducing complexity by putting the application in a single project organized into vertical slices (Vertical Slice Architecture, or VSA).&lt;/p&gt;
&lt;h2 id="philosophy"&gt;Philosophy&lt;a class="anchor" href="#philosophy" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="core-principles"&gt;Core principles&lt;a class="anchor" href="#core-principles" aria-label="Link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Simplicity first&lt;/strong&gt;: minimize unnecessary abstractions and project boundaries&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vertical slices&lt;/strong&gt;: organize by feature rather than by technical layer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pragmatic DDD&lt;/strong&gt;: use domain patterns where they add value, not everywhere&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Progressive enhancement&lt;/strong&gt;: start simple, and add complexity only when it&amp;rsquo;s needed&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="clean-architecture-principles-it-keeps"&gt;Clean Architecture principles it keeps&lt;a class="anchor" href="#clean-architecture-principles-it-keeps" aria-label="Link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;✅ &lt;strong&gt;Dependency inversion&lt;/strong&gt;: the domain doesn&amp;rsquo;t depend on infrastructure&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Testability&lt;/strong&gt;: business logic can be tested in isolation&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Separation of concerns&lt;/strong&gt;: clear boundaries between domain, features, and infrastructure&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;Framework independence&lt;/strong&gt;: domain logic isn&amp;rsquo;t coupled to ASP.NET Core&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="what-it-simplifies-compared-to-the-full-template"&gt;What it simplifies compared to the full template&lt;a class="anchor" href="#what-it-simplifies-compared-to-the-full-template" aria-label="Link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Single project&lt;/strong&gt;: application code lives in one Web project instead of four or more&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Fewer patterns&lt;/strong&gt;: essential DDD patterns (aggregates, strongly typed IDs, a few value objects, specifications), without the full catalog&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Colocated use cases&lt;/strong&gt;: each feature folder holds its endpoint &lt;em&gt;and&lt;/em&gt; its Mediator command or query handler; simple endpoints can skip Mediator entirely&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Vertical organization&lt;/strong&gt;: group by feature (products, cart) instead of by layer&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;No test projects&lt;/strong&gt;: add the ones you need (see &lt;a href="#testing-strategy"&gt;Testing strategy&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="solution-structure"&gt;Solution structure&lt;a class="anchor" href="#solution-structure" aria-label="Link"&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#e6edf3;background-color:#0d1117;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Your.ProjectName/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── src/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.Web/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ ├── Domain/ Domain layer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── CartAggregate/ Cart (aggregate root), CartItem, CartId, specifications
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── GuestUserAggregate/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── OrderAggregate/ Order, OrderItem, Price and Quantity value objects
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── ProductAggregate/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ └── Interfaces/ IEmailSender
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ ├── CartFeatures/ Vertical slices for the cart
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── AddToCart/ AddToCartEndpoint + AddToCartHandler (command)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── Checkout/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── GetById/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── CartDto.cs
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ └── CartResponse.cs
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ ├── ProductFeatures/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── Create/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── GetById/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ └── List/ Endpoint, handler, and IListProductsQueryService
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ ├── Infrastructure/ Infrastructure layer
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ ├── Data/ AppDbContext, EfRepository, Config/, Migrations/, Queries/, SeedData
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ │ └── Email/ MimeKitEmailSender, FakeEmailSender
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ ├── Configurations/ Logger, Mediator, middleware, options, and service registration
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ ├── config.nsdepcop Namespace dependency rules, checked at build time
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ │ └── Program.cs
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ ├── Your.ProjectName.AspireHost/ .NET Aspire app host (SQL Server + Papercut SMTP containers)
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;│ └── Your.ProjectName.ServiceDefaults/
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── Directory.Build.props
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── Directory.Packages.props
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;├── global.json
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;└── Your.ProjectName.slnx&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="vertical-slice-organization"&gt;Vertical slice organization&lt;a class="anchor" href="#vertical-slice-organization" aria-label="Link"&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Each feature folder (&lt;code&gt;CartFeatures&lt;/code&gt;, &lt;code&gt;ProductFeatures&lt;/code&gt;) contains one sub-folder per use case. A use-case folder holds everything for that operation: the FastEndpoints endpoint with its request type and validator, and the Mediator command or query with its handler. The domain types the feature works with live in &lt;code&gt;Domain/&lt;/code&gt;, and the EF Core mappings for them live in &lt;code&gt;Infrastructure/Data/Config/&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>