# gentlemoo/lyseum architecture

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

- Interactive diagram: https://gitdiagram.com/gentlemoo/lyseum
- Repository: https://github.com/gentlemoo/lyseum

## Overview

Lyseum Hotel is a server-rendered hotel website, booking engine, and staff operations system. The main guest journey runs from public room and date search through booking creation, inventory claims, and optional online payment; staff manage bookings, hotel operations, content, and settings through the admin, while authentication and middleware protect those actions. CMS, chat, weather, channel-manager synchronization, backups, and durable jobs are additional capabilities. Arrows are limited to relationships visible in the excerpts, SOURCE INDEX references, or README; some unsampled feature wiring is therefore not shown.

Main entry points: [`src/modules/booking/service.ts`](https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/service.ts) (Booking service), [`src/jobs/handlers.ts`](https://github.com/gentlemoo/lyseum/blob/main/src/jobs/handlers.ts) (Job handlers), [`src/app.ts`](https://github.com/gentlemoo/lyseum/blob/main/src/app.ts) (Express application), [`src/modules/admin/router.ts`](https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/router.ts) (Staff admin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website and CMS"]
  node_public["Public site<br/>[routes.ts]"]
  node_cms["CMS pages<br/>[pages.ts]"]
  node_chat["Support chat<br/>[service.ts]"]
  node_weather["Weather<br/>[service.ts]"]
end

subgraph group_booking["Booking and Payments"]
  node_booking_service["Booking service<br/>[service.ts]"]
  node_availability["Inventory availability<br/>[availability.ts]"]
  node_pricing["Booking pricing<br/>[pricing.ts]"]
  node_booking_states["Booking states<br/>[states.ts]"]
  node_payments["Payment service<br/>[service.ts]"]
  node_stripe["Stripe<br/>[stripe.ts]"]
  node_paypal["PayPal<br/>[paypal.ts]"]
  node_webhooks["Payment webhooks<br/>[webhooks.ts]"]
end

subgraph group_staff["Staff and Security"]
  node_admin["Staff admin<br/>[router.ts]"]
  node_admin_operations["Hotel operations<br/>[operations.ts]"]
  node_admin_content["Content management<br/>[content.ts]"]
  node_admin_bookings["Booking management<br/>[bookings.ts]"]
  node_auth["Staff authentication<br/>[routes.ts]"]
  node_middleware["Request security<br/>[core.ts]"]
end

subgraph group_ops["Operations and Integrations"]
  node_channels["Channel managers<br/>[channel.ts]"]
  node_backups["Backup and restore<br/>[service.ts]"]
  node_job_handlers["Job handlers<br/>[handlers.ts]"]
  node_job_queue["Durable job queue<br/>[queue.ts]"]
  node_mailer["Email delivery<br/>[mailer.ts]"]
end

subgraph group_platform["Shared Platform"]
  node_app["Express application<br/>[app.ts]"]
  node_server["Server process<br/>[server.ts]"]
  node_database[("MySQL database<br/>[knex.ts]")]
  node_settings["Business settings<br/>[settings.ts]"]
  node_audit["Audit log<br/>[audit.ts]"]
  node_environment["Environment config<br/>[env.ts]"]
end

node_guest(("Guest"))
node_payment_providers["Stripe and PayPal"]
node_channel_services["External channel services"]
node_weather_service["Weather provider"]
node_ai_provider["Optional AI provider"]

node_guest -->|"browses and books"| node_public
node_public -->|"loads published pages"| node_cms
node_public -->|"searches and creates"| node_booking_service
node_booking_service -->|"checks and claims"| node_availability
node_booking_service -->|"uses pricing"| node_pricing
node_booking_service -->|"uses states"| node_booking_states
node_booking_service -->|"enqueues email"| node_job_queue
node_payments -->|"settles booking"| node_booking_service
node_payments -->|"starts checkout"| node_stripe
node_payments -->|"starts checkout"| node_paypal
node_payments -->|"charges through"| node_payment_providers
node_app -->|"mounts routes"| node_webhooks
node_admin -->|"registers routes"| node_admin_bookings
node_admin -->|"registers routes"| node_admin_content
node_admin -->|"registers routes"| node_admin_operations
node_admin -->|"registers routes"| node_auth
node_auth -->|"reads and writes"| node_database
node_auth -->|"records events"| node_audit
node_auth -->|"queues reset email"| node_mailer
node_app -->|"mounts routes"| node_admin
node_app -->|"mounts routes"| node_public
node_app -->|"uses middleware"| node_middleware
node_server -->|"starts"| node_app
node_server -->|"registers jobs"| node_job_handlers
node_job_handlers -->|"registers handlers"| node_job_queue
node_job_handlers -->|"syncs bookings"| node_channels
node_job_handlers -->|"refreshes weather"| node_weather
node_job_handlers -->|"runs backup jobs"| node_backups
node_job_handlers -->|"sends queued email"| node_mailer
node_job_queue -->|"stores job state"| node_database
node_settings -->|"reads and writes"| node_database
node_database -->|"gets connection config"| node_environment
node_app -->|"uses database"| node_database
node_channels -.->|"syncs inventory"| node_channel_services
node_weather -.->|"fetches forecasts"| node_weather_service
node_chat -.->|"may query"| node_ai_provider
node_chat -->|"checks booking info"| node_booking_service

click node_public "https://github.com/gentlemoo/lyseum/blob/main/src/modules/public/routes.ts"
click node_cms "https://github.com/gentlemoo/lyseum/blob/main/src/modules/cms/pages.ts"
click node_chat "https://github.com/gentlemoo/lyseum/blob/main/src/modules/chat/service.ts"
click node_weather "https://github.com/gentlemoo/lyseum/blob/main/src/modules/weather/service.ts"
click node_booking_service "https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/service.ts"
click node_availability "https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/availability.ts"
click node_pricing "https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/pricing.ts"
click node_booking_states "https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/states.ts"
click node_payments "https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/service.ts"
click node_stripe "https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/stripe.ts"
click node_paypal "https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/paypal.ts"
click node_webhooks "https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/webhooks.ts"
click node_admin "https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/router.ts"
click node_admin_operations "https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/operations.ts"
click node_admin_content "https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/content.ts"
click node_admin_bookings "https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/bookings.ts"
click node_auth "https://github.com/gentlemoo/lyseum/blob/main/src/modules/auth/routes.ts"
click node_middleware "https://github.com/gentlemoo/lyseum/blob/main/src/middleware/core.ts"
click node_channels "https://github.com/gentlemoo/lyseum/blob/main/src/integrations/channel.ts"
click node_backups "https://github.com/gentlemoo/lyseum/blob/main/src/modules/backups/service.ts"
click node_job_handlers "https://github.com/gentlemoo/lyseum/blob/main/src/jobs/handlers.ts"
click node_job_queue "https://github.com/gentlemoo/lyseum/blob/main/src/jobs/queue.ts"
click node_mailer "https://github.com/gentlemoo/lyseum/blob/main/src/lib/mailer.ts"
click node_app "https://github.com/gentlemoo/lyseum/blob/main/src/app.ts"
click node_server "https://github.com/gentlemoo/lyseum/blob/main/src/server.ts"
click node_database "https://github.com/gentlemoo/lyseum/blob/main/src/db/knex.ts"
click node_settings "https://github.com/gentlemoo/lyseum/blob/main/src/lib/settings.ts"
click node_audit "https://github.com/gentlemoo/lyseum/blob/main/src/lib/audit.ts"
click node_environment "https://github.com/gentlemoo/lyseum/blob/main/src/config/env.ts"

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_public,node_cms,node_chat,node_weather toneBlue
class node_booking_service,node_availability,node_pricing,node_booking_states,node_payments,node_stripe,node_paypal,node_webhooks toneAmber
class node_admin,node_admin_operations,node_admin_content,node_admin_bookings,node_auth,node_middleware toneMint
class node_channels,node_backups,node_job_handlers,node_job_queue,node_mailer toneRose
class node_app,node_server,node_database,node_settings,node_audit,node_environment,node_guest,node_payment_providers,node_channel_services,node_weather_service,node_ai_provider toneIndigo
```

## Components

### Website and CMS

- [Public site](https://github.com/gentlemoo/lyseum/blob/main/src/modules/public/routes.ts): `src/modules/public/routes.ts`
- [CMS pages](https://github.com/gentlemoo/lyseum/blob/main/src/modules/cms/pages.ts): `src/modules/cms/pages.ts`
- [Support chat](https://github.com/gentlemoo/lyseum/blob/main/src/modules/chat/service.ts): `src/modules/chat/service.ts`
- [Weather](https://github.com/gentlemoo/lyseum/blob/main/src/modules/weather/service.ts): `src/modules/weather/service.ts`

### Booking and Payments

- [Booking service](https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/service.ts): `src/modules/booking/service.ts`
- [Inventory availability](https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/availability.ts): `src/modules/booking/availability.ts`
- [Booking pricing](https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/pricing.ts): `src/modules/booking/pricing.ts`
- [Booking states](https://github.com/gentlemoo/lyseum/blob/main/src/modules/booking/states.ts): `src/modules/booking/states.ts`
- [Payment service](https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/service.ts): `src/modules/payments/service.ts`
- [Stripe](https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/stripe.ts): `src/modules/payments/stripe.ts`
- [PayPal](https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/paypal.ts): `src/modules/payments/paypal.ts`
- [Payment webhooks](https://github.com/gentlemoo/lyseum/blob/main/src/modules/payments/webhooks.ts): `src/modules/payments/webhooks.ts`

### Staff and Security

- [Staff admin](https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/router.ts): `src/modules/admin/router.ts`
- [Hotel operations](https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/operations.ts): `src/modules/admin/operations.ts`
- [Content management](https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/content.ts): `src/modules/admin/content.ts`
- [Booking management](https://github.com/gentlemoo/lyseum/blob/main/src/modules/admin/bookings.ts): `src/modules/admin/bookings.ts`
- [Staff authentication](https://github.com/gentlemoo/lyseum/blob/main/src/modules/auth/routes.ts): `src/modules/auth/routes.ts`
- [Request security](https://github.com/gentlemoo/lyseum/blob/main/src/middleware/core.ts): `src/middleware/core.ts`

### Operations and Integrations

- [Channel managers](https://github.com/gentlemoo/lyseum/blob/main/src/integrations/channel.ts): `src/integrations/channel.ts`
- [Backup and restore](https://github.com/gentlemoo/lyseum/blob/main/src/modules/backups/service.ts): `src/modules/backups/service.ts`
- [Job handlers](https://github.com/gentlemoo/lyseum/blob/main/src/jobs/handlers.ts): `src/jobs/handlers.ts`
- [Durable job queue](https://github.com/gentlemoo/lyseum/blob/main/src/jobs/queue.ts): `src/jobs/queue.ts`
- [Email delivery](https://github.com/gentlemoo/lyseum/blob/main/src/lib/mailer.ts): `src/lib/mailer.ts`

### Shared Platform

- [Express application](https://github.com/gentlemoo/lyseum/blob/main/src/app.ts): `src/app.ts`
- [Server process](https://github.com/gentlemoo/lyseum/blob/main/src/server.ts): `src/server.ts`
- [MySQL database](https://github.com/gentlemoo/lyseum/blob/main/src/db/knex.ts): `src/db/knex.ts`
- [Business settings](https://github.com/gentlemoo/lyseum/blob/main/src/lib/settings.ts): `src/lib/settings.ts`
- [Audit log](https://github.com/gentlemoo/lyseum/blob/main/src/lib/audit.ts): `src/lib/audit.ts`
- [Environment config](https://github.com/gentlemoo/lyseum/blob/main/src/config/env.ts): `src/config/env.ts`

### Other components

- **Guest**
- **Stripe and PayPal**
- **External channel services**
- **Weather provider**
- **Optional AI provider**

## Connections

- Guest → Public site: browses and books (evidence: `README.md`)
- Public site → CMS pages: loads published pages (evidence: `src/modules/public/routes.ts`)
- Public site → Booking service: searches and creates (evidence: `src/modules/public/routes.ts`)
- Booking service → Inventory availability: checks and claims (evidence: `src/modules/booking/service.ts`)
- Booking service → Booking pricing: uses pricing (evidence: `src/modules/booking/service.ts`)
- Booking service → Booking states: uses states (evidence: `src/modules/booking/service.ts`)
- Booking service → Durable job queue: enqueues email (evidence: `src/modules/booking/service.ts`)
- Payment service → Booking service: settles booking (evidence: `src/modules/payments/service.ts`)
- Payment service → Stripe: starts checkout (evidence: `src/modules/payments/service.ts`)
- Payment service → PayPal: starts checkout (evidence: `src/modules/payments/service.ts`)
- Payment service → Stripe and PayPal: charges through (evidence: `README.md`)
- Express application → Payment webhooks: mounts routes (evidence: `src/app.ts`)
- Staff admin → Booking management: registers routes (evidence: `src/modules/admin/router.ts`)
- Staff admin → Content management: registers routes (evidence: `src/modules/admin/router.ts`)
- Staff admin → Hotel operations: registers routes (evidence: `src/modules/admin/router.ts`)
- Staff admin → Staff authentication: registers routes (evidence: `src/modules/admin/router.ts`)
- Staff authentication → MySQL database: reads and writes (evidence: `src/modules/auth/routes.ts`)
- Staff authentication → Audit log: records events (evidence: `src/modules/auth/routes.ts`)
- Staff authentication → Email delivery: queues reset email (evidence: `src/modules/auth/routes.ts`)
- Express application → Staff admin: mounts routes (evidence: `src/app.ts`)
- Express application → Public site: mounts routes (evidence: `src/app.ts`)
- Express application → Request security: uses middleware (evidence: `src/app.ts`)
- Server process → Express application: starts (evidence: `src/server.ts`)
- Server process → Job handlers: registers jobs (evidence: `src/server.ts`)
- Job handlers → Durable job queue: registers handlers (evidence: `src/jobs/handlers.ts`)
- Job handlers → Channel managers: syncs bookings (evidence: `src/jobs/handlers.ts`)
- Job handlers → Weather: refreshes weather (evidence: `src/jobs/handlers.ts`)
- Job handlers → Backup and restore: runs backup jobs (evidence: `src/jobs/handlers.ts`)
- Job handlers → Email delivery: sends queued email (evidence: `src/jobs/handlers.ts`)
- Durable job queue → MySQL database: stores job state (evidence: `src/jobs/queue.ts`)
- Business settings → MySQL database: reads and writes (evidence: `src/lib/settings.ts`)
- MySQL database → Environment config: gets connection config (evidence: `src/db/knex.ts`)
- Express application → MySQL database: uses database (evidence: `src/app.ts`)
- Channel managers → External channel services: syncs inventory (evidence: `README.md`)
- Weather → Weather provider: fetches forecasts (evidence: `README.md`)
- Support chat → Optional AI provider: may query (evidence: `README.md`)
- Support chat → Booking service: checks booking info (evidence: `src/modules/chat/service.ts`)
