Clean Architecture with RBAC implementation for API (.Net) and UI (Angular)
Contact Management Application with Role-Based Access Control
A production-ready full-stack starter kit built with modern technologies and best practices:
- Frontend: Angular 21 with signals, Material Design, TailwindCSS v4, and Fluent Design
- Backend: .NET 10 API with Clean Architecture and Scalar API documentation
- Database: PostgreSQL 17 with pgAdmin and Dapper ORM
- Orchestration: .NET Aspire 9.5 for local development with service discovery
- DevOps: Docker, GitHub Actions, NGINX
Perfect for developers who want to focus on business logic instead of configuring infrastructure.
Clean Architecture provides significant benefits for your application:
- ✅ Maintainability: Separate concerns to make your code easier to understand and modify
- ✅ Testability: Independent components that can be tested in isolation
- ✅ Flexibility: Swap frameworks or technologies without rewriting your core business logic
- ✅ Scalability: Grow your application with a clear structure that new team members can quickly understand
Clean Architecture Series - Read more about it!
.NET Aspire provides a streamlined local development experience with automatic service discovery, health monitoring, and an integrated dashboard.
Important: Make sure you have the correct versions installed before proceeding.
- .NET SDK 10.0 or later
- Node.js 22 LTS (not Node 23 - use LTS version only)
- Docker Desktop (for PostgreSQL container)
# Clone the repository
git clone https://github.com/nitin27may/clean-architecture-docker-dotnet-angular.git clean-app
cd clean-app
# IMPORTANT: Install Angular dependencies first
cd frontend
npm install
cd ..
# Run with Aspire
dotnet run --project aspire/AppHost🔗 Then access:
- Aspire Dashboard: https://localhost:17178 (see all services, logs, traces)
- Frontend: http://localhost:4200
- API: Check Aspire dashboard for the assigned port
- Scalar API Docs:
{API_URL}/scalar/v1 - pgAdmin: Check Aspire dashboard for the assigned port
Run the application instantly using pre-built images from GitHub Container Registry - no build required:
# Clone the repository
git clone https://github.com/nitin27may/clean-architecture-docker-dotnet-angular.git clean-app
cd clean-app
# Create .env file (required)
cp .env.example .env
# Run with pre-built images from GHCR
docker compose -f docker-compose.ghcr.yml up -d💡 Tip: Use
docker compose -f docker-compose.ghcr.yml pullto fetch the latest images before starting.
Build and run all services locally:
# Clone the repository
git clone https://github.com/nitin27may/clean-architecture-docker-dotnet-angular.git clean-app
cd clean-app
# Create .env file (required)
cp .env.example .env
# Build and start all services
docker-compose up --build🔗 Then access (for both Option 2 & 3):
- Frontend: http://localhost
- API: http://localhost/api
- Scalar API Docs: http://localhost/scalar/v1
- pgAdmin: http://localhost:5050
| Username | Password | Role |
|---|---|---|
| nitin27may@gmail.com | P@ssword#321 | Admin |
| editor@gmail.com | P@ssword#321 | Editor |
| reader@gmail.com | P@ssword#321 | Reader |
|
|
|
clean-architecture-docker-dotnet-angular/
├── aspire/ # .NET Aspire orchestration
│ ├── AppHost/ # Aspire host application
│ │ └── AppHost.cs # Service configuration
│ └── ServiceDefaults/ # Shared Aspire defaults
├── backend/ # .NET 10 API (Clean Architecture)
│ ├── Contact.Api/ # API Layer (Controllers, Middleware)
│ ├── Contact.Application/ # Application Layer (Services, DTOs)
│ ├── Contact.Domain/ # Domain Layer (Entities, Interfaces)
│ ├── Contact.Infrastructure/ # Infrastructure Layer (Repositories)
│ └── Contact.Common/ # Shared utilities
├── frontend/ # Angular 21 SPA
│ ├── src/app/@core/ # Core module (guards, interceptors, layout)
│ ├── src/app/feature/ # Feature modules (contact, user, admin)
│ └── src/app/styles/ # Global styles, Tailwind config
├── scripts/ # Database initialization
│ ├── 01-init-db.sh # Create database
│ └── 02-seed-data.sql # Seed initial data
├── api-collection/ # Bruno API collection for testing
├── docs/ # Documentation
├── loadbalancer/ # NGINX configuration
├── Contact.Api.sln # .NET Solution file
├── docker-compose.yml # Docker Compose (build locally)
├── docker-compose.ghcr.yml # Docker Compose (pre-built GHCR images)
└── Dockerfile.api # API Dockerfile
Container Architecture Overview
Comprehensive documentation is available:
- Aspire Guide - Running with .NET Aspire
- Development Guide - Get started with development
- Frontend Documentation - Angular architecture details
- Backend Documentation - .NET API implementation
- Docker Guide - Container configuration
- Feature List - Detailed feature breakdown
- Clean Architecture Series - In-depth articles
- Roadmap - Upcoming features
| Layer | Technology | Version |
|---|---|---|
| Frontend | Angular | 21.0 |
| UI Components | Angular Material | 21.0 |
| CSS Framework | TailwindCSS | 4.1 |
| Backend | .NET | 10.0 |
| API Docs | Scalar | 2.1 |
| Database | PostgreSQL | 17 |
| ORM | Dapper | 2.1 |
| Orchestration | .NET Aspire | 9.5 |
| Containerization | Docker | Latest |
We welcome contributions! See our contributing guide for details on how to get involved.
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact Nitin Singh at nitin27may@gmail.com.
If you find this project useful, please consider giving it a star on GitHub to show your support!

