ClientForge is a modular multi-tenant SaaS platform foundation built with .NET.
The system provides authentication, tenant isolation, and membership-based authorization designed for building scalable SaaS applications.
- JWT Authentication
- Tenant Resolution Middleware
- Membership Authorization Guard
- Owner Assignment on Tenant Creation
- Modular Monolith Architecture
- Architecture Boundary Tests
- Clean Domain / Application / Infrastructure Separation
ClientForge follows a modular monolith architecture.
Each module contains:
Domain
Application
Infrastructure
Contracts
Modules currently implemented:
- Identity
- Tenants
Future modules may include:
- Billing
- Analytics
- Notifications
- Websites
- Bookings
Request ↓ TenantMiddleware ↓ Authentication (JWT) ↓ MembershipGuard ↓ Endpoint
This ensures:
User → Tenant → Membership → Authorization
Register a user: POST /auth/register
Login: POST /auth/login
Create a tenant: POST /tenants Authorization: Bearer TOKEN
Access tenant resources: GET /me x-tenant-id: bella-salon Authorization: Bearer TOKEN
dotnet build dotnet test dotnet run --project src/ClientForge.Api
Swagger is available at: http://localhost:5273/swagger
The project includes:
- Unit tests
- Integration tests
- Architecture boundary tests
Architecture tests enforce rules such as:
- Domain must not depend on Infrastructure
- Application must not depend on API
- Shared modules must not depend on feature modules
Apache License 2.0