A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/JasonGT/CleanArchitecture below:

jasontaylordev/CleanArchitecture: Clean Architecture Solution Template for ASP.NET Core

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! ⭐

The following prerequisites are required to build and run the solution:

The easiest way to get started is to install the .NET template:

dotnet new install Clean.Architecture.Solution.Template

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:

To learn more, run the following command:

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

The template supports PostgreSQL, SQLite, and SQL Server (default option). Specify the database to use with the --database option:

dotnet new ca-sln --database [postgresql|sqlite|sqlserver]

On application startup, the database is automatically deleted, recreated, and seeded using ApplicationDbContextInitialiser. This is a practical strategy for early development, avoiding the overhead of maintaining migrations while keeping the schema and sample data in sync with the domain model.

This process includes:

For production environments, consider using EF Core migrations or migration bundles during deployment.
For more information, see Database Initialisation Strategies for EF Core.

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

# Provision and deploy to Azure
azd up

The main branch is now on .NET 9.0. The following previous versions are available:

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

This project is licensed with the MIT license.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4