System Architecture

This document describes the overall system architecture of Hotelaro, a comprehensive multi-tenant hotel management platform. It covers the core architectural patterns, multi-tenant design, module system, authentication mechanisms, and request flow patterns used throughout the application.

For specific implementation details of individual subsystems, see Multi-Tenant System, Authentication & Security, and Database Schema.

Overall System Design

Hotelaro is built on CodeIgniter 4 framework with a modular, multi-tenant architecture that supports multiple hotel properties on a single installation. The system uses subdomain-based tenant isolation and implements role-based access control across different administrative levels.

System Architecture Overview

System Architecture Overview

Request Flow Architecture

Request Flow Architecture

Dynamic Module Loading System

The system implements a sophisticated module loading mechanism that dynamically includes routes and functionality based on user permissions and available modules.

Module Loading Flow

Module Loading Flow

The route loading logic uses session-based permission checks:

Multi-Tenant Data Isolation

The system implements tenant isolation using the admin_uid field across all hotel booking related tables, following the hotel_booking_* naming convention.

Tenant Data Access Pattern

Subdomain Resolution Process

Authentication & Session Management

The authentication system supports three administrative levels with different access permissions:

User Authentication Flow

User Authentication Flow

Session Data Structure:

Helper System & Shared Utilities

The system includes a comprehensive helper system providing shared functionality across all modules:

Core Helper Functions

Permission-Based Access Control

Permission-Based Access Control

Configuration Management

The system uses a centralized configuration approach with timezone-aware settings and multi-currency support:

Regional Configuration System

Regional Configuration System

The configuration system supports:

This architecture enables Hotelaro to scale across multiple hotel properties while maintaining data isolation, security, and consistent functionality through its modular design approach.

The configuration system supports:

This architecture enables Hotelaro to scale across multiple hotel properties while maintaining data isolation, security, and consistent functionality through its modular design approach.