# john-rey-carlo-a-gemao/hacienda-de-luisana architecture

> Architecture diagram of the GitHub repository john-rey-carlo-a-gemao/hacienda-de-luisana, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/john-rey-carlo-a-gemao/hacienda-de-luisana
- Repository: https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana

## Overview

This snapshot contains Hacienda de LuisAna’s guest-facing React website: visitors explore the property, authenticate, check booking options, submit a booking with payment proof, manage their own stays, message the Admin, and leave reviews. The README also describes a separate Admin mobile app, but its documented `lib/` source tree is absent here, so its operational workflows cannot be mapped reliably. Relationships below follow shown imports/calls or README statements; unsampled components are represented only where documented.

Main entry points: [`src/App.tsx`](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/App.tsx) (Website routes), [`src/pages/BookingPage.tsx`](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/BookingPage.tsx) (Booking form), [`src/pages/DownpaymentPage.tsx`](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/DownpaymentPage.tsx) (Payment proof), [`src/lib/firestoreBookings.ts`](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/firestoreBookings.ts) (Booking records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest website"]
  node_web_app["Website routes<br/>[App.tsx]"]
  node_property_pages["Property pages<br/>[Home.tsx]"]
  node_property_content["Property content<br/>[site.ts]"]
  node_messages_page["Guest messages<br/>[MessagesPage.tsx]"]
  node_review_form["Review submission<br/>[ReviewForm.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth_ui["Sign-in UI<br/>[LoginForm.tsx]"]
  node_auth_context["Auth context<br/>[AuthContext.tsx]"]
  node_auth_session["Auth session<br/>[session.ts]"]
end

subgraph group_booking["Booking lifecycle"]
  node_booking_page["Booking form<br/>[BookingPage.tsx]"]
  node_booking_rules["Booking lifecycle<br/>[actions.ts]"]
  node_booking_store[("Booking records")]
  node_payment_flow["Payment proof"]
  node_payment_ocr["Proof OCR<br/>[ocr.ts]"]
  node_account_page["Guest account<br/>[AccountPage.tsx]"]
  node_rates_hook["Published rates"]
end

subgraph group_services["Cloud services"]
  node_rates_store[("Rates data<br/>[ratesDB.ts]")]
  node_location_hook["Live location<br/>[useLiveLocation.ts]"]
  node_review_service[("Review records<br/>[reviewsCloud.ts]")]
  node_firebase[("Firebase<br/>[firebase.ts]")]
  node_supabase[("Supabase Storage<br/>[supabase.ts]")]
end

node_guest_actor(("Guest"))

node_guest_actor -->|"visits"| node_web_app
node_web_app -->|"routes to"| node_property_pages
node_property_pages -->|"presents"| node_property_content
node_web_app -->|"routes to"| node_auth_ui
node_auth_ui -->|"uses session"| node_auth_context
node_auth_context -->|"delegates to"| node_auth_session
node_guest_actor -->|"requests stay"| node_booking_page
node_web_app -->|"routes to"| node_booking_page
node_booking_page -.->|"checks booking"| node_booking_rules
node_booking_page -.->|"checks availability"| node_booking_store
node_booking_page -->|"continues to payment"| node_payment_flow
node_payment_flow -->|"submits proof"| node_booking_store
node_payment_flow -->|"checks proof"| node_payment_ocr
node_payment_flow -.->|"uploads proof"| node_supabase
node_booking_store -->|"reads and writes"| node_firebase
node_web_app -->|"routes to"| node_account_page
node_account_page -.->|"manages bookings"| node_booking_store
node_rates_hook -->|"subscribes"| node_rates_store
node_rates_store -.->|"reads rates"| node_firebase
node_web_app -.->|"routes to"| node_messages_page
node_messages_page -.->|"shares location"| node_location_hook
node_location_hook -.->|"streams location"| node_firebase
node_review_form -->|"submits review"| node_review_service
node_review_service -->|"stores reviews"| node_firebase

click node_web_app "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/App.tsx"
click node_property_pages "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/Home.tsx"
click node_property_content "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/config/site.ts"
click node_auth_ui "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/components/Auth/LoginForm.tsx"
click node_auth_context "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/context/AuthContext.tsx"
click node_auth_session "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/auth/session.ts"
click node_booking_page "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/BookingPage.tsx"
click node_booking_rules "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/booking/actions.ts"
click node_booking_store "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/firestoreBookings.ts"
click node_payment_flow "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/DownpaymentPage.tsx"
click node_payment_ocr "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/payments/ocr.ts"
click node_account_page "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/AccountPage.tsx"
click node_rates_hook "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/hooks/usePublishedRates.ts"
click node_rates_store "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/ratesDB.ts"
click node_messages_page "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/MessagesPage.tsx"
click node_location_hook "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/hooks/useLiveLocation.ts"
click node_review_form "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/components/ReviewForm.tsx"
click node_review_service "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/reviewsCloud.ts"
click node_firebase "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/firebase.ts"
click node_supabase "https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/supabase.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_web_app,node_property_pages,node_property_content,node_messages_page,node_review_form toneBlue
class node_auth_ui,node_auth_context,node_auth_session toneAmber
class node_booking_page,node_booking_rules,node_booking_store,node_payment_flow,node_payment_ocr,node_account_page,node_rates_hook toneMint
class node_rates_store,node_location_hook,node_review_service,node_firebase,node_supabase toneRose
class node_guest_actor toneIndigo
```

## Components

### Guest website

- [Website routes](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/App.tsx): `src/App.tsx`
- [Property pages](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Property content](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/config/site.ts): `src/config/site.ts`
- [Guest messages](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/MessagesPage.tsx): `src/pages/MessagesPage.tsx`
- [Review submission](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/components/ReviewForm.tsx): `src/components/ReviewForm.tsx`

### Identity and access

- [Sign-in UI](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/components/Auth/LoginForm.tsx): `src/components/Auth/LoginForm.tsx`
- [Auth context](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Auth session](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/auth/session.ts): `src/lib/auth/session.ts`

### Booking lifecycle

- [Booking form](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/BookingPage.tsx): `src/pages/BookingPage.tsx`
- [Booking lifecycle](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/booking/actions.ts): `src/lib/booking/actions.ts`
- [Booking records](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/firestoreBookings.ts): `src/lib/firestoreBookings.ts`
- [Payment proof](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/DownpaymentPage.tsx): `src/pages/DownpaymentPage.tsx`
- [Proof OCR](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/payments/ocr.ts): `src/lib/payments/ocr.ts`
- [Guest account](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/pages/AccountPage.tsx): `src/pages/AccountPage.tsx`
- [Published rates](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/hooks/usePublishedRates.ts): `src/hooks/usePublishedRates.ts`

### Cloud services

- [Rates data](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/ratesDB.ts): `src/lib/ratesDB.ts`
- [Live location](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/hooks/useLiveLocation.ts): `src/hooks/useLiveLocation.ts`
- [Review records](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/reviewsCloud.ts): `src/lib/reviewsCloud.ts`
- [Firebase](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [Supabase Storage](https://github.com/john-rey-carlo-a-gemao/hacienda-de-luisana/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`

### Other components

- **Guest**

## Connections

- Guest → Website routes: visits
- Website routes → Property pages: routes to (evidence: `src/App.tsx`)
- Property pages → Property content: presents
- Website routes → Sign-in UI: routes to (evidence: `src/App.tsx`)
- Sign-in UI → Auth context: uses session (evidence: `src/components/Auth/LoginForm.tsx`)
- Auth context → Auth session: delegates to (evidence: `src/context/AuthContext.tsx`)
- Guest → Booking form: requests stay
- Website routes → Booking form: routes to (evidence: `src/App.tsx`)
- Booking form → Booking lifecycle: checks booking
- Booking form → Booking records: checks availability
- Booking form → Payment proof: continues to payment
- Payment proof → Booking records: submits proof (evidence: `src/pages/DownpaymentPage.tsx`)
- Payment proof → Proof OCR: checks proof (evidence: `src/pages/DownpaymentPage.tsx`)
- Payment proof → Supabase Storage: uploads proof
- Booking records → Firebase: reads and writes (evidence: `src/lib/firestoreBookings.ts`)
- Website routes → Guest account: routes to (evidence: `src/App.tsx`)
- Guest account → Booking records: manages bookings
- Published rates → Rates data: subscribes (evidence: `src/hooks/usePublishedRates.ts`)
- Rates data → Firebase: reads rates
- Website routes → Guest messages: routes to (evidence: `src/App.tsx`)
- Guest messages → Live location: shares location
- Live location → Firebase: streams location
- Review submission → Review records: submits review (evidence: `src/components/ReviewForm.tsx`)
- Review records → Firebase: stores reviews (evidence: `src/lib/reviewsCloud.ts`)
