CleanArchitecture README

README проекта с github.com/jasontaylordev/CleanArchitecture. Одним файлом markdown: README.md.

Clean Architecture Solution Template

Build CodeQL Nuget Nuget Twitter Follow

The goal of this template is to provide a straightforward and efficient approach to enterprise application development, leveraging the power of Clean Architecture and ASP.NET Core. Using this template, you can effortlessly create a new app with Angular, React, or Web API only, powered by ASP.NET Core and Aspire. Getting started is easy - simply install the .NET template (see below for full details).

For full documentation, visit cleanarchitecture.jasontaylor.dev.

If you find this project useful, please give it a star. Thanks! ⭐

Getting started

Prerequisites

Install the template

dotnet new install Clean.Architecture.Solution.Template

Create a new solution

Create a new solution using the template. Specify the target framework using --framework (-f), the client framework using --client-framework (-cf) and the database provider using --database (-db):

dotnet new ca-sln --framework [net10.0|net11.0] --client-framework [angular|react|none] --database [postgresql|sqlite|sqlserver] --output YourProjectName
Option Values Default
--framework net10.0, net11.0 net10.0
--client-framework angular, react, none angular
--database postgresql, sqlite, sqlserver sqlite

Examples:

🅰️ 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

🆕 Angular SPA on .NET 11 with SQL Server:

dotnet new ca-sln -f net11.0 -cf angular -db sqlserver -o YourProjectName

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

Run the app

Using the Aspire CLI (recommended):

aspire run

Or using the .NET CLI:

dotnet run --project ./src/AppHost

The Aspire dashboard will open automatically, showing the application URLs and logs.

Generated solutions also include a Dev Container with the .NET SDK, the Aspire CLI, Docker and (for Angular or React) Node.js, so you can open them in VS Code with Reopen in Container or in GitHub Codespaces.

To learn more, see the Getting started guide and Architecture overview.

Technologies

Versions

The main branch supports .NET 10.0 (LTS, the default) and .NET 11.0 (STS); choose with --framework. Both are supported until November 2028. .NET 11 with PostgreSQL uses a release candidate of the Npgsql EF Core provider until its 11.0 release. Previous versions are available:

Version Branch
.NET 9.0 net9.0
.NET 8.0 net8.0
.NET 7.0 net7.0
.NET 6.0 net6.0
.NET 5.0 net5.0
.NET Core 3.1 netcore3.1

Architectural decisions

Key design decisions are documented as Architecture Decision Records.

Learn more

Support

If you are having problems, please let me know by raising a new issue.

License

This project is licensed under the MIT License.

CleanArchitecture (jasontaylordev/CleanArchitecture)

Ищем в базе…

Что это такое?Шаблон .NET-решения с открытым исходным кодом, который создаёт готовое приложение на ASP.NET Core, организованное по принципам Clean Architecture, — так команда начинает не с пустого проекта, а с работающего кода с продуманной структурой слоёв.
Это библиотека, которую я добавляю в свой проект, или генератор кода?Это шаблон проекта .NET, а не библиотека: вы устанавливаете его один раз, затем 'dotnet new ca-sln' генерирует полное решение, кодом которого дальше распоряжаетесь и развиваете сами.
Как сгенерировать из него проект?Установите .NET-шаблон, затем выполните 'dotnet new ca-sln' с параметрами --client-framework (angular, react или none) и --database (postgresql, sqlite или sqlserver); по умолчанию используются angular и sqlite. 'dotnet new ca-sln --help' показывает все доступные опции.
Что должно быть установлено на компьютере заранее?SDK .NET 10.0 или новее. Node.js (LTS) нужен только для фронтенда на Angular или React, а Docker Desktop или Podman — только для SQL Server или PostgreSQL; для SQLite по умолчанию не нужно ни того, ни другого.
А если в моей команде ещё нет .NET 10?Основная ветка main рассчитана на .NET 10.0, но отдельные ветки поддерживают более старые версии — от .NET 9 вплоть до .NET Core 3.1 (net9.0 через netcore3.1).
Какое приложение у меня получится в итоге?Веб-приложение: одностраничное приложение на Angular или React с бэкендом в виде ASP.NET Core Web API, либо только Web API, если фронтенд не нужен.
Что такое Aspire и зачем оно моему приложению?Aspire — часть стека .NET, на которой построен этот шаблон ('powered by ASP.NET Core and Aspire'). На практике вы увидите, как при запуске приложения открывается его панель мониторинга с URL-адресами и логами приложения; документация шаблона рассказывает об этом подробнее.
Что уже входит в сгенерированное решение из коробки?ASP.NET Core 10 с Aspire и Entity Framework Core 10, Angular 21 или React 19 на фронтенде, а также MediatR, AutoMapper, FluentValidation, набор для тестирования с NUnit, Shouldly, Moq и Respawn и Scalar для документации API.
Где шаблон объясняет свои проектные решения?В Architecture Decision Records — репозиторий оформляет ключевые архитектурные решения в виде ADR, так что можно прочитать, почему структура именно такая, прежде чем строить на ней свой проект.
Какие есть похожие проекты?CleanArchitecture, aspnetboilerplate, efcore, nopCommerce, AstraFlow, Smartstore, COLA, AutoMapper
Автор
jasontaylordev
Размер
10 MB
Звёзды
20.7K
Возраст
7 г
Коммиты · 90 дней