Updated 4 months ago

Ship faster with Clean Architecture

A production-ready .NET template with the layers already drawn and the dependency rule enforced: CQRS, JWT with refresh tokens, EF Core, caching, telemetry, and tests. Focus on features, not the foundation.

Secure Delivery
Instant Access
No Credit Card
Template user
Template user
Template user
Template user
Template user

45,000+ developers already using this

The dependency rule
Presentation
Infrastructure
Application
Domain

inward · every layer depends only on the ones inside it. The Domain at the core depends on nothing.

outward · a Domain class reaching for the database points the wrong way, and the architecture tests fail the build.

45,000+

Developers

4

Layers, enforced

.NET 10

Framework

Free

Forever

One feature, every layer in its place

Creating a todo touches four projects, and each one holds exactly the concern it should. Click a layer to see the file that lives there.

src/Domain/Todos/TodoItem.cs
public sealed class TodoItem : Entity
{
public Guid Id { get; set; }
public string Description { get; set; }
public Priority Priority { get; set; }
public bool IsCompleted { get; set; }
// raises TodoItemCreatedDomainEvent
}

The boundaries are the point. When a feature grows, you always know where each part belongs, and the architecture tests keep it honest.

Start with the foundation already laid

The whole template is free. Drop your email and it is in your inbox in a minute.

Get the template

The journey of a request

A request crosses the layers inward and the answer comes back out, each boundary doing exactly one job.

01

Endpoint

Web.Api

A Minimal API endpoint receives the request, rate limited and authenticated first.

02

Handler

Application

The use case runs, wrapped by validation and logging decorators. No exceptions for control flow.

03

Domain

Domain

Entities enforce the business rules and raise domain events. The core depends on nothing.

04

Persist

Infrastructure

EF Core against PostgreSQL, behind an interface the Application layer owns.

05

Respond

Web.Api

The Result maps to 200 or to a ProblemDetails payload. Never a raw exception.

Rate limiting, authentication, validation, logging, caching, and ProblemDetails responses. Configured, not just referenced.

Batteries included, opinions where it matters

The boring parts of a new .NET API, decided and implemented, so day one is spent on your domain.

CQRS you own

Lightweight ICommand and IQuery abstractions with no third-party dispatcher. Logging and validation are plain decorators you can read in a minute.

Auth that survives production

JWT authentication with refresh tokens and rotation, plus permission-based authorization you can extend per endpoint.

EF Core and PostgreSQL

Snake_case naming, migrations, entity configurations, and a domain events dispatcher, all behind an interface the Application layer owns.

HybridCache built in

Fast, unified caching with cache keys and invalidation already modeled, wired into the read paths that need it.

Grafana, Loki, and Tempo

OpenTelemetry tracing and metrics flow over OTLP into the bundled Grafana stack. Logs, traces, and metrics from the first run.

Tests that guard the design

Architecture tests enforce the dependency rule, unit tests cover the handlers, and Testcontainers integration tests hit a real database.

A solution that tells you where things go

Five projects, each with one job. The SharedKernel holds the primitives, and the dependency rule points every arrow inward toward the Domain.

  • Domain holds entities and domain events, and depends on nothing
  • Application holds use cases behind ICommand and IQuery abstractions
  • Infrastructure implements persistence, auth, and caching
  • Web.Api exposes Minimal API endpoints and the composition root
  • Architecture, unit, and Testcontainers integration tests in tests/

Prefer everything in one project? The Vertical Slice template is the same conventions in a single project, one file per feature.

clean-architecture/
src/
├─ Domain/ # entities, domain events
├─ Application/ # use cases, CQRS, decorators
├─ Infrastructure/ # EF Core, auth, caching
├─ Web.Api/ # endpoints, composition root
└─ SharedKernel/ # Result, Error, primitives
 
tests/
├─ ArchitectureTests/ # the dependency rule
├─ Application.UnitTests/
└─ IntegrationTests/ # Testcontainers

Five projects, .NET 10, free forever. The dependency rule enforced from the first commit.

Get the template

Running in two minutes

1

Drop your email

The template lands in your inbox as a ready-to-run solution. No sign-up wall, no upsell required.

2

docker compose up

PostgreSQL and the Grafana stack start together. Then dotnet run --project src/Web.Api.

3

Add your first feature

Copy the Todos slice across the layers, or let the bundled Claude Code skills scaffold it for you.

Questions people ask

What is the dependency rule?

Source code dependencies may only point inward. Presentation and Infrastructure depend on Application, Application depends on Domain, and Domain depends on nothing. The template enforces this with architecture tests, so a wrong dependency fails the build instead of rotting the design quietly.

Which .NET version does the template target?

It targets .NET 10 by default. Directory.Build.props has notes for retargeting to .NET 8 or .NET 9 if you are not on the latest runtime yet.

How does the CQRS dispatching work?

The template ships its own ICommand, IQuery, ICommandHandler, and IQueryHandler abstractions, registered by assembly scanning. Handlers are injected directly, and cross-cutting concerns like logging and validation are plain decorators you can read in a minute.

Is this the same as the Vertical Slice template?

No. This one keeps the classic layered projects (Domain, Application, Infrastructure, Web.Api) with the dependency rule enforced across them. The Vertical Slice template collapses everything into one project with a file per feature. Both are free, pick the shape that fits your team.

Is it really free?

Yes. The template is free forever, and so are the updates. You get an email when a new version ships.

Build on a foundation that holds

The full Clean Architecture template, free, in your inbox. Clone it, run it, and start shipping features.

Secure Delivery
Instant Access
No Credit Card

No credit card. Targets .NET 10, works on .NET 8 and 9.