# kapilkapilesan/lobby architecture

> Architecture diagram of the GitHub repository kapilkapilesan/lobby, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kapilkapilesan/lobby
- Repository: https://github.com/kapilkapilesan/lobby

## Overview

This is a multi-tenant hotel operations application. The principal workflow is hotel staff managing reservations and guest stays against branch-specific room and customer data; guests also have self-check-in and room-chat entry points. Platform administration provisions companies and plans, while tenant context and dynamically configured branch databases underpin operations. The tree indicates additional housekeeping, maintenance, payments, reporting, staffing, restaurant, and vehicle-rental capabilities. The README contains no usable product description, so those branches are identified from the source tree; links are limited to relationships shown in excerpts or the source index.

Main entry points: [`Services/BranchDatabaseManager.php`](https://github.com/kapilkapilesan/lobby/blob/main/Services/BranchDatabaseManager.php) (Branch database manager), [`Http/Controllers/Admin/BookingController.php`](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Admin/BookingController.php) (Booking management), [`Http/Controllers/Auth/CompanyRegistrationController.php`](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Auth/CompanyRegistrationController.php) (Company onboarding), [`Http/Controllers/SelfCheckInController.php`](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/SelfCheckInController.php) (Self check-in)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tenant["Tenant platform"]
  node_company_admin["Company onboarding"]
  node_platform_ops["Platform management"]
  node_company[("Company tenant<br/>[Company.php]")]
  node_plan[("Plans and subscriptions<br/>[Plan.php]")]
  node_branch[("Branch registry<br/>[Branch.php]")]
  node_branch_db["Branch database manager"]
  node_tenant_context["Tenant context<br/>[TenantContext.php]"]
  node_branch_models["Branch data models<br/>[BranchModel.php]"]
  node_tenant_middleware["Tenant resolution"]
  node_auth["Authentication<br/>[AuthController.php]"]
end

subgraph group_hotel["Hotel operations"]
  node_booking_ops["Booking management"]
  node_booking_data[("Bookings and stays<br/>[Booking.php]")]
  node_rooms[("Rooms and availability<br/>[Room.php]")]
  node_customer_ops["Customer management"]
  node_customers[("Customer records<br/>[Customer.php]")]
  node_wallet[("Customer wallet<br/>[CustomerWallet.php]")]
  node_hotel_admin["Hotel admin features"]
  node_restaurant[("Restaurant operations<br/>[Restaurant.php]")]
end

subgraph group_guest["Guest services"]
  node_guest_checkin["Self check-in"]
  node_checkin_ai["Check-in assistance"]
  node_room_chat["Guest room chat"]
  node_chat_orders[("Room chat orders<br/>[RoomChatOrder.php]")]
  node_chat_ai["Chat assistance"]
end

subgraph group_support["Integrations and workforce"]
  node_sms["SMS notifications<br/>[SmsService.php]"]
  node_sms_gateway["SMS provider"]
  node_workforce["Staff and housekeeping"]
  node_usage[("API usage logging<br/>[ApiUsageLog.php]")]
  node_encryption["Safe data encryption<br/>[SafeEncrypted.php]"]
end

node_staff(("Hotel staff"))
node_platform_admin(("Platform admin"))
node_guest_actor(("Hotel guest"))

node_platform_admin -.->|"manages"| node_platform_ops
node_company_admin -->|"registers"| node_company
node_company_admin -->|"selects plan"| node_plan
node_company_admin -->|"creates branch"| node_branch
node_company_admin -->|"provisions database"| node_branch_db
node_platform_ops -->|"manages"| node_company
node_platform_ops -->|"manages"| node_plan
node_company -->|"checks features"| node_plan
node_branch -->|"configures"| node_branch_db
node_branch_db -->|"sets connection"| node_tenant_context
node_branch_models -->|"gets connection"| node_tenant_context
node_branch_models -->|"configures binding"| node_branch_db
node_tenant_middleware -->|"sets branch database"| node_branch_db
node_auth -->|"resolves branch"| node_branch
node_staff -.->|"manages stays"| node_booking_ops
node_booking_ops -->|"updates bookings"| node_booking_data
node_booking_ops -->|"checks room"| node_rooms
node_booking_ops -->|"sends updates"| node_sms
node_booking_data -->|"belongs to"| node_rooms
node_booking_ops -.->|"supports operations"| node_hotel_admin
node_hotel_admin -.->|"manages tasks"| node_workforce
node_customer_ops -->|"manages records"| node_customers
node_customer_ops -->|"uses wallet"| node_wallet
node_customers -->|"encrypts fields"| node_encryption
node_guest_actor -.->|"checks in"| node_guest_checkin
node_guest_checkin -->|"resolves booking"| node_booking_data
node_guest_checkin -->|"uses assistance"| node_checkin_ai
node_guest_checkin -->|"logs usage"| node_usage
node_guest_actor -.->|"uses chat"| node_room_chat
node_room_chat -->|"resolves stay"| node_booking_data
node_room_chat -->|"uses orders"| node_chat_orders
node_room_chat -->|"loads menu"| node_restaurant
node_sms -->|"loads settings"| node_branch_db
node_sms -->|"sends messages"| node_sms_gateway

click node_company_admin "https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Auth/CompanyRegistrationController.php"
click node_platform_ops "https://github.com/kapilkapilesan/lobby/tree/main/Http/Controllers/Platform"
click node_company "https://github.com/kapilkapilesan/lobby/blob/main/Models/Company.php"
click node_plan "https://github.com/kapilkapilesan/lobby/blob/main/Models/Plan.php"
click node_branch "https://github.com/kapilkapilesan/lobby/blob/main/Models/Branch.php"
click node_branch_db "https://github.com/kapilkapilesan/lobby/blob/main/Services/BranchDatabaseManager.php"
click node_tenant_context "https://github.com/kapilkapilesan/lobby/blob/main/Services/TenantContext.php"
click node_branch_models "https://github.com/kapilkapilesan/lobby/blob/main/Models/BranchModel.php"
click node_tenant_middleware "https://github.com/kapilkapilesan/lobby/tree/main/Http/Middleware"
click node_auth "https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/AuthController.php"
click node_booking_ops "https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Admin/BookingController.php"
click node_booking_data "https://github.com/kapilkapilesan/lobby/blob/main/Models/Booking.php"
click node_rooms "https://github.com/kapilkapilesan/lobby/blob/main/Models/Room.php"
click node_customer_ops "https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Admin/CustomerController.php"
click node_customers "https://github.com/kapilkapilesan/lobby/blob/main/Models/Customer.php"
click node_wallet "https://github.com/kapilkapilesan/lobby/blob/main/Models/CustomerWallet.php"
click node_hotel_admin "https://github.com/kapilkapilesan/lobby/tree/main/Http/Controllers/Admin"
click node_restaurant "https://github.com/kapilkapilesan/lobby/blob/main/Models/Restaurant.php"
click node_guest_checkin "https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/SelfCheckInController.php"
click node_checkin_ai "https://github.com/kapilkapilesan/lobby/blob/main/Services/SelfCheckInAiService.php"
click node_room_chat "https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/RoomChatController.php"
click node_chat_orders "https://github.com/kapilkapilesan/lobby/blob/main/Models/RoomChatOrder.php"
click node_chat_ai "https://github.com/kapilkapilesan/lobby/blob/main/Services/RoomChatAiService.php"
click node_sms "https://github.com/kapilkapilesan/lobby/blob/main/Services/SmsService.php"
click node_workforce "https://github.com/kapilkapilesan/lobby/tree/main/Http/Controllers/Admin"
click node_usage "https://github.com/kapilkapilesan/lobby/blob/main/Models/ApiUsageLog.php"
click node_encryption "https://github.com/kapilkapilesan/lobby/blob/main/Casts/SafeEncrypted.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_company_admin,node_platform_ops,node_company,node_plan,node_branch,node_branch_db,node_tenant_context,node_branch_models,node_tenant_middleware,node_auth toneBlue
class node_booking_ops,node_booking_data,node_rooms,node_customer_ops,node_customers,node_wallet,node_hotel_admin,node_restaurant toneAmber
class node_guest_checkin,node_checkin_ai,node_room_chat,node_chat_orders,node_chat_ai toneMint
class node_sms,node_sms_gateway,node_workforce,node_usage,node_encryption toneRose
class node_staff,node_platform_admin,node_guest_actor toneIndigo
```

## Components

### Tenant platform

- [Company onboarding](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Auth/CompanyRegistrationController.php): `Http/Controllers/Auth/CompanyRegistrationController.php`
- [Platform management](https://github.com/kapilkapilesan/lobby/tree/main/Http/Controllers/Platform): `Http/Controllers/Platform`
- [Company tenant](https://github.com/kapilkapilesan/lobby/blob/main/Models/Company.php): `Models/Company.php`
- [Plans and subscriptions](https://github.com/kapilkapilesan/lobby/blob/main/Models/Plan.php): `Models/Plan.php`
- [Branch registry](https://github.com/kapilkapilesan/lobby/blob/main/Models/Branch.php): `Models/Branch.php`
- [Branch database manager](https://github.com/kapilkapilesan/lobby/blob/main/Services/BranchDatabaseManager.php): `Services/BranchDatabaseManager.php`
- [Tenant context](https://github.com/kapilkapilesan/lobby/blob/main/Services/TenantContext.php): `Services/TenantContext.php`
- [Branch data models](https://github.com/kapilkapilesan/lobby/blob/main/Models/BranchModel.php): `Models/BranchModel.php`
- [Tenant resolution](https://github.com/kapilkapilesan/lobby/tree/main/Http/Middleware): `Http/Middleware`
- [Authentication](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/AuthController.php): `Http/Controllers/AuthController.php`

### Hotel operations

- [Booking management](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Admin/BookingController.php): `Http/Controllers/Admin/BookingController.php`
- [Bookings and stays](https://github.com/kapilkapilesan/lobby/blob/main/Models/Booking.php): `Models/Booking.php`
- [Rooms and availability](https://github.com/kapilkapilesan/lobby/blob/main/Models/Room.php): `Models/Room.php`
- [Customer management](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/Admin/CustomerController.php): `Http/Controllers/Admin/CustomerController.php`
- [Customer records](https://github.com/kapilkapilesan/lobby/blob/main/Models/Customer.php): `Models/Customer.php`
- [Customer wallet](https://github.com/kapilkapilesan/lobby/blob/main/Models/CustomerWallet.php): `Models/CustomerWallet.php`
- [Hotel admin features](https://github.com/kapilkapilesan/lobby/tree/main/Http/Controllers/Admin): `Http/Controllers/Admin`
- [Restaurant operations](https://github.com/kapilkapilesan/lobby/blob/main/Models/Restaurant.php): `Models/Restaurant.php`

### Guest services

- [Self check-in](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/SelfCheckInController.php): `Http/Controllers/SelfCheckInController.php`
- [Check-in assistance](https://github.com/kapilkapilesan/lobby/blob/main/Services/SelfCheckInAiService.php): `Services/SelfCheckInAiService.php`
- [Guest room chat](https://github.com/kapilkapilesan/lobby/blob/main/Http/Controllers/RoomChatController.php): `Http/Controllers/RoomChatController.php`
- [Room chat orders](https://github.com/kapilkapilesan/lobby/blob/main/Models/RoomChatOrder.php): `Models/RoomChatOrder.php`
- [Chat assistance](https://github.com/kapilkapilesan/lobby/blob/main/Services/RoomChatAiService.php): `Services/RoomChatAiService.php`

### Integrations and workforce

- [SMS notifications](https://github.com/kapilkapilesan/lobby/blob/main/Services/SmsService.php): `Services/SmsService.php`
- **SMS provider**
- [Staff and housekeeping](https://github.com/kapilkapilesan/lobby/tree/main/Http/Controllers/Admin): `Http/Controllers/Admin`
- [API usage logging](https://github.com/kapilkapilesan/lobby/blob/main/Models/ApiUsageLog.php): `Models/ApiUsageLog.php`
- [Safe data encryption](https://github.com/kapilkapilesan/lobby/blob/main/Casts/SafeEncrypted.php): `Casts/SafeEncrypted.php`

### Other components

- **Hotel staff**
- **Platform admin**
- **Hotel guest**

## Connections

- Platform admin → Platform management: manages
- Company onboarding → Company tenant: registers (evidence: `Http/Controllers/Auth/CompanyRegistrationController.php`)
- Company onboarding → Plans and subscriptions: selects plan (evidence: `Http/Controllers/Auth/CompanyRegistrationController.php`)
- Company onboarding → Branch registry: creates branch (evidence: `Http/Controllers/Auth/CompanyRegistrationController.php`)
- Company onboarding → Branch database manager: provisions database (evidence: `Http/Controllers/Auth/CompanyRegistrationController.php`)
- Platform management → Company tenant: manages (evidence: `Http/Controllers/Platform/CompanyController.php`)
- Platform management → Plans and subscriptions: manages (evidence: `Http/Controllers/Platform/SubscriptionController.php`)
- Company tenant → Plans and subscriptions: checks features (evidence: `Models/Company.php`)
- Branch registry → Branch database manager: configures (evidence: `Services/BranchDatabaseManager.php`)
- Branch database manager → Tenant context: sets connection (evidence: `Services/BranchDatabaseManager.php`)
- Branch data models → Tenant context: gets connection (evidence: `Models/BranchModel.php`)
- Branch data models → Branch database manager: configures binding (evidence: `Models/BranchModel.php`)
- Tenant resolution → Branch database manager: sets branch database (evidence: `Http/Middleware/SetBranchDatabase.php`)
- Authentication → Branch registry: resolves branch (evidence: `Http/Controllers/AuthController.php`)
- Hotel staff → Booking management: manages stays
- Booking management → Bookings and stays: updates bookings (evidence: `Http/Controllers/Admin/BookingController.php`)
- Booking management → Rooms and availability: checks room (evidence: `Http/Controllers/Admin/BookingController.php`)
- Booking management → SMS notifications: sends updates (evidence: `Http/Controllers/Admin/BookingController.php`)
- Bookings and stays → Rooms and availability: belongs to (evidence: `Models/Booking.php`)
- Booking management → Hotel admin features: supports operations
- Hotel admin features → Staff and housekeeping: manages tasks
- Customer management → Customer records: manages records (evidence: `Http/Controllers/Admin/CustomerController.php`)
- Customer management → Customer wallet: uses wallet (evidence: `Http/Controllers/Admin/CustomerController.php`)
- Customer records → Safe data encryption: encrypts fields (evidence: `Models/Customer.php`)
- Hotel guest → Self check-in: checks in
- Self check-in → Bookings and stays: resolves booking (evidence: `Http/Controllers/SelfCheckInController.php`)
- Self check-in → Check-in assistance: uses assistance (evidence: `Http/Controllers/SelfCheckInController.php`)
- Self check-in → API usage logging: logs usage (evidence: `Http/Controllers/SelfCheckInController.php`)
- Hotel guest → Guest room chat: uses chat
- Guest room chat → Bookings and stays: resolves stay (evidence: `Http/Controllers/RoomChatController.php`)
- Guest room chat → Room chat orders: uses orders (evidence: `Http/Controllers/RoomChatController.php`)
- Guest room chat → Restaurant operations: loads menu (evidence: `Http/Controllers/RoomChatController.php`)
- SMS notifications → Branch database manager: loads settings (evidence: `Services/SmsService.php`)
- SMS notifications → SMS provider: sends messages (evidence: `Services/SmsService.php`)
