dotnet new templates for .NET 10

Clean Architecture templates for .NET, minus the ceremony.

Five templates, one sensible core. Each one builds the same small movie review app on the same Application and Infrastructure layers. Only the front door changes, so once you've learned one, you've learned the lot.

dotnet new install CleanMinimalApi.Template
dotnet new cleanminimalapi --name Acme.Movies
cd Acme.Movies && docker compose up -d

The templates

Same core, five front doors

Pick how your app talks to the world. Everything behind that is identical, right down to the tests, and every template has its own colour so you can tell them apart at a glance.

Clean Minimal API

ASP.NET Core Minimal APIs

  • Endpoints grouped by feature
  • OpenAPI from XML comments, browsed in Scalar
  • Problem Details errors and optional JWT bearer auth
dotnet new install CleanMinimalApi.Template
dotnet new cleanminimalapi --name Acme.Movies

Clean Model Context Protocol

Model Context Protocol servers

  • Six task-shaped tools, plus resources and prompts
  • Streamable HTTP, with the MCP Inspector in Docker Compose
  • Optional OAuth protection
dotnet new install CleanModelContextProtocol.Template
dotnet new cleanmodelcontextprotocol --name Acme.Movies

Clean GraphQL API

GraphQL on Hot Chocolate

  • Hot Chocolate with the Nitro IDE built in
  • Relay cursor paging and DataLoaders
  • Optional JWT bearer auth
dotnet new install CleanGraphQLApi.Template
dotnet new cleangraphqlapi --name Acme.Movies

Clean Web API

ASP.NET Core Web APIs

  • Controllers grouped by feature, kept thin by Mediator
  • OpenAPI from XML comments, browsed in Scalar
  • Problem Details errors and optional JWT bearer auth
dotnet new install CleanWebApi.Template
dotnet new cleanwebapi --name Acme.Movies
  • Packaged as a container image
  • Source-generated JSON for quick cold starts
  • Paging and search for every list
dotnet new install CleanLambdaFunction.Template
dotnet new cleanlambdafunction --name Acme.Movies

In every one of them

The Application and Infrastructure layers are shared, so all five come with the same kit.

  • .NET 10
  • Mediator
  • FluentValidation
  • Mapperly
  • EF Core and SQLite migrations
  • Paging and search
  • xUnit, Shouldly and NSubstitute
  • 95% coverage gate
  • CodeQL and Trivy
  • Monthly NuGet releases

How they work

Three layers, no ceremony

The templates are loosely based on Clean Architecture, inspired by Jason Taylor's Clean Architecture template, with some ideas taken further and others scaled back. It's by no means perfect, which is why we call it Lean Mean Clean Architecture.

  1. Changes per template

    Presentation

    Minimal APIs, MCP tools, GraphQL, controllers or Lambda handlers. It sends commands and queries through Mediator and turns errors into whatever its protocol expects.

  2. Shared

    Application

    Owns the domain and the business rules. Commands and queries are validated and handled here, against repository interfaces it doesn't care how you fulfil.

  3. Shared

    Infrastructure

    Owns the data, with EF Core and SQLite behind those interfaces. Every class is internal, so Presentation can wire it up but can't reach in by accident.

The team

Small team, strong opinions

A small team, built and looked after in spare time. Small as in one person, for now. Help is always welcome, and so is company.

Stephen Walsh

Maintainer

Builds and looks after every template, keeps them current with each .NET release, and drinks the coffee.

You, maybe

Found a bug, got an idea, or want a template for something we haven't built yet? Open an issue on the template it's about. Pull requests are welcome too.