Skip to content

Clean Architecture Solution Template

A .NET project template that generates a starter ASP.NET Core app with Clean Architecture layers.jasontaylordev/CleanArchitecture

Stars
20.7k
Forks
4.3k
Licence
MIT
Language
C#
Last update
4 days ago
Type
Framework

What it is

This is a solution template for the .NET CLI. It creates a new ASP.NET Core project organized into Clean Architecture layers, with an optional Angular or React frontend and a choice of SQLite, PostgreSQL, or SQL Server as the database. It is meant as a starting point so you do not have to set up the project structure yourself.

  • Generate a Web API-only solution with SQLite using the ca-sln template
  • Generate an Angular or React single-page app backed by ASP.NET Core
  • Run the generated app with the Aspire CLI and view its dashboard
  • Use the included ADR documents to understand design decisions

Great for

  • Developers starting a new ASP.NET Core web app or Web API who want a structured layout
  • Teams that want a Clean Architecture starting point with a chosen database and frontend
  • .NET developers learning how layered architecture is laid out in a real project
  • Developers who want SQLite by default for quick local work without Docker

Not ideal for

  • Developers who do not use .NET or C#, since the template only generates ASP.NET Core solutions
  • Anyone wanting a minimal single-file app, because the template generates a multi-project solution
  • Teams needing a non-.NET stack; the README covers only ASP.NET Core
Step-by-step guide: how to use Clean Architecture Solution TemplateInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: .NET 10.0 SDK or later · Node.js (LTS), only for Angular or React frontend · Docker Desktop or Podman, only for SQL Server or PostgreSQL

    Install the template

    dotnet new install Clean.Architecture.Solution.Template

    Create a new solution (example: Angular with PostgreSQL)

    dotnet new ca-sln -cf angular -db postgresql -o YourProjectName
  2. 2

    Run it

    • Install the .NET template with dotnet new install
    • Create a solution with dotnet new ca-sln, choosing client framework and database
    • Run the app with aspire run (recommended) or dotnet run --project .\src\AppHost
    • Open the Aspire dashboard that opens automatically to see application URLs and logs
  3. 3

    Get the most out of it

    • Run dotnet new ca-sln --help to see all template options
    • Choose -cf none for a Web API only setup
    • Read the Architecture overview in the project documentation to understand the layers
    • Review the Architecture Decision Records in docs/decisions to see why choices were made

Downloads

Strengths

  • Installs as a standard .NET template with a documented command and options
  • Lets you choose frontend and database at creation time, with SQLite as the default
  • Includes a published documentation site and architecture decision records

Trade-offs

  • Generates a sizable multi-project solution, which may be more structure than a small app needs
  • Using SQL Server or PostgreSQL requires Docker or Podman, per the README
  • The README is truncated here, so details beyond the setup steps are not fully verified

How it compares

ProjectStarsTypeLevelUpdatedBest for
CleanArchitecture (this)20.7kFrameworkintermediate4 days agoDevelopers starting a new ASP.NET Core web app or Web API who want a structured layout
CleanArchitecture18.5kFrameworkintermediate2 months agoC# developers starting a new ASP.NET Core project who want a structured layout
modular-monolith-with-ddd14.1kLearning resourceadvanced2.4 years agoDevelopers learning Domain-Driven Design tactical patterns in C#
aspnetboilerplate12kFrameworkadvanced11 days agoC# developers already working in the ASP.NET Core ecosystem
angular101kFrameworkintermediate6 days agoDevelopers building larger, multi-screen web applications
aspnetcore38.5kLibraryintermediate4 days agoC# and .NET developers building web apps or HTTP APIs

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.