ASP.NET Core 8 backend with Clean Architecture, CQRS Light, and EF Core.
- .NET 8 SDK
- SQL Server (local or remote)
- Git
-
Clone and restore packages
git clone <repository-url> cd source-backend dotnet restore
-
Configure database
Follow the Database Setup Guide to:
- Configure connection string in user-secrets
- Apply initial migrations
-
Run the application
dotnet run --project src/Web/SourceBackend.Web.csproj
- Documentation Index - Complete documentation overview
- Database Setup - Initial database configuration
- Creating Entities - Step-by-step guide for new entities
- Data Layer - Technical documentation for data access
This project follows:
- Clean Architecture - Core → Infrastructure → Web (no circular dependencies)
- CQRS Light - Commands and Queries separated in Core
- Direct DbContext - No generic repository pattern (KISS/YAGNI)
- Pluggable JWT Auth - Supports LocalSymmetric, LocalAsymmetric, and OIDC
- RBAC - Role-based authorization with
[Authorize(Roles="...")]
For complete architecture rules, see .cursorrules.
- .NET 8 - Latest LTS version
- ASP.NET Core - Web API with Controllers
- Entity Framework Core 8 - SQL Server provider
- Serilog - Structured logging
- JWT Bearer - Authentication
- Swagger/OpenAPI - API documentation (Dev only)
src/
├── Core/ # Business logic & use cases
│ ├── Entities/ # Domain entities
│ ├── Features/ # CQRS handlers (Queries/Commands)
│ └── Abstractions/ # Interfaces/ports
├── Infrastructure/ # External adapters
│ └── Data/ # EF Core & database
└── Web/ # HTTP entry point
├── Controllers/ # API endpoints
└── Auth/ # JWT configuration
dotnet ef database update \
--project src/Infrastructure/SourceBackend.Infrastructure.csproj \
--startup-project src/Web/SourceBackend.Web.csprojdotnet ef migrations add YourMigrationName \
--project src/Infrastructure/SourceBackend.Infrastructure.csproj \
--startup-project src/Web/SourceBackend.Web.csprojdotnet builddotnet test- Secrets stored in user-secrets (local dev)
- Connection strings never committed to Git
- JWT keys stored securely (user-secrets or vault)
- All API endpoints require authentication by default
When creating new features:
- Follow the architecture patterns in
.cursorrules - Use the Creating Entities Guide
- Keep controllers thin (just parse/validate → call handler → return)
- Use
TimeProviderfor testable time - Always propagate
CancellationToken
[Add your license here]