Skip to content

Guide · Open source

How to use CleanArchitecture: install, create and run a solution

Updated · written with AI from the project's own documentation and checked against our catalogue data

CleanArchitecture is an open-source solution template for the .NET CLI that generates a new ASP.NET Core project organized into Clean Architecture layers. It can include an Angular or React frontend and uses SQLite, PostgreSQL or SQL Server as the database. After this guide you will have installed the template, created a solution, and run it locally.

Clean Architecture Solution Templatejasontaylordev/CleanArchitecture · ★ 20.7k · MIT

Quick start

  1. 1Install .NET 10.0 SDK. Install the .NET 10.0 SDK or later, which the template requires.
  2. 2Install the template. Run dotnet new install Clean.Architecture.Solution.Template.
  3. 3Choose a frontend and database. Decide between angular, react or none for the client, and postgresql, sqlite or sqlserver for the database.
  4. 4Create the solution. Run dotnet new ca-sln with -cf, -db and -o set to your choices.
  5. 5Start Docker if needed. If you chose PostgreSQL or SQL Server, start Docker Desktop or Podman first.
  6. 6Run the app. From the solution folder, run aspire run, or run dotnet run --project .\src\AppHost with the .NET CLI.

Check the prerequisites

You need the .NET 10.0 SDK or later. The README lists it as the only requirement for an ASP.NET Core Web API with SQLite.

  • Node.js (LTS): only needed if you choose the Angular or React frontend.
  • Docker Desktop or Podman (or any OCI-compliant container runtime): only needed for SQL Server or PostgreSQL. SQLite, the default, does not need it.

Install the template

Install the template once with the .NET CLI using the package name from the README.

dotnet new install Clean.Architecture.Solution.Template

Create a new solution with the right options

Create the solution with the ca-sln template. The --client-framework (-cf) option accepts angular, react or none, and defaults to angular. The --database (-db) option accepts postgresql, sqlite or sqlserver, and defaults to sqlite. The --output (-o) option sets the folder name.

Run dotnet new ca-sln --help to see all available template options.

  • Angular SPA with ASP.NET Core Web API and PostgreSQL: dotnet new ca-sln -cf angular -db postgresql -o YourProjectName
  • React SPA with ASP.NET Core Web API and SQL Server: dotnet new ca-sln -cf react -db sqlserver -o YourProjectName
  • ASP.NET Core Web API only with SQLite: dotnet new ca-sln -cf none -db sqlite -o YourProjectName
dotnet new ca-sln -cf none -db sqlite -o YourProjectName

Run the app

The README recommends the Aspire CLI, which runs the app from the solution folder. If you prefer the .NET CLI, run the AppHost project instead. The Aspire dashboard opens automatically and shows the application URLs and logs.

For the full walkthrough, see the Getting started guide on the project documentation site.

aspire run

Understand what you get

The template generates a multi-project solution rather than a single file. The README says the stack includes ASP.NET Core 10, Aspire, Entity Framework Core 10, Angular 21 or React 19, MediatR, AutoMapper, FluentValidation, and Scalar for API documentation.

The main branch targets .NET 10.0. Older branches exist for .NET 9.0 down to .NET Core 3.1 if your environment needs them.

Get help and read the design decisions

Key design decisions are recorded as Architecture Decision Records in the docs/decisions folder of the repository. If something fails, the README asks you to raise a new issue on the project's GitHub issues page.

What people use it for

  • Starting a new ASP.NET Core Web API with a layered project structure
  • Building an Angular or React single-page app backed by ASP.NET Core
  • Learning how Clean Architecture layers are organized in a real .NET project
  • Quick local development with SQLite, which needs no Docker

Frequently asked questions

Is CleanArchitecture free to use?

Yes. The project is licensed under the MIT License, as stated in the README. Check the LICENSE file in the repository for the full terms.

What are the requirements for CleanArchitecture?

You need the .NET 10.0 SDK or later. Node.js (LTS) is needed only for the Angular or React frontend, and Docker Desktop or Podman is needed only for SQL Server or PostgreSQL.

Do I need Docker to use CleanArchitecture?

No, not if you use SQLite, which is the default database. Docker Desktop or Podman is required only when you choose SQL Server or PostgreSQL.

How do I install the CleanArchitecture template?

Run dotnet new install Clean.Architecture.Solution.Template in a terminal. Then create a solution with dotnet new ca-sln and your chosen options.

Can I use CleanArchitecture without a frontend?

Yes. Set --client-framework to none (-cf none) to generate an ASP.NET Core Web API only.

What is the difference between CleanArchitecture and ABP Framework or Ardalis CleanArchitecture?

The README does not compare this template with other projects, so this guide cannot make that comparison. ABP Framework and Ardalis CleanArchitecture are separate projects you can review on their own sites.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this template if you are starting a new ASP.NET Core app or Web API and want a structured Clean Architecture layout with a chosen database and optional Angular or React frontend. Pick something else if you do not work with .NET or C#, need a minimal single-file app, or want a non-.NET stack.

Install options & downloads