# mhfarhoud/luxera-hotel-website architecture

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

- Interactive diagram: https://gitdiagram.com/mhfarhoud/luxera-hotel-website
- Repository: https://github.com/mhfarhoud/luxera-hotel-website

## Overview

LUXERA is a Persian RTL product-introduction and lead-capture website, not the hotel-management backend it describes. Visitors explore the product preview and features, then may submit a consent-based inquiry; administrators sign in to review, update, and export leads. The README documents opt-in analytics and the admin safeguards. Hotel capability areas below are represented as documented product-preview content, not operational backend modules. Relationships are limited to shown calls and README statements; unsampled routes or UI wiring are not inferred.

Main entry points: [`app/page.tsx`](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/page.tsx) (Product introduction), [`lib/server.ts`](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/server.ts) (Request and DB access), [`app/api/admin/leads/route.ts`](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/leads/route.ts) (Admin lead endpoint), [`components/lead-dialog.tsx`](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/lead-dialog.tsx) (Inquiry form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Product site"]
  node_home["Product introduction<br/>[page.tsx]"]
  node_features["Feature catalog<br/>[page.tsx]"]
  node_guestpreview["Guest phone preview<br/>[guest-phone.tsx]"]
  node_journey["Guest journey<br/>[journey-film.tsx]"]
  node_latest["Latest product<br/>[latest-product.tsx]"]
  node_benefits["Official benefits"]
  node_controls["Product controls"]
end

subgraph group_lead["Lead collection"]
  node_leadform["Inquiry form<br/>[lead-dialog.tsx]"]
  node_leadapi["Lead endpoint<br/>[route.ts]"]
  node_eventsapi["Analytics endpoint<br/>[route.ts]"]
  node_analytics["Opt-in analytics<br/>[analytics.ts]"]
end

subgraph group_admin["Lead administration"]
  node_loginpage["Admin login page<br/>[page.tsx]"]
  node_loginui["Login form<br/>[admin-login.tsx]"]
  node_loginapi["Login endpoint<br/>[route.ts]"]
  node_adminpage["Lead dashboard page<br/>[page.tsx]"]
  node_dashboard["Lead dashboard"]
  node_adminleads["Admin lead endpoint<br/>[route.ts]"]
  node_logout["Logout endpoint<br/>[route.ts]"]
end

subgraph group_runtime["Server and storage"]
  node_auth["Session authentication<br/>[admin-auth.ts]"]
  node_server["Request and DB access<br/>[server.ts]"]
  node_db[("D1 database<br/>[index.ts]")]
  node_schema["Lead and event schema<br/>[schema.ts]"]
end

node_visitor(("Visitor"))
node_adminuser(("Administrator"))
node_hotelbackend["Separate hotel API"]

node_visitor -->|"views"| node_home
node_home -->|"renders"| node_guestpreview
node_home -->|"renders"| node_journey
node_home -->|"renders"| node_latest
node_home -->|"renders"| node_benefits
node_home -->|"renders"| node_controls
node_home -->|"opens"| node_leadform
node_visitor -->|"views"| node_features
node_features -->|"uses"| node_leadform
node_leadform -->|"submits"| node_leadapi
node_leadapi -->|"validates payload"| node_server
node_leadapi -->|"stores lead"| node_db
node_leadform -->|"tracks"| node_analytics
node_analytics -.->|"posts events"| node_eventsapi
node_eventsapi -->|"validates payload"| node_server
node_eventsapi -->|"stores events"| node_db
node_adminuser -->|"signs in"| node_loginpage
node_loginpage -->|"renders"| node_loginui
node_loginui -.->|"submits credentials"| node_loginapi
node_loginapi -->|"checks credentials"| node_auth
node_loginapi -->|"reads rate limits"| node_server
node_loginpage -.->|"redirects after auth"| node_adminpage
node_adminuser -->|"reviews leads"| node_adminpage
node_adminpage -->|"renders"| node_dashboard
node_dashboard -.->|"reads and updates"| node_adminleads
node_adminleads -->|"checks session"| node_auth
node_adminleads -->|"accesses data"| node_server
node_adminleads -->|"reads and updates"| node_db
node_adminuser -.->|"ends session"| node_logout
node_logout -->|"clears cookie"| node_auth
node_server -->|"binds D1"| node_db
node_visitor -->|"not connected"| node_hotelbackend

click node_home "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/page.tsx"
click node_features "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/features/page.tsx"
click node_guestpreview "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/guest-phone.tsx"
click node_journey "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/journey-film.tsx"
click node_latest "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/latest-product.tsx"
click node_benefits "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/official-benefits.tsx"
click node_controls "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/luxera-controls.tsx"
click node_leadform "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/lead-dialog.tsx"
click node_leadapi "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/leads/route.ts"
click node_eventsapi "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/events/route.ts"
click node_analytics "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/analytics.ts"
click node_loginpage "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/admin/login/page.tsx"
click node_loginui "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/admin-login.tsx"
click node_loginapi "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/login/route.ts"
click node_adminpage "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/admin/page.tsx"
click node_dashboard "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/admin-dashboard.tsx"
click node_adminleads "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/leads/route.ts"
click node_logout "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/logout/route.ts"
click node_auth "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/admin-auth.ts"
click node_server "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/server.ts"
click node_db "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/db/index.ts"
click node_schema "https://github.com/mhfarhoud/luxera-hotel-website/blob/main/db/schema.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_home,node_features,node_guestpreview,node_journey,node_latest,node_benefits,node_controls toneBlue
class node_leadform,node_leadapi,node_eventsapi,node_analytics toneAmber
class node_loginpage,node_loginui,node_loginapi,node_adminpage,node_dashboard,node_adminleads,node_logout,node_hotelbackend toneMint
class node_auth,node_server,node_db,node_schema toneRose
class node_visitor,node_adminuser toneIndigo
```

## Components

### Product site

- [Product introduction](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/page.tsx): `app/page.tsx`
- [Feature catalog](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/features/page.tsx): `app/features/page.tsx`
- [Guest phone preview](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/guest-phone.tsx): `components/guest-phone.tsx`
- [Guest journey](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/journey-film.tsx): `components/journey-film.tsx`
- [Latest product](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/latest-product.tsx): `components/latest-product.tsx`
- [Official benefits](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/official-benefits.tsx): `components/official-benefits.tsx`
- [Product controls](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/luxera-controls.tsx): `components/luxera-controls.tsx`

### Lead collection

- [Inquiry form](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/lead-dialog.tsx): `components/lead-dialog.tsx`
- [Lead endpoint](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/leads/route.ts): `app/api/leads/route.ts`
- [Analytics endpoint](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/events/route.ts): `app/api/events/route.ts`
- [Opt-in analytics](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/analytics.ts): `lib/analytics.ts`

### Lead administration

- [Admin login page](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/admin/login/page.tsx): `app/admin/login/page.tsx`
- [Login form](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/admin-login.tsx): `components/admin-login.tsx`
- [Login endpoint](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/login/route.ts): `app/api/admin/login/route.ts`
- [Lead dashboard page](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/admin/page.tsx): `app/admin/page.tsx`
- [Lead dashboard](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/components/admin-dashboard.tsx): `components/admin-dashboard.tsx`
- [Admin lead endpoint](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/leads/route.ts): `app/api/admin/leads/route.ts`
- [Logout endpoint](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/app/api/admin/logout/route.ts): `app/api/admin/logout/route.ts`

### Server and storage

- [Session authentication](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/admin-auth.ts): `lib/admin-auth.ts`
- [Request and DB access](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/lib/server.ts): `lib/server.ts`
- [D1 database](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/db/index.ts): `db/index.ts`
- [Lead and event schema](https://github.com/mhfarhoud/luxera-hotel-website/blob/main/db/schema.ts): `db/schema.ts`

### Other components

- **Visitor**
- **Administrator**
- **Separate hotel API**

## Connections

- Visitor → Product introduction: views (evidence: `README.md`)
- Product introduction → Guest phone preview: renders (evidence: `app/page.tsx`)
- Product introduction → Guest journey: renders (evidence: `app/page.tsx`)
- Product introduction → Latest product: renders (evidence: `app/page.tsx`)
- Product introduction → Official benefits: renders (evidence: `app/page.tsx`)
- Product introduction → Product controls: renders (evidence: `app/page.tsx`)
- Product introduction → Inquiry form: opens (evidence: `app/page.tsx`)
- Visitor → Feature catalog: views (evidence: `README.md`)
- Feature catalog → Inquiry form: uses (evidence: `app/features/page.tsx`)
- Inquiry form → Lead endpoint: submits (evidence: `components/lead-dialog.tsx`)
- Lead endpoint → Request and DB access: validates payload (evidence: `app/api/leads/route.ts`)
- Lead endpoint → D1 database: stores lead (evidence: `app/api/leads/route.ts`)
- Inquiry form → Opt-in analytics: tracks (evidence: `components/lead-dialog.tsx`)
- Opt-in analytics → Analytics endpoint: posts events
- Analytics endpoint → Request and DB access: validates payload (evidence: `app/api/events/route.ts`)
- Analytics endpoint → D1 database: stores events (evidence: `app/api/events/route.ts`)
- Administrator → Admin login page: signs in (evidence: `README.md`)
- Admin login page → Login form: renders (evidence: `app/admin/login/page.tsx`)
- Login form → Login endpoint: submits credentials
- Login endpoint → Session authentication: checks credentials (evidence: `app/api/admin/login/route.ts`)
- Login endpoint → Request and DB access: reads rate limits (evidence: `app/api/admin/login/route.ts`)
- Admin login page → Lead dashboard page: redirects after auth
- Administrator → Lead dashboard page: reviews leads (evidence: `README.md`)
- Lead dashboard page → Lead dashboard: renders (evidence: `app/admin/page.tsx`)
- Lead dashboard → Admin lead endpoint: reads and updates
- Admin lead endpoint → Session authentication: checks session (evidence: `app/api/admin/leads/route.ts`)
- Admin lead endpoint → Request and DB access: accesses data (evidence: `app/api/admin/leads/route.ts`)
- Admin lead endpoint → D1 database: reads and updates (evidence: `app/api/admin/leads/route.ts`)
- Administrator → Logout endpoint: ends session
- Logout endpoint → Session authentication: clears cookie (evidence: `app/api/admin/logout/route.ts`)
- Request and DB access → D1 database: binds D1 (evidence: `README.md`)
- Visitor → Separate hotel API: not connected (evidence: `README.md`)
