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 - Overview of architectural layers and their roles
- Clean Architecture: Implementing AutoMapper for DTO Mapping with Audit Details - Setting up AutoMapper for data transformation and audit trails
- Clean Architecture: Validating Inputs with FluentValidation - Implementing clean input validation with FluentValidation
- Clean Architecture: Dependency Injection Setup Across Layers - Configuring dependency injection for better modularity
- Clean Architecture: Implementing Activity Logging with Custom Attributes - Building a custom attribute system for activity tracking
- Clean Architecture: Handling Authorization and Role-Based Access Control (RBAC) - Setting up robust authorization and access control
- Clean Architecture: The Unit of Work Pattern and Transaction Management Using Dapper - Implementing reliable transaction management
- Clean Architecture: Using Dapper for Data Access with the Repository Pattern - Implementing efficient data access patterns
- Clean Architecture: Best Practices for Creating and Using DTOs in the API - Designing and implementing effective DTOs
- Clean Architecture: Seeding Initial Data Using Docker Compose and SQL Scripts - Setting up automated data seeding
- Dockerizing the .NET Core API and MS SQL Server - Creating a containerized development environment
- Error Handling and Exception Management in the API - Building a robust error handling system
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
- Role based access of pages (Routing) - Coming Soon
- Role based action (Add, Edit, Delete) on a page (feature) - Coming Soon
- 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
:
Shell
mv .env.example .env
Powershell
Rename-Item .env.example .env
Run below command to run all containers:
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 19-based front-end application with JWT security. |
Api (.Net) | .NET 9 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].