Skip to content
| Marketplace
Sign in
Visual Studio>Tools>ASP.NET Core WebAPI Clean Architecture
ASP.NET Core WebAPI Clean Architecture

ASP.NET Core WebAPI Clean Architecture

Mukesh Murugan

|
9,701 installs
| (14) | Free
Loosely-Coupled and Inverted-Dependency Architecture in ASP.NET Core 3.1 WebApi Template with good design patterns and practices for enterprise application, so that you can get started in no time.
Download

ASP. NET Core WebApi - Clean Architecture

.NET Core GitHub stars Twitter Follow


An Implementation of Clean Architecture with ASP.NET Core 3.1 WebApi. With this Open-Source BoilerPlate Template, you will get access to the world of Loosely-Coupled and Inverted-Dependency Architecture in ASP.NET Core 3.1 WebApi with a lot of best practices.

Check out the Project Page to learn more about this Open Source Project.

Getting Started

Download the Extension

Download this Extension and install it on your machine. Make sure Visual Studio 2019 is installed on your machine with the latest SDK.

Follow these Steps to get started.

alt text

alt text

You Solution Template is Ready!

alt text

Next, open up WebAPI/appsettings.json to change the connection strings. Here you can choose to have multiple DBs for a separation of the IdentityDB or have the same DB for Identity and Application. Once that is Set, Run these commands to update the database.

update-database -Context IdentityContext

update-database -Context ApplicationDbContext

Finally, build and run the Application.

Default Roles & Credentials

As soon you build and run your application, default users and roles get added to the database.

Default Roles are as follows.

  • SuperAdmin
  • Admin
  • Moderator
  • Basic

Here are the credentials for the default users.

  • Email - superadmin@gmail.com / Password - 123Pa$$word!
  • Email - basic@gmail.com / Password - 123Pa$$word!

You can use these default credentials to generate valid JWTokens at the ../api/account/authenticate endpoint.

Swagger

PS - If it brings up a dialog box saying 'Site could not be reached', this is probably a configuration issue with the Local IIS. You can switch to Kestrel server and run the application.

Visit the Project Page to learn more - Click Here

Purpose of this Project

Does it really make sense to Setup your ASP.NET Core Solution everytime you start a new WebApi Project ? Aren't we wasting quite a lot of time in doing this over and over gain?

This is the exact Problem that I intend to solve with this Full-Fledged ASP.NET Core 3.1 WebApi Solution Template, that also follows various principles of Clean Architecture.

The primary goal is to create a Full-Fledged implementation, that is well documented along with the steps taken to build this Solution from Scratch. This Solution Template will also be available within Visual Studio 2019 (by installing the required Nuget Package / Extension).

  • Demonstrate Clean Monolith Architecture in ASP.NET Core 3.1
  • This is not a Proof of Concept
  • Implementation that is ready for Production
  • Integrate the most essential libraries and packages

Give a Star ⭐️

If you found this Implementation helpful or used it in your Projects, do give it a star. Thanks! Or, If you are feeling really generous, Support the Project with a small contribution!

Technologies

  • ASP.NET Core 3.1 WebApi
  • REST Standards
  • .NET Core 3.1 / Standard 2.1 Libraries

Features

  • [x] Onion Architecture
  • [x] CQRS with MediatR Library
  • [x] Entity Framework Core - Code First
  • [x] Repository Pattern - Generic
  • [x] MediatR Pipeline Logging & Validation
  • [x] Serilog
  • [x] Swagger UI
  • [x] Response Wrappers
  • [x] Healthchecks
  • [x] Pagination
  • [ ] In-Memory Caching
  • [ ] Redis Caching
  • [x] In-Memory Database
  • [x] Microsoft Identity with JWT Authentication
  • [x] Role based Authorization
  • [x] Identity Seeding
  • [x] Database Seeding
  • [x] Custom Exception Handling Middlewares
  • [x] API Versioning
  • [x] Fluent Validation
  • [x] Automapper
  • [x] SMTP / Mailkit / Sendgrid Email Service
  • [x] Complete User Management Module (Register / Generate Token / Forgot Password / Confirmation Mail)
  • [x] User Auditing

Prerequisites

  • Visual Studio 2019 Community and above
  • .NET Core 3.1 SDK and above
  • Basic Understanding of Architectures and Clean Code Principles
  • I Recommend that you read Onion Architecture In ASP.NET Core With CQRS – Detailed article to understand this implementation much better. This project is just an Advanced Version of the mentioned article.

Support

Has this Project helped you learn something New? or Helped you at work? Do Consider Supporting.

Buy Me A Coffee

Share it!

I have personally not come across a clean implementation on a WebAPI, which is the reason that I started building this up. There are quite a lot of improvements and fixes along the way from the day I started out. Thanks to the community for the support and suggestions. Please share this Repository within your developer community, if you think that this would a difference! Thanks.

About the Author

Mukesh Murugan

  • Blogs at codewithmukesh.com
  • Facebook - codewithmukesh
  • Twitter - Mukesh Murugan
  • Twitter - codewithmukesh
  • Linkedin - Mukesh Murugan

Licensing

iammukeshm/CleanArchitecture.WebApi Project is licensed with the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft