Multi-Tenant System

This document describes the multi-tenant architecture of the Hotelaro hotel management system. The multi-tenant system enables multiple hotel properties to operate independently on a single platform instance using subdomain-based tenant isolation and admin_uid filtering.

The system supports different access levels and dynamically loads appropriate modules based on user permissions. For information about authentication and user roles, see Authentication & Security. For database structure details, see Database Schema.

Tenant Identification

The multi-tenant system identifies tenants through subdomain extraction from the HTTP host header. Each subdomain corresponds to a unique hotel property with its own isolated data and configuration.

Subdomain Resolution Process

Subdomain Resolution Process

Tenant Registration Flow

Tenant Registration Flow

Data Isolation

The multi-tenant system ensures data isolation through the admin_uid field, which is consistently applied across all tenant-specific database operations and UI components.

Admin UID Filtering Pattern

Admin UID Filtering Pattern

Session Management

Session Management

Route Management

The system dynamically loads different sets of routes based on user admin levels, providing role-based access to system modules.

Dynamic Route Loading

Dynamic Route Loading

Access Level Matrix

Authentication Filter

The AuthCheck filter validates tenant access on every request to ensure only valid subdomains can access the system.

Filter Implementation

Filter Implementation

Filter Configuration

The authentication filter is configured as a global filter that runs on all requests:

Database Schema Integration

The multi-tenant system integrates with the database schema through consistent admin_uid foreign key relationships across all tenant-specific tables.

Tenant Data Model

Tenant Data Model

Data Access Patterns

All tenant-specific operations follow consistent patterns for data isolation:

This ensures complete data isolation between tenants while maintaining a single database instance for operational efficiency.