Repolode
jasontaylordev

jasontaylordev/CleanArchitecture

A .NET solution template that scaffolds an ASP.NET Core app following Clean Architecture, with Angular, React, or API-only options.

Stars
20,651
Forks
4,291
Open issues
9
Last commit
13 hours ago

What is it?

This template generates a new ASP.NET Core solution structured around Clean Architecture, separating domain, application, infrastructure, and web layers. You choose a client framework (Angular, React, or none for API only) and a database provider (SQLite by default, or PostgreSQL and SQL Server) when creating the solution with the dotnet CLI.

The generated project uses Entity Framework Core for data access, MediatR for request handling, AutoMapper and FluentValidation for mapping and validation, and Scalar for API documentation. Tests are set up with NUnit, Shouldly, Moq, and Respawn. Aspire orchestrates the application and its dependencies during local development.

The template is distributed as a NuGet package and is versioned by .NET release, with branches kept for earlier .NET versions.

Key features

  • 01Generates solutions with Angular, React, or API-only front ends via dotnet new.
  • 02Supports SQLite, PostgreSQL, and SQL Server as database providers.
  • 03Layers code into domain, application, infrastructure, and web projects.
  • 04Includes MediatR, AutoMapper, and FluentValidation for application logic.
  • 05Runs locally through Aspire with a dashboard showing app URLs and logs.
  • 06Ships with a test setup using NUnit, Shouldly, Moq, and Respawn.

Use cases

  • Starting a new enterprise ASP.NET Core project that needs a layered structure from day one.
  • Building a Web API backend paired with an Angular or React single-page app.
  • Learning how Clean Architecture is applied in a .NET codebase.

Quick start

  1. 1

    Install the .NET template

    dotnet new install Clean.Architecture.Solution.Template
  2. 2

    Create a new solution with your chosen client framework and database

    dotnet new ca-sln --client-framework [angular|react|none] --database [postgresql|sqlite|sqlserver] --output YourProjectName
  3. 3

    Run the app with the Aspire CLI (recommended)

    aspire run

Things to know

  • Requires the .NET 10.0 SDK or later.
  • Using SQL Server or PostgreSQL requires Docker Desktop or Podman.

Topics

FAQ

What is CleanArchitecture?
A .NET solution template that scaffolds an ASP.NET Core app following Clean Architecture, with Angular, React, or API-only options. This template generates a new ASP.NET Core solution structured around Clean Architecture, separating domain, application, infrastructure, and web layers. You choose a client framework (Angular, React, or none for API only) and a database provider (SQLite by default, or PostgreSQL and SQL Server) when creating the solution with the dotnet CLI.
Is CleanArchitecture free to use? What license does it have?
CleanArchitecture is open source under the MIT license. Check the license terms before using it in commercial products.
Is CleanArchitecture still maintained?
Actively maintained. The last commit to CleanArchitecture was on Oct 21, 2026.
What can I use CleanArchitecture for?
Starting a new enterprise ASP.NET Core project that needs a layered structure from day one. Building a Web API backend paired with an Angular or React single-page app. Learning how Clean Architecture is applied in a .NET codebase.
How do I install CleanArchitecture?
Install the .NET template: dotnet new install Clean.Architecture.Solution.Template Create a new solution with your chosen client framework and database: dotnet new ca-sln --client-framework [angular|react|none] --database [postgresql|sqlite|sqlserver] --output YourProjectName Run the app with the Aspire CLI (recommended): aspire run
Where can I get CleanArchitecture?
The source code and installation instructions are on GitHub: https://github.com/jasontaylordev/CleanArchitecture

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects