Clean.Architecture.Solution.Template
9.0.0-preview.6
See the version list below for details.
dotnet new install Clean.Architecture.Solution.Template::9.0.0-preview.6
Clean Architecture Solution Template
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 Single Page App (SPA) with ASP.NET Core and Angular or React, while adhering to the principles of Clean Architecture. Getting started is easy - simply install the .NET template (see below for full details).
If you find this project useful, please give it a star. Thanks! ⭐
Getting Started
The following prerequisites are required to build and run the solution:
- .NET 9.0 SDK (latest version)
- Node.js (latest LTS, only required if you are using Angular or React)
The easiest way to get started is to install the .NET template:
dotnet new install Clean.Architecture.Solution.Template::9.0.0-preview.6
Once installed, create a new solution using the template. You can choose to use Angular, React, or create a Web API-only solution. Specify the client framework using the -cf
or --client-framework
option, and provide the output directory where your project will be created. Here are some examples:
To create a Single-Page Application (SPA) with Angular and ASP.NET Core:
dotnet new ca-sln --client-framework Angular --output YourProjectName
To create a SPA with React and ASP.NET Core:
dotnet new ca-sln -cf React -o YourProjectName
To create a ASP.NET Core Web API-only solution:
dotnet new ca-sln -cf None -o YourProjectName
Launch the app:
cd src/Web
dotnet run
To learn more, run the following command:
dotnet new ca-sln --help
You can create use cases (commands or queries) by navigating to ./src/Application
and running dotnet new ca-usecase
. Here are some examples:
To create a new command:
dotnet new ca-usecase --name CreateTodoList --feature-name TodoLists --usecase-type command --return-type int
To create a query:
dotnet new ca-usecase -n GetTodos -fn TodoLists -ut query -rt TodosVm
To learn more, run the following command:
dotnet new ca-usecase --help
Database
The template is configured to use SQL Server by default. If you would prefer to use SQLite, create your solution using the following command:
dotnet new ca-sln --use-sqlite
When you run the application the database will be automatically created (if necessary) and the latest migrations will be applied.
Running database migrations is easy. Ensure you add the following flags to your command (values assume you are executing from repository root)
--project src/Infrastructure
(optional if in this folder)--startup-project src/Web
--output-dir Data/Migrations
For example, to add a new migration from the root folder:
dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\Web --output-dir Data\Migrations
Deploy
This template is structured to follow the Azure Developer CLI (azd). You can learn more about azd
in the official documentation. To get started:
# Log in to Azure
azd auth login
# Provsion and deploy to Azure
azd up
The template is configured to publish and deploy a framework-dependent application. At this stage, only .NET 9 Preview 6 is supported, however this will be updated as new versions are released. Alternatively, you can modify the template to use a self-contained deployment. You can learrn more about .NET application publishing in the official documentation.
Technologies
- ASP.NET Core 9
- Entity Framework Core 9
- Angular 17 or React 18
- MediatR
- AutoMapper
- FluentValidation
- NUnit, FluentAssertions, Moq & Respawn
Versions
The main branch is now on .NET 8.0. The following previous versions are available:
Learn More
- Clean Architecture with ASP.NET Core 3.0 (GOTO 2019)
- Clean Architecture with .NET Core: Getting Started
Support
If you are having problems, please let me know by raising a new issue.
License
This project is licensed with the MIT license.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.0.0-preview.6.1 | 489 | 9/5/2024 |
9.0.0-preview.6 | 119 | 9/1/2024 |
8.0.6 | 3,099 | 8/31/2024 |
8.0.5 | 9,768 | 3/7/2024 |
8.0.4 | 1,244 | 3/3/2024 |
8.0.3 | 2,502 | 2/15/2024 |
8.0.2 | 7,404 | 11/23/2023 |
8.0.1 | 1,758 | 11/22/2023 |
8.0.0 | 6,597 | 11/15/2023 |
8.0.0-preview.7.2 | 3,749 | 8/29/2023 |
8.0.0-preview.7.1 | 95 | 8/29/2023 |
8.0.0-preview.6.18 | 1,097 | 8/6/2023 |
8.0.0-preview.6.17 | 182 | 8/3/2023 |
8.0.0-preview.6.16 | 155 | 8/2/2023 |
8.0.0-preview.6.15 | 125 | 8/1/2023 |
8.0.0-preview.6.14 | 224 | 7/30/2023 |
8.0.0-preview.6.13 | 93 | 7/30/2023 |
8.0.0-preview.6.12 | 141 | 7/29/2023 |
8.0.0-preview.6.11 | 211 | 7/26/2023 |
8.0.0-preview.6.10 | 239 | 7/23/2023 |
8.0.0-preview.6.9 | 233 | 7/19/2023 |
8.0.0-preview.6.8 | 97 | 7/19/2023 |
8.0.0-preview.6.7 | 124 | 7/19/2023 |
8.0.0-preview.6.6 | 136 | 7/18/2023 |
8.0.0-preview.6.5 | 191 | 7/16/2023 |
8.0.0-preview.6.4 | 126 | 7/16/2023 |
8.0.0-preview.6.3 | 149 | 7/14/2023 |
8.0.0-preview.6.2 | 115 | 7/14/2023 |
8.0.0-preview.6.1 | 159 | 7/13/2023 |
8.0.0-preview.6 | 121 | 7/12/2023 |
8.0.0-preview.5.15 | 104 | 7/12/2023 |
8.0.0-preview.5.14 | 222 | 7/9/2023 |
8.0.0-preview.5.13 | 117 | 7/9/2023 |
8.0.0-preview.5.12 | 120 | 7/8/2023 |
8.0.0-preview.5.11 | 93 | 7/8/2023 |
8.0.0-preview.5.10 | 96 | 7/8/2023 |
8.0.0-preview.5.9 | 93 | 7/8/2023 |
8.0.0-preview.5.8 | 95 | 7/8/2023 |
8.0.0-preview.5.7 | 107 | 7/8/2023 |
8.0.0-preview.5.6 | 104 | 7/7/2023 |
8.0.0-preview.5.5 | 212 | 7/5/2023 |
8.0.0-preview.5.4 | 132 | 7/5/2023 |
8.0.0-preview.5.3 | 158 | 7/4/2023 |
8.0.0-preview.5.2 | 265 | 6/29/2023 |
8.0.0-preview.5.1 | 155 | 6/26/2023 |
8.0.0-preview.5 | 186 | 6/18/2023 |
7.0.2 | 8,976 | 6/14/2023 |
7.0.1 | 7,336 | 2/21/2023 |
7.0.0 | 7,371 | 10/19/2022 |
6.1.0 | 9,018 | 6/6/2022 |
6.0.8 | 2,908 | 6/1/2022 |
6.0.7 | 3,097 | 5/25/2022 |
6.0.6 | 6,102 | 5/24/2022 |
6.0.5 | 2,548 | 5/21/2022 |
6.0.2 | 2,801 | 5/20/2022 |
6.0.1 | 9,494 | 11/13/2021 |
6.0.0 | 2,842 | 11/10/2021 |
1.1.5 | 7,803 | 7/10/2021 |
1.1.4 | 10,457 | 12/2/2020 |
1.1.2 | 2,832 | 11/24/2020 |
1.1.1 | 8,673 | 5/20/2020 |
1.1.0 | 4,753 | 4/11/2020 |
1.0.10 | 3,313 | 3/30/2020 |
1.0.9 | 2,956 | 3/26/2020 |
1.0.8 | 3,196 | 3/24/2020 |
1.0.7 | 3,220 | 3/23/2020 |
1.0.6 | 4,107 | 2/6/2020 |
1.0.5 | 4,381 | 12/9/2019 |
1.0.4 | 4,239 | 11/13/2019 |
1.0.3 | 3,158 | 10/17/2019 |
1.0.2 | 3,320 | 10/16/2019 |
1.0.1 | 3,099 | 10/10/2019 |
📦 Upgraded to Angular 17
✨ Added azd compatibility