Clean.Architecture.Solution.Template 6.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet new install Clean.Architecture.Solution.Template::6.1.0                
This package contains a .NET Template Package you can call from the shell/command line.

<img align="left" width="116" height="116" src="https://raw.githubusercontent.com/jasontaylordev/CleanArchitecture/main/.github/icon.png" />

Clean Architecture Solution Template

.NET CodeQL Nuget Nuget Discord Twitter Follow

<br/>

This is a solution template for creating a Single Page App (SPA) with Angular and ASP.NET Core following the principles of Clean Architecture. Create a new project based on this template by clicking the above Use this template button or by installing and running the associated NuGet package (see Getting Started for full details).

Learn about Clean Architecture

Clean Architecture with ASP.NET Core 3.0 • Jason Taylor • GOTO 2019

Technologies

Getting Started

The easiest way to get started is to install the NuGet package and run dotnet new ca-sln:

  1. Install the latest .NET 6 SDK
  2. Install the latest Node.js LTS
  3. Run dotnet new --install Clean.Architecture.Solution.Template to install the project template
  4. Create a folder for your solution and cd into it (the template will use it as project name)
  5. Run dotnet new ca-sln to create a new project
  6. Navigate to src/WebUI and launch the project using dotnet run

Check out my blog post for more information.

Database Configuration

The template is configured to use an in-memory database by default. This ensures that all users will be able to run the solution without needing to set up additional infrastructure (e.g. SQL Server).

If you would like to use SQL Server, you will need to update WebUI/appsettings.json as follows:

  "UseInMemoryDatabase": false,

Verify that the DefaultConnection connection string within appsettings.json points to a valid SQL Server instance.

When you run the application the database will be automatically created (if necessary) and the latest migrations will be applied.

Database Migrations

To use dotnet-ef for your migrations first ensure that "UseInMemoryDatabase" is disabled, as described within previous section. Then, 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/WebUI
  • --output-dir Persistence/Migrations

For example, to add a new migration from the root folder:

dotnet ef migrations add "SampleMigration" --project src\Infrastructure --startup-project src\WebUI --output-dir Persistence\Migrations

Overview

Domain

This will contain all entities, enums, exceptions, interfaces, types and logic specific to the domain layer.

Application

This layer contains all application logic. It is dependent on the domain layer, but has no dependencies on any other layer or project. This layer defines interfaces that are implemented by outside layers. For example, if the application need to access a notification service, a new interface would be added to application and an implementation would be created within infrastructure.

Infrastructure

This layer contains classes for accessing external resources such as file systems, web services, smtp, and so on. These classes should be based on interfaces defined within the application layer.

WebUI

This layer is a single page application based on Angular 13 and ASP.NET Core 6. This layer depends on both the Application and Infrastructure layers, however, the dependency on Infrastructure is only to support dependency injection. Therefore only Startup.cs should reference Infrastructure.

Support

If you are having problems, please let us 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.1 450 11/18/2024
9.0.0 240 11/15/2024
9.0.0-preview.6.1 575 9/5/2024
9.0.0-preview.6 123 9/1/2024
8.0.6 3,898 8/31/2024
8.0.5 9,795 3/7/2024
8.0.4 1,253 3/3/2024
8.0.3 2,507 2/15/2024
8.0.2 7,413 11/23/2023
8.0.1 1,767 11/22/2023
8.0.0 6,662 11/15/2023
8.0.0-preview.7.2 3,755 8/29/2023
8.0.0-preview.7.1 99 8/29/2023
8.0.0-preview.6.18 1,101 8/6/2023
8.0.0-preview.6.17 186 8/3/2023
8.0.0-preview.6.16 159 8/2/2023
8.0.0-preview.6.15 129 8/1/2023
8.0.0-preview.6.14 228 7/30/2023
8.0.0-preview.6.13 97 7/30/2023
8.0.0-preview.6.12 146 7/29/2023
8.0.0-preview.6.11 215 7/26/2023
8.0.0-preview.6.10 243 7/23/2023
8.0.0-preview.6.9 237 7/19/2023
8.0.0-preview.6.8 103 7/19/2023
8.0.0-preview.6.7 128 7/19/2023
8.0.0-preview.6.6 142 7/18/2023
8.0.0-preview.6.5 195 7/16/2023
8.0.0-preview.6.4 130 7/16/2023
8.0.0-preview.6.3 153 7/14/2023
8.0.0-preview.6.2 119 7/14/2023
8.0.0-preview.6.1 163 7/13/2023
8.0.0-preview.6 125 7/12/2023
8.0.0-preview.5.15 108 7/12/2023
8.0.0-preview.5.14 226 7/9/2023
8.0.0-preview.5.13 121 7/9/2023
8.0.0-preview.5.12 124 7/8/2023
8.0.0-preview.5.11 97 7/8/2023
8.0.0-preview.5.10 100 7/8/2023
8.0.0-preview.5.9 99 7/8/2023
8.0.0-preview.5.8 99 7/8/2023
8.0.0-preview.5.7 111 7/8/2023
8.0.0-preview.5.6 108 7/7/2023
8.0.0-preview.5.5 216 7/5/2023
8.0.0-preview.5.4 136 7/5/2023
8.0.0-preview.5.3 165 7/4/2023
8.0.0-preview.5.2 269 6/29/2023
8.0.0-preview.5.1 159 6/26/2023
8.0.0-preview.5 191 6/18/2023
7.0.2 8,981 6/14/2023
7.0.1 7,341 2/21/2023
7.0.0 7,386 10/19/2022
6.1.0 9,026 6/6/2022
6.0.8 2,912 6/1/2022
6.0.7 3,101 5/25/2022
6.0.6 6,118 5/24/2022
6.0.5 2,552 5/21/2022
6.0.2 2,805 5/20/2022
6.0.1 9,498 11/13/2021
6.0.0 2,846 11/10/2021
1.1.5 7,810 7/10/2021
1.1.4 10,461 12/2/2020
1.1.2 2,836 11/24/2020
1.1.1 8,677 5/20/2020
1.1.0 4,757 4/11/2020
1.0.10 3,319 3/30/2020
1.0.9 2,960 3/26/2020
1.0.8 3,200 3/24/2020
1.0.7 3,224 3/23/2020
1.0.6 4,129 2/6/2020
1.0.5 4,385 12/9/2019
1.0.4 4,243 11/13/2019
1.0.3 3,162 10/17/2019
1.0.2 3,324 10/16/2019
1.0.1 3,103 10/10/2019

Recreated the Todo page demo that was broken in the Angular 13 upgrade.