Skip to content

This is a multi-project solution dotnet template for creating an enterprise-level Web API using .NET 6 ASP.NET Core using the Clean Architecture principles and API best practices.

License

Notifications You must be signed in to change notification settings

marlonajgayle/Net6WebApiTemplate

Repository files navigation

.NET 6 Web Template

Build CodeQL Boilerplate.Templates NuGet Package Boilerplate.Templates NuGet Package Downloads

This is a multi-project solution dotnet template for developing an enterprise-level Web API with.NET 6 ASP.NET Core, following Clean Architecture principles and API best practices. The .NET 6 Web Api Template consist of scafolding for API versioning, CQRS, email, localization, logging, IP rate limiting, JWT, Open API, validation, unit and integration testing.

Table of Contents

Prerequisites

You will need the following tools:

Instructions

  1. Install the latest .NET Core 6 SDK.
  2. Run dotnet new --install Net6WebTemplate::1.0.0-beta.2 to install the project template
  3. Then navigate to the location you would like to create to project
  4. Run dotnet new net6webapi -o "my-project" to create a new project

Docker Setup

ASP.NET Core Web API uses HTTPS and relies on certificates for trust, identity and encryption. To run Net5WebTemplate application Docker over HTTPS during development do the following:

  1. Generate certificate using 'dotnet dev-certs' (for localhost use Only!).

Note: Update the docker-compose file with dev-cert password used.

On Windows using Linux Containers

dotnet dev-certs https -ep %USERPROFILE%\.aspnet\https\aspnetapp.pfx  -p your_password
dotnet dev-certs https --trust

When using PowerShell, replace %USERPROFILE% with $env:USERPROFILE.

On macOS or Linux

dotnet dev-certs https -ep ${HOME}/.aspnet/https/aspnetapp.pfx -p { password here }
dotnet dev-certs https --trust
  1. Build and run Docker containers run Docker compose located in the solution directory
docker-compose -f 'docker-compose.yml' up --build

Database Setup

To setup the SQL Server database following the instrcutions below:

  1. Reveiw the connection string in appsettings.Local.json and update the database name.
  2. Run dotnet ef migrations add Initial --context <ProjectName>DbContext to add migation with EF Core
  3. Run dotnet ef database update Initial to create application database.

Contributions

  • Demar-j - Implemented API endpoints, Unit and Integration tests.
  • mahousen - .

Credits

This solution's structure was heavily infuenced by Jason Taylor's Clean Architecture model. Icon made by Flat Icons from www.flaticon.com

Versions

The main branch is running .NET 6.0

License

This project is licensed under the MIT License - see the LICENSE.md main branch is running .NET 6.0 file for details.

About

This is a multi-project solution dotnet template for creating an enterprise-level Web API using .NET 6 ASP.NET Core using the Clean Architecture principles and API best practices.

Topics

Resources

License

Stars

Watchers

Forks

Packages