Tenant Service
NestJS:8001Core
The Tenant Service manages the complete tenant lifecycle including provisioning, configuration, localization, and cross-tenant operations. It serves as the central hub for multi-tenancy management.
Key Features
- Tenant Provisioning — Create and configure new tenant environments
- Dynamic Database Connections — Route requests to tenant-specific databases
- SSO Configuration — Per-tenant SSO settings
- Localization — Multi-language support per tenant
- Structure Entities — Shared organizational structures across tenants
- Tenant Isolation — Complete data isolation between tenants
API Endpoints
GET
/api/tenantList all tenants
POST
/api/tenantCreate new tenant
GET
/api/tenant/:idGet tenant configuration
PUT
/api/tenant/:idUpdate tenant configuration
GET
/api/tenant/:id/configGet tenant runtime configuration
POST
/api/tenant/:id/provisionProvision tenant database and resources
Configuration
| Name | Type | Default | Description |
|---|---|---|---|
| PORT | number | 8001 | Service listening port |
| DB_HOST | string | localhost | MSSQL server host |
| DB_USERNAME | string | - | Database username |
| DB_PASSWORD | string | - | Database password |
| RABBITMQ_URIS | string | - | RabbitMQ connection URIs |
| REDIS_HOST | string | localhost | Redis host for config cache |
RabbitMQ Integration
Consumes from:
structure_entities_eventsexchange — Organization structure changesidentity_eventsexchange — User lifecycle events
Database
Uses the central Tarasol.MultiTenancy database for all tenant configuration, plus manages connections to individual tenant databases.
Dependencies
- Media Service — File operations for tenant resources
- Electronic Service — External correspondence configuration