Skip to content

Architecture Overview

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 is implemented at the database level using a shared database with tenant-scoped query filters.

  • Every tenant-scoped entity implements ITenantEntity with an OrganizationId property
  • EF Core global query filters automatically scope queries to the current tenant
  • The TenantContext is resolved from the authenticated user’s JWT claims
  • SuperAdmin users bypass tenant filters (null tenant ID)

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
ComponentTechnology
Runtime.NET 10
DatabasePostgreSQL 16
CacheRedis 7
ORMEF Core 10
IdentityASP.NET Identity
APIMinimal APIs
Background JobsHangfire
PaymentsStripe
Orchestration.NET Aspire
ObservabilityOpenTelemetry, Sentry
EmailResend
StorageS3-compatible