CleanArchitecture README

The project's README from github.com/ardalis/CleanArchitecture. As one markdown file: README.md.

.NET Core publish Ardalis.CleanArchitecture Template to nuget Ardalis.CleanArchitecture.Template on NuGet

Follow @ardalis   Follow @nimblepros

Alt

Clean Architecture

A starting point for Clean Architecture with ASP.NET Core. Clean Architecture is just the latest in a series of names for the same loosely-coupled, dependency-inverted architecture. You will also find it named hexagonal, ports-and-adapters, or onion architecture.

Learn more about Clean Architecture and this template in NimblePros' Introducing Clean Architecture course. Use code ARDALIS to save 20%.

This architecture is used in the DDD Fundamentals course by Steve Smith and Julie Lerman.

:school: Contact Steve's company, NimblePros, for Clean Architecture or DDD training and/or implementation assistance for your team.

Take the Course!

Learn about how to implement Clean Architecture from NimblePros trainers Sarah "sadukie" Dutkiewicz and Steve "ardalis" Smith.

Table Of Contents

Give a Star! :star:

If you like or are using this project to learn or start your solution, please give it a star. Thanks!

Or if you're feeling really generous, we now support GitHub sponsorships - see the button above.

Sponsors

I'm please to announce that Amazon AWS's FOSS fund has chosen to award a 12-month sponsorship to this project. Thank you, and thanks to all of my other past and current sponsors!

Troubleshooting Chrome Errors

By default the site uses HTTPS and expects you to have a self-signed developer certificate for localhost use. If you get an error with Chrome see this answer for mitigation instructions.

Versions

The main branch is now using .NET 9. This corresponds with NuGet package version 10.x. Previous versions are available - see our Releases.

Learn More

Documentation

The official documentation for this template, including Getting Started steps, Migration Guides, and Architectural Decisions, can be found at Ardalis Clean Architecture Docs.

If you are upgrading from an older version, please be sure to review our Migration Guides on the new documentation site!

CleanArchitecture (ardalis/CleanArchitecture)

Searching Database…

What is this?A solution template for ASP.NET Core that gives you a proven Clean Architecture starting point — a loosely-coupled, dependency-inverted project layout also known as hexagonal, ports-and-adapters, or onion architecture.
Is it a framework or a library I add to my project?Neither — it's a dotnet CLI project template. Installing it scaffolds a complete ASP.NET Core solution (Core, Use Cases, Infrastructure and Web projects plus test projects) that you then build your own application inside.
How do I get a project started with it?Install the template with the dotnet CLI (dotnet new install Ardalis.CleanArchitecture.Template), then scaffold a solution with dotnet new clean-arch for the full version or dotnet new min-clean for the minimal one. The official docs have Getting Started steps for the rest.
Do I need a specific .NET version installed first?Yes — the .NET SDK. The README notes the main branch now uses .NET 9, matching NuGet package version 10.x, and older template releases are available for earlier setups.
Any setup gotchas to watch out for?The generated site runs over HTTPS and expects a self-signed developer certificate for localhost, which can produce errors in Chrome — the README links mitigation instructions.
Does this lock me into Windows and Visual Studio?No — everything goes through the cross-platform dotnet CLI, and the repo's CI runs cross-platform build-and-test workflows, so Linux and macOS are fine too.
What's the difference between the full and the minimal template?clean-arch is the complete solution with every project and pattern in place, while min-clean is a stripped-down variant with less boilerplate to delete. The README's Template Comparison section (Which Template Should I Use?) helps you choose.
Am I forced into minimal APIs, or can I use Controllers and Razor Pages?The template favors API endpoints via the Ardalis.ApiEndpoints package, but the README documents how to add Controllers or Razor Pages if you prefer either of those.
Is this opinionated toward domain-driven design?It leans that way: Domain Events are among the documented patterns, and the same architecture underpins NimblePros' DDD Fundamentals course by Steve Smith and Julie Lerman. Clean Architecture itself, though, is the broader loosely-coupled idea, not DDD specifically.
I'm on an older template version — is upgrading painful?Not especially: the official documentation site ships Migration Guides for moving between versions, and the README asks upgraders to review them before starting.
Creator
ardalis
Size
3.6 MB
Stars
18.5K
Age
10y
Commits · 90 Days