Architecture Overview
Clean Architecture
Section titled “Clean Architecture”The boilerplate follows Clean Architecture with the dependency rule — inner layers never depend on outer layers.
┌─────────────────────────────────────┐│ API Layer ││ (Endpoints, Middleware, Pipeline) │├─────────────────────────────────────┤│ Infrastructure Layer ││ (EF Core, Identity, Stripe, S3) │├─────────────────────────────────────┤│ Application Layer ││ (Services, Interfaces, DTOs) │├─────────────────────────────────────┤│ Domain Layer ││ (Entities, Value Objects, Enums) │└─────────────────────────────────────┘Multi-Tenancy
Section titled “Multi-Tenancy”Multi-tenancy is implemented at the database level using a shared database with tenant-scoped query filters.
- Every tenant-scoped entity implements
ITenantEntitywith anOrganizationIdproperty - EF Core global query filters automatically scope queries to the current tenant
- The
TenantContextis resolved from the authenticated user’s JWT claims - SuperAdmin users bypass tenant filters (null tenant ID)
Authentication
Section titled “Authentication”The boilerplate supports multiple authentication methods:
- Email/Password — ASP.NET Identity with JWT tokens
- Google OAuth — External login with automatic account creation
- Two-Factor Authentication — TOTP-based 2FA with recovery codes
- API Keys — Organization-scoped API keys for programmatic access
Key Technologies
Section titled “Key Technologies”| Component | Technology |
|---|---|
| Runtime | .NET 10 |
| Database | PostgreSQL 16 |
| Cache | Redis 7 |
| ORM | EF Core 10 |
| Identity | ASP.NET Identity |
| API | Minimal APIs |
| Background Jobs | Hangfire |
| Payments | Stripe |
| Orchestration | .NET Aspire |
| Observability | OpenTelemetry, Sentry |
| Resend | |
| Storage | S3-compatible |