Skip to content

Is a clean architecture solution template with a pinch of ddd, writed for .Net projects.

License

Notifications You must be signed in to change notification settings

christianrd/FastCleanArchitecture

Repository files navigation

Fast Clean Architecture Template

Nuget Nuget Quality Gate Status

The purpose of this template is to offer a simple and effective solution for building enterprise applications by harnessing the capabilities of Clean Architecture and ASP.NET Core. With this template, you can easily set up a Web API following Clean Architecture and Domain Drive Design principles. Starting is quick and easy-just install the .NET template (detailed instructions provided below).

Getting Started

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::8.0.1

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 ASP.NET Core Web API solution:

dotnet new fast-ca-sln -o YourProjectName

Launch the app:

cd src/API
dotnet run

To learn more, run the following command:

dotnet new fast-ca-sln --help

You can create use cases (commands or queries) by navigating to ./src/Application and running dotnet new fast-ca-usecase. Here are some examples:

To create a new command:

dotnet new fast-ca-usecase --name CreateTodoList --feature-name TodoLists --usecase-type command --return-type int

To create a query:

dotnet new fast-ca-usecase -n GetTodos -fn TodoLists -ut query -rt TodosVm

To learn more, run the following command:

dotnet new fast-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 fast-ca-sln --use-oracle

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/API
  • --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\API --output-dir Data\Migrations

Deploy

The template includes a full CI/CD pipeline. The pipeline is responsible for building, testing, publishing and deploying the solution to Azure.

Technologies

Versions

The main branch is now on .NET 8.0.

Support

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

License

This project is licensed with the MIT license.

About

Is a clean architecture solution template with a pinch of ddd, writed for .Net projects.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published