All Projects → iammukeshm → Cleanarchitecture.webapi

iammukeshm / Cleanarchitecture.webapi

Licence: mit
An implementation of Clean Architecture for ASP.NET Core 3.1 WebAPI. Built with loosely coupled architecture and clean-code practices in mind.

Projects that are alternatives of or similar to Cleanarchitecture.webapi

Equinoxproject
Full ASP.NET Core 5 application with DDD, CQRS and Event Sourcing concepts
Stars: ✭ 5,120 (+732.52%)
Mutual labels:  asp-net-core, aspnetcore, clean-code
Aspnetcore Webapi Sample
This is a sample ASP.NET Core WebAPI
Stars: ✭ 310 (-49.59%)
Mutual labels:  webapi, asp-net-core, aspnetcore
Onion Architecture Asp.net Core
WhiteApp API solution template which is built on Onion Architecture with all essential feature using .NET 5!
Stars: ✭ 196 (-68.13%)
Mutual labels:  asp-net-core, aspnetcore, clean-architecture
Event Sourcing Castanha
An Event Sourcing service template with DDD, TDD and SOLID. It has High Cohesion and Loose Coupling, it's a good start for your next Microservice application.
Stars: ✭ 68 (-88.94%)
Mutual labels:  webapi, clean-architecture, clean-code
eShopOnWeb
Sample ASP.NET Core 6.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
Stars: ✭ 8,250 (+1241.46%)
Mutual labels:  clean-code, clean-architecture, asp-net-core
Run Aspnetcore
A starter kit for your next ASP.NET Core web application. Boilerplate for ASP.NET Core reference application, demonstrating a layered application architecture with applying Clean Architecture and DDD best practices. Download 100+ page eBook PDF from here ->
Stars: ✭ 227 (-63.09%)
Mutual labels:  aspnetcore, clean-architecture, clean-code
Dotnet New Caju
Learn Clean Architecture with .NET Core 3.0 🔥
Stars: ✭ 228 (-62.93%)
Mutual labels:  webapi, clean-architecture, clean-code
Architecture
.NET 6, ASP.NET Core 6, Entity Framework Core 6, C# 10, Angular 13, Clean Code, SOLID, DDD.
Stars: ✭ 2,285 (+271.54%)
Mutual labels:  aspnetcore, clean-architecture, clean-code
OnionArchitecture
The onion architecture, introduced by Jeffrey Palermo, overcomes the issues of the layered architecture with great ease. With Onion Architecture, the game-changer is that the Domain Layer (Entities and Validation Rules that are common to the business case ) is at the Core of the Entire Application. This means higher flexibility and lesser coupli…
Stars: ✭ 314 (-48.94%)
Mutual labels:  clean-architecture, asp-net-core, webapi
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (-74.63%)
Mutual labels:  aspnetcore, asp-net-core, webapi
Clean Architecture Manga
🌀 Clean Architecture with .NET6, C#10 and React+Redux. Use cases as central organizing structure, completely testable, decoupled from frameworks
Stars: ✭ 3,104 (+404.72%)
Mutual labels:  webapi, clean-architecture, clean-code
N-Tier-Architecture
This is a n-layer architecture based on Common web application architectures.
Stars: ✭ 105 (-82.93%)
Mutual labels:  clean-code, asp-net-core, webapi
CleanArchitecture-Template
This is a solution template for Clean Architecture and CQRS implementation with ASP.NET Core.
Stars: ✭ 60 (-90.24%)
Mutual labels:  clean-code, clean-architecture, asp-net-core
Boilerplate
Clean Architecture Solution Template for ASP.NET Core 5.0. Built with Onion/Hexagonal Architecture and incorporates the most essential Packages your projects will ever need. Includes both WebApi and Web(MVC) Projects.
Stars: ✭ 243 (-60.49%)
Mutual labels:  aspnetcore, clean-architecture, clean-code
Go Realworld Clean
a clean architecture implementation of the realworldapp : https://github.com/gothinkster/realworld
Stars: ✭ 301 (-51.06%)
Mutual labels:  clean-architecture, clean-code
Aspnetcoreapistarter
An ASP.NET Core (v2.1) Web API project to quickly bootstrap new projects. Includes Identity, JWT authentication w/ refresh tokens.
Stars: ✭ 304 (-50.57%)
Mutual labels:  webapi, aspnetcore
Simplcommerce
A simple, cross platform, modularized ecommerce system built on .NET Core
Stars: ✭ 3,474 (+464.88%)
Mutual labels:  asp-net-core, aspnetcore
Live.asp.net
Code for live.asp.net, which hosts the ASP.NET Community Stand-up
Stars: ✭ 295 (-52.03%)
Mutual labels:  asp-net-core, aspnetcore
Awesome Blazor
Resources for Blazor, a .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly.
Stars: ✭ 6,063 (+885.85%)
Mutual labels:  asp-net-core, aspnetcore
Modular Monolith With Ddd
Full Modular Monolith application with Domain-Driven Design approach.
Stars: ✭ 6,210 (+909.76%)
Mutual labels:  clean-architecture, clean-code

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.

Read the Changelog file to see the new changes.

Releases

v1.1 - Stable Release - Download the Stable Release

v1.0-preview - Download the first Preview here

v1.1

Follow these steps to get started with this Boiler Plate Template.

Download the Extension

Make sure Visual Studio 2019 is installed on your machine with the latest SDK. Download from Visual Studio Marketplace. Install it on your machine.

Follow these Steps to get started.

alt text

alt text

You Solution Template is Ready!

alt text

Visit the Project Page to learn more - Click Here

Alternatively you can also clone the Repository.

  1. Clone this Repository and Extract it to a Folder.
  2. Change the Connection Strings for the Application and Identity in the WebApi/appsettings.json - (WebApi Project)
  3. Run the following commands on Powershell in the WebApi Projecct's Directory.
  • dotnet restore
  • dotnet ef database update -Context ApplicationDbContext
  • dotnet ef database update -Context IdentityContext
  • dotnet run (OR) Run the Solution using Visual Studio 2019

Check out my blog or say Hi on Twitter!

How to use MySQL as your Data Provider

The Project currently uses MSSQL as the default Data Provider. If you are more comfortable with MySQL, Here is how to migrate to MySQL easily.

  1. delete all existing file inside migrations folder on both project

    • {YourProjectName}.Infrastructure.Identity
    • {YourProjectName}.Infrastructure.Persistence
  2. change from options.UseSqlServer to options.UseMySql in ServiceExtensions.cs and ServiceRegistration.cs

  3. run dotnet add package Pomelo.EntityFrameworkCore.MySql --version 3.1.2 on two project/subproject

  4. on IdentityContext.cs comment builder.HasDefaultSchema("Identity"); because ef doesn't support that on mysql

  5. cd to {YourProjectName}.Infrastructure.Identity and run

    • dotnet ef database update --startup-project ../{YourProjectName}.WebApi/{YourProjectName}.WebApi.csproj -c "IdentityContext"
    • dotnet ef migrations add Initial --startup-project ../{YourProjectName}.WebApi/{YourProjectName}.WebApi.csproj -c "IdentityContext"
  6. cd to {YourProjectName}.Infrastructure.Persistence and run

    • dotnet ef database update --startup-project ../{YourProjectName}.WebApi/{YourProjectName}.WebApi.csproj -c "ApplicationDbContext"
    • dotnet ef migrations add Initial --startup-project ../{YourProjectName}.WebApi/{YourProjectName}.WebApi.csproj -c "ApplicationDbContext"

The above guide (To use MySQL) was contributed by geekz-reno.

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.

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

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

Brief Overview

alt text

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.

Getting Started

Changelog

Every changes / additions / deletions will be recorded in the Changelog file.

Questions? Bugs? Suggestions for Improvement?

Having any issues or troubles getting started? Get in touch with me or Raise a Bug or Feature Request. Always happy to help.

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

Licensing

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].