
Clean Architecture
A starter template for building ASP.NET Core apps using the Clean Architecture pattern.
- Stars
- 18.5k
- Forks
- 3.1k
- Licence
- MIT
- Language
- C#
- Last update
- 2 months ago
- Type
- Framework
What it is
This is a Visual Studio and dotnet CLI project template that gives you a pre-organized ASP.NET Core solution split into layers such as Core, Use Cases, Infrastructure and Web. It is meant as a starting point so you do not have to design that structure from scratch. The README describes it as a template for Clean Architecture, which is also called hexagonal, ports-and-adapters, or onion architecture.
- Generate a new ASP.NET Core solution with the dotnet CLI template
- Use the included layers as a base for a web API or web app
- Study how the project separates domain, use cases, and infrastructure code
Great for
- C# developers starting a new ASP.NET Core project who want a structured layout
- Developers learning Clean Architecture or domain-driven design with a working example
- Teams that want a shared starting structure for backend services
- Developers who want to choose between a full and a minimal template
Not ideal for
- Developers who are new to C# or .NET, since the template assumes familiarity with the stack
- Projects that must use a different language or framework, since this is specific to ASP.NET Core
- Anyone looking for a finished application rather than a starting point to build on
How to get it
- 1
Install with a package manager
You'll need: .NET SDK
Clone the repository
git clone https://github.com/ardalis/CleanArchitecture - 2
Run it
- Install the .NET SDK
- Install the template or clone the repository as described in the documentation
- Create a new solution from the template using the dotnet CLI
- Run the web project and open it in a browser, accepting the self-signed developer certificate if prompted
- 3
Get the most out of it
- Read the official documentation site for Getting Started steps and architectural decisions
- Review the Migration Guides when upgrading from an older template version
- Choose between Controllers, Razor Pages, or Ardalis.ApiEndpoints as described in the README
- Explore the Domain Events section to see how events are used in the design
Downloads
Strengths
- Widely starred and actively maintained, with recent pushes and a current .NET version
- Offers both a full and a minimal template so you can pick the level of structure you need
- Comes with an MIT license and documentation site with migration guides
Trade-offs
- The README is truncated here, so detailed setup steps could not be fully verified
- Clean Architecture adds layers that may be more structure than a small project needs
- The README notes the main branch targets .NET 9 while the description references ASP.NET Core 10, so check which version matches your needs
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| CleanArchitecture (this) | 18.5k | Framework | intermediate | 2 months ago | C# developers starting a new ASP.NET Core project who want a structured layout |
| CleanArchitecture | 20.7k | Framework | intermediate | 4 days ago | Developers starting a new ASP.NET Core web app or Web API who want a structured layout |
| eShopOnWeb | 10.7k | App | intermediate | 1.8 years ago | Developers learning ASP.NET Core MVC and clean architecture |
| modular-monolith-with-ddd | 14.1k | Learning resource | advanced | 2.4 years ago | Developers learning Domain-Driven Design tactical patterns in C# |
| aspnetboilerplate | 12k | Framework | advanced | 11 days ago | C# developers already working in the ASP.NET Core ecosystem |
| domain-driven-hexagon | 15k | Learning resource | intermediate | 2.4 years ago | Developers who want to understand Domain-Driven Design and hexagonal architecture through examples |
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.