This repository serves as a comprehensive boilerplate for building a full-stack web application using .NET 9 Web API, Angular 19, and MS SQL Server with Docker. It includes built-in features like user registration, authentication with JWT, CRUD operations, and is optimized for both development and production environments.
A startup project template built with Angular 19 and ASP.NET Core 9 (cross-platform), featuring a complete implementation of login, user management, and role-based access control. It also includes essential functionalities for rapid application development.
This template is designed for ease of use, customization, and scalability. It adheres to best practices and conventions of both Angular and ASP.NET Core, leveraging modern technologies and tools to ensure an efficient and streamlined workflow.
This project is under active development, and we are regularly adding new features, enhancements, and documentation updates.
- The README will soon include more detailed descriptions and usage guides.
- A series of in-depth articles explaining the architecture, design, and implementation details is also in progress.
Stay tuned and watch this repository for the latest updates!
To understand this project in-depth, refer to our detailed series of articles on Clean Architecture. This series explains the architectural decisions, setup processes, and best practices used throughout this project.
- Clean Architecture: Introduction to the Project Structure - High-level structure and role of each layer.
- Clean Architecture: Implementing AutoMapper for DTO Mapping and Audit Logging - Utilizing AutoMapper to handle data mapping and audit tracking.
- Clean Architecture: Validating Inputs with FluentValidation - Ensuring robust input validation using FluentValidation.
- Clean Architecture: Dependency Injection Setup Across Layers - Setting up DI across multiple layers for modularity.
- Clean Architecture: Implementing Activity Logging with Custom Attributes - Tracking user actions with custom activity logs.
- Clean Architecture: Handling Authorization and Role-Based Access Control (RBAC) - Implementing authorization policies and role-based access.
- Clean Architecture: The Unit of Work Pattern and Transaction Management Using Dapper - Managing database transactions and consistency.
- Clean Architecture: Using Dapper for Data Access with the Repository Pattern - Leveraging Dapper for efficient data access.
- Clean Architecture: Best Practices for Creating and Using DTOs in the API - Building and using DTOs effectively.
- Clean Architecture: Seeding Initial Data Using Docker Compose and SQL Scripts - Initial data seeding setup with Docker Compose.
- Dockerizing the .NET Core API and MS SQL Server - Containerizing the application for smooth deployment.
- Error Handling and Exception Management in the API - Enhancing resilience with custom error handling.
A complete backend and frontend project structure to build on, with login, user and permission-based role management already integrated
- Clean Architecture Design
- Modular Project Structure
- .NET 9
- Dapper Support
- Authentication/Authorization based on OIDC/OAuth2 and ASP.NET Core Identity
- Middleware for Exception Handling
- Role Based API access, Support for Feature and Operation Mapping
- Activity Log (as User's Activity)
- Swagger/OpenAPI Documentation
- Angular 19
- Bootstrap Integration
- Docker-Compose for Multi-Container Orchestration with NGINX as Load Balancer
- Health Checks
- Docker Debug mode with hot reload for the API and UI
- Docker Production version
The project is structured with Clean Architecture principles, separating the solution into distinct layers to ensure scalability, maintainability, and testability. This includes a modular design with API, Application, Domain, and Infrastructure layers.
To quickly start the application, clone the repository and run Docker Compose:
git clone https://github.com/nitin27may/clean-architecture-docker-dotnet-angular.git angular-dotnet
cd angular-dotnet
//rename .env.example to .env
docker-compose up
Note I have used SMTP send function, please update the account details
The apps written in the following JavaScript frameworks/libraries:
folder | Description |
---|---|
Frontend (Angular) | Angular 18-based front-end application with JWT security. |
Api (.Net) | .NET 8 REST API with Clean Architectuire. |
The fronend of this project is developed in Angular. As we are using Server Side Rendering (SSR) we have used Nodejs alpine image in place of other lightweight docker image like nginx to run Angular app.
It contains sample for below (Both UI and API implmentation ):
- User Registration
- Login
- Forgot Password
- Change Password
- Role based API access
- Profile
- A complete CRUD example for Contact
Also, it has sample code for Auth guard, services, http interceptors, resolver and JWT implementation
Dockerfile for Production Dockerfile for Development
Rest APis of this project is devloped using dotnet
It contains sample for:
- Middleware implemetation for logs
- JWT implementation for Authorization
- API routing
- User registration, login, forgot password, reset password
- Role based api permission
- Audit Log
- Fulent Validation
- Complete CRUD example for Contact
Dockerfile for production Dockerfile for development
Install latest Docker Desktop
We have added a seed file with data, which will be loaded on docker compose, it has 3 users with different role:
Username | Passsword | Role |
---|---|---|
[email protected] | P@ssword#321 | Admin |
[email protected] | P@ssword#321 | Editor |
[email protected] | P@ssword#321 | Reader |
We welcome suggestions and ideas to improve Clean Architecture Docker .NET Angular! If you have a feature you'd like to see, request from this link.
This project is licensed under the MIT License. See the LICENSE file for details.
For support or questions, please contact Nitin Singh at [email protected].