Web API solution template which is built on Clean Architecture using .Net Core for bookmark dashboard project!
Explore the docs »
Download
·
Report Bug
·
Request Feature
- About the Project
- Layer Dependencies
- Layer examples
- Features available in this project
- Solution Structure
- DB design
- How to Run
- Run or Debug the Solution
- Application URLs
- Technology stack
- Licence Used
Web API solution template which is built on Clean Architecture using .Net Core for bookmark dashboard project!
Domain Layers (Core layer) is implemented in center and never depends on any other layer. Therefore, what we do is that we create interfaces to Persistence layer and these interfaces get implemented in the external layers. This is also known and DIP or Dependency Inversion Principle
In Persistence layer where we implement reposistory design pattern. In our project, we have implement Entityframework which already implements a repository design pattern. DbContext will be UoW (Unit of Work) and each DbSet is the repository. This interacts with our database using dataproviders
Application layer where we can implement business logic. For OLAP/OLTP process, we can implement CQRS design pattern. In our project, we have implemented CQRS design pattern on top of Mediator design pattern via MediatR libraries
In case you want to implement email feature logic, we define an IMailService in the Service Layer. Using DIP, it is easily possible to switch the implementations. This helps build scalable applications.
In this layer, we add our third party libraries like JWT Tokens Authentication or Serilog for logging, etc.
In this layer, we add caching and other logic which will be common to all layer
This can be WebApi or UI.
-
Update Connection Strings:
Project Configuration File Configuration Key Bookmark.WebApi appsettings.json ConnectionStrings:BookmarkConn
ConnectionStrings:IdentityConnectionBookmark.Web appsettings.json ConnectionStrings:BookmarkConn -
Run Migration:
- Option 1: Using dotnet cli:
- Install dotnet-ef cli:
dotnet tool install --global dotnet-ef --version="3.1"
- Navigate to Bookmark.WebApi and run these commands:
dotnet ef migrations add Initial-commit-Application --context ApplicationDbContext -o Migrations/Application dotnet ef migrations add Identity-commit --context IdentityContext -o Migrations/Identity dotnet ef database update --context ApplicationDbContext dotnet ef database update --context IdentityContext
- Install dotnet-ef cli:
- Option 2: Using Package Manager Console:
- Set Bookmark.WebApi as StartUp Project
- Open Package Manager Console, select Bookmark.WebApi.Persistance as Default Project
- Run these commands:
PM> add-migration Initial-commit-Application -Context ApplicationDbContext -o Migrations/Application PM> update-database -Context ApplicationDbContext
- Open Package Manager Console, select Bookmark.WebApi.Infrastructure as Default Project
- Run these commands:
PM> add-migration Identity-commit -Context IdentityContext -o Migrations/Identity PM> update-database -Context IdentityContext
- Option 1: Using dotnet cli:
-
Web MVC Home Page: https://localhost:44329/
-
Navigate to Health Checks UI https://localhost:44329/healthchecks-ui#/healthchecks and make sure everything is green.
-
Web API Page: https://localhost:44396/OpenAPI/index.html
Architecture Pattern
- Clean architecture
- Screaming architecture-Functional organisation design
Design Pattern
- CQRS design pattern
- Repository design pattern and UOW (Already implemented in EF Core, where DbSet acts as Repository and DbContext acts as UOW)
- Mediator design pattern
Features
- Web API
- Entityframework Core - Code First
- Dataseeding
- Custom Exceptionn Handler
- Automapper
- Fluent validation
- Serilog
- Swagger UI
- Healthcheck UI
- InMemory caching
- API Versioning
- User Auditing (default config)
- Enabling CORS
- Mailkit (Mail service)
- Miniprofiler
Testing
- Unit testing via NUnit
- Integration testing via NUnit
Authentication
- OAuth2 (via auth0.org)
- JWT Authentication
UI
- MVC Core
- React-redux
- React widget
- Kibana
[![MIT License][license-shield]][license-url]
See the contents of the LICENSE file for details