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…

Что это такое?Шаблон решения для ASP.NET Core, который даёт вам проверенную отправную точку в стиле Clean Architecture — слабо связанную структуру проекта с инверсией зависимостей, известную также как гексагональная архитектура, порты и адаптеры или «луковая» архитектура.
Это фреймворк или библиотека, которую я добавляю в свой проект?Ни то ни другое — это шаблон проекта для dotnet CLI. После установки он разворачивает готовое решение на ASP.NET Core (проекты Core, Use Cases, Infrastructure и Web плюс тестовые проекты), внутри которого вы затем строите своё приложение.
Как начать с ним проект?Установите шаблон через dotnet CLI (dotnet new install Ardalis.CleanArchitecture.Template), затем создайте решение командой dotnet new clean-arch для полной версии или dotnet new min-clean для минимальной. Дальнейшие шаги описаны в разделе Getting Started официальной документации.
Нужна ли заранее установленная конкретная версия .NET?Да — .NET SDK. В README сказано, что основная ветка теперь использует .NET 9, что соответствует версии пакетов на NuGet 10.x, а для более старых окружений доступны прежние релизы шаблона.
Есть ли подводные камни при настройке?Сгенерированный сайт работает по HTTPS и ожидает самоподписанный сертификат разработчика для localhost — из-за этого в Chrome могут появляться ошибки; в README есть ссылка на инструкции, как это обойти.
Это привязывает меня к Windows и Visual Studio?Нет — всё делается через кроссплатформенный dotnet CLI, а CI в репозитории собирает и тестирует проект на разных платформах, так что Linux и macOS тоже подходят.
Чем полный шаблон отличается от минимального?clean-arch — это полное решение со всеми проектами и паттернами на месте, а min-clean — облегчённый вариант, где меньше шаблонного кода на удаление. Раздел Template Comparison в README (Which Template Should I Use?) поможет выбрать.
Меня заставят использовать minimal APIs, или можно взять Controllers и Razor Pages?Шаблон делает ставку на API-эндпоинты через пакет Ardalis.ApiEndpoints, но в README описано, как добавить Controllers или Razor Pages, если вы предпочитаете один из этих вариантов.
Шаблон заточен под domain-driven design?Скорее да: Domain Events входят в число документированных паттернов, и та же архитектура лежит в основе курса NimblePros' DDD Fundamentals от Стива Смита и Джули Лерман. Сама же Clean Architecture — это более широкая идея слабой связанности, а не конкретно DDD.
У меня старая версия шаблона — обновление будет болезненным?Не особо: на официальном сайте документации есть Migration Guides для перехода между версиями, а README просит обновляющихся сначала с ними ознакомиться.
Creator
ardalis
Size
3.6 MB
Stars
18.5K
Age
10y
Commits · 90 Days