Skip to content

Genocs/clean-architecture-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Build Packages Downloads Prev Downloads Contributors Forks Stargazers Issues Discord Gitter Twitter Twitterx LinkedIn

icon

Clean Architecture Template

Built for .NET8. It incorporates the most essential Packages your projects will ever need. Follows Clean Architecture Principles.

The template can be used with the dotnet new command or with the Visual Studio 2022 or Visual Studio Code IDEs.

Goals

This is an Application Template built to help you create LOB applications. It follows the Clean Architecture Principles and built on Domain-Driven-Design. This tool is useful to increases productivity on developing your next microservices. The template allows you to use different databases and enterprise service bus.

Databases supported:

  • InMemoryDB (for development purpose)
  • SqlServer
  • MongoDB

Enterprise Service Bus libraries supported:

  • Particular NServiceBus
  • MassTransit
  • Rebus

Prerequisites

Getting Started

Open up your Command Prompt or PowerShell or "bash" and run the following command.

# To clone the repository
git clone https://github.com/Genocs/clean-architecture-template
# To build the nuget package
nuget pack ./src/Package.Template.nuspec -NoDefaultExcludes -OutputDirectory ./out -Version 3.1.0
# To install the template
dotnet new install Genocs.CleanArchitecture.Template

or,

if you want to use a specific version of the template,

use

dotnet new install Genocs.CleanArchitecture.Template::3.1.0

This would install the Genocs CleanArchitecture Template globally on your machine.

For more details on getting started, read the documentation

Please check the documentation for more details.

How to create a project

Create, build, test and run:

dotnet new -i Genocs.CleanArchitecture.Template
dotnet new cleanarchitecture -n {CompanyName.ProjectName.ServiceName}
cd {CompanyName.ProjectName.ServiceName}
dotnet build ./src/{CompanyName.ProjectName.ServiceName}.WebApi
dotnet build ./src/{CompanyName.ProjectName.ServiceName}.Worker

dotnet test
dotnet run ./src/{CompanyName.ProjectName.ServiceName}.WebApi

How to build the package

To build the package run the following commands:

Official Link

cd ./src
nuget pack
dotnet new u Genocs.CleanArchitecture.Template
dotnet new i ./out/Genocs.CleanArchitecture.Template.3.1.0.nupkg
dotnet new cleanarchitecture --help
dotnet new cleanarchitecture --name {MyCompany.MyProject} -d mongodb -sb particular

Sample application

Run dotnet new -i Genocs.CleanArchitecture.Template then try the following commands.

# Complete suite of use cases.
dotnet new cleanarchitecture --use-cases full

# Register account and get customer details.
dotnet new cleanarchitecture --use-cases basic

# Read only use cases
dotnet new cleanarchitecture --use-cases readonly

Miscellaneous

Useful commands:

# How to get the list of installed templates
dotnet new -u

dotnet --list

Changelogs

View Complete Changelogs.

License

This project is licensed with the MIT license.

Community

Support

Has this Project helped you learn something New? or Helped you at work? Here are a few ways by which you can support.

  • ⭐ Leave a star!
  • 🥇 Recommend this project to your colleagues.
  • 🦸 Do consider endorsing me on LinkedIn for ASP.NET Core - Connect via LinkedIn
  • ☕ If you want to support this project in the long run, consider buying me a coffee!

buy-me-a-coffee

Code Contributors

This project exists thanks to all the people who contribute. Submit your PR and join the team!

genocs contributors

Financial Contributors

Become a financial contributor and help me sustain the project.

Support the Project on Opencollective

Acknowledgements