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/tenant

List all tenants

POST
/api/tenant

Create new tenant

GET
/api/tenant/:id

Get tenant configuration

PUT
/api/tenant/:id

Update tenant configuration

GET
/api/tenant/:id/config

Get tenant runtime configuration

POST
/api/tenant/:id/provision

Provision tenant database and resources

Configuration

NameTypeDefaultDescription
PORTnumber8001Service listening port
DB_HOSTstringlocalhostMSSQL server host
DB_USERNAMEstring-Database username
DB_PASSWORDstring-Database password
RABBITMQ_URISstring-RabbitMQ connection URIs
REDIS_HOSTstringlocalhostRedis host for config cache

RabbitMQ Integration

Consumes from:

  • structure_entities_events exchange — Organization structure changes
  • identity_events exchange — 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