Gagibran.CleanArchRepo.Template 1.0.6

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

Clean Architecture Build Job Publish Template to NuGet Job NuGet Version NuGet Downloads

Clean Architecture Repository and Unit of Work Template

.NET template for creating projects using clean architecture with the repository pattern and optionally unit of work.

It uses PostgreSQL 14, React 18 (with TypeScript) and .NET 6 and it comes with a docker-compose file configured for development.

This app was developed using docker-compose version 1.29.2.

Give it a star if you like it! Feel free to contribute.

Table of contents

Motivation

I created this template so that I don't have to write a lot of boilerplate code when I want to create a new project and I wanted to share my approach to this architecture.

This is heavily inspired in Steve 'Ardalis' Smith's clean architecture template. Check out his YouTube channel for more information on this architecture.

Installation

This package is hosted on NuGet and can be installed by simply running the command:

dotnet new --install Gagibran.CleanArchRepo.Template

Alternatively, download this repository and, in its root directory, run:

dotnet new --install .

Running and options

Once installed, to use the template, simply run the command:

dotnet new cleanarchrepo -o <output-directory-name> -s <solution-name>

A project clean architecture project will be created with Swagger support and the unit of work pattern by default.

Note that the parameter -s, or --solutionName is a required parameter.

Alternatively, run the command without the -o parameter in order to create the template outside of a containing output directory.

In order to disabled these options, the following flags are available: -e or --enableSwagger and -c or --configureUnitOfWork. Example:

dotnet new cleanarchrepo -o <project-name> -e false -c false

Use dotnet new cleanarchrepo --help to see the list of parameters and more information.

Running the created project

Once your project has been generated with the template, go the the project's root directory and execute the command:

docker-compose -f docker-compose-development.yml up

To start the application. The front end URL will be: http://localhost:3000. If you enabled Swagger during the template creation, you can access it going to the following URL: http://localhost:5000/swagger.

To terminate the application, go the the project's root directory and run:

docker-compose -f docker-compose-development.yml down

To do

  • Currently, the project does not contain a unit tests project. This will be added soon.
  • I will also add Angular support and an option to configure different databases.
  • I will try to get the project to work with HTTPS on Docker.
  • Finally, I will be adding a production configuration with Dockerfiles and a production Docker Compose file.

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.