A production-ready foundation for building modern .NET applications using Clean Architecture, DDD, CQRS, and modular design.
Base is a modern application framework for .NET that provides a robust starting point for building scalable, maintainable, and enterprise-grade applications.
It embraces Clean Architecture, Domain-Driven Design (DDD), and CQRS to promote clear boundaries between business logic and infrastructure concerns. The framework includes reusable components, modular project organization, and production-ready conventions that help teams build software faster while maintaining high code quality.
Base is suitable for REST APIs, Modular Monoliths, and Microservice-based systems, making it an ideal foundation for both greenfield projects and enterprise solutions.
- Clean Architecture by default
- Domain-Driven Design (DDD)
- CQRS support
- Dependency Injection
- Modular project structure
- Production-ready conventions
- High maintainability
- Testability
- Reusable infrastructure
- Extensible architecture
Client
│
▼
ASP.NET Core API
│
▼
Application Layer
│
┌────────────┴────────────┐
▼ ▼
Domain Layer Infrastructure
│ │
└────────────┬────────────┘
▼
External Services
SQL Server
Redis
RabbitMQ
Kafka
gRPC
Background Jobs
Base
│
├── src
│ ├── Base.Domain
│ ├── Base.Application
│ ├── Base.Infrastructure
│ ├── Base.API
│ ├── Base.Shared
│ └── ...
│
├── samples
│
├── Utilities
│
├── docs
│
└── tests
Contains:
- Entities
- Value Objects
- Aggregates
- Domain Events
- Business Rules
- Interfaces
The Domain layer has zero dependency on any external technology.
Responsible for:
- CQRS
- Commands
- Queries
- DTOs
- Validation
- Business Workflows
- Authorization
- Mediation
Implements:
- Entity Framework
- Redis
- RabbitMQ
- Kafka
- SMS
- File Storage
- Background Jobs
- External APIs
Infrastructure depends on Domain—not the other way around.
Contains:
- REST APIs
- Authentication
- Authorization
- Swagger
- Middleware
- Exception Handling
- Health Checks
- ✅ About → Website → https://www.nuget.org/packages/Base.Solution.Templates/
- ✅ Clean Architecture
- ✅ DDD
- ✅ CQRS
- ✅ Dependency Injection
- ✅ Fluent Validation
- ✅ Authentication
- ✅ Authorization
- ✅ JWT
- ✅ Swagger
- ✅ Global Exception Handling
- ✅ Logging
- ✅ Background Jobs
- ✅ Redis
- ✅ RabbitMQ
- ✅ Kafka Ready
- ✅ gRPC Ready
- ✅ Docker Ready
- ✅ OpenTelemetry Ready
Base follows several important architectural principles:
- Separation of Concerns
- Single Responsibility
- Dependency Inversion
- Domain First
- Infrastructure Isolation
- Explicit Dependencies
- High Cohesion
- Low Coupling
Many templates only generate folders.
Base provides:
- Consistent project organization
- Proven architectural patterns
- Reusable infrastructure
- Extensible modules
- Enterprise-ready conventions
- Better maintainability
- Faster project startup
- Easier onboarding for teams
Client
│
▼
Controller / Endpoint
│
▼
Application Layer
│
▼
Domain
│
▼
Infrastructure
│
▼
Database / Cache / Queue
The framework is designed to allow easy integration of:
- New Modules
- New Databases
- New Message Brokers
- New Cache Providers
- New Authentication Providers
- New External Services
without affecting the Domain layer.
Clone the repository
git clone https://github.com/MassoudKargar/Base.gitRestore packages
dotnet restoreBuild
dotnet buildRun
dotnet runWhen building on Base:
- Keep business rules inside Domain.
- Keep Controllers thin.
- Use CQRS for application workflows.
- Hide infrastructure behind abstractions.
- Avoid leaking Entity Framework into Application.
- Depend on interfaces, not implementations.
- Native AOT support
- Multi-tenancy
- Event Sourcing
- Outbox Pattern
- Saga Support
- Modular Monolith template
- Microservices template
- Distributed Caching improvements
- Observability Dashboard
- CLI Project Generator
Contributions are welcome.
Feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License.
Masoud Kargar
Senior .NET Backend Developer
GitHub: https://github.com/MassoudKargar
LinkedIn: https://www.linkedin.com/in/masoudkargar
Made with ❤️ using .NET 10

