# jhnirvinalido/the-villa---batangas architecture

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

- Interactive diagram: https://gitdiagram.com/jhnirvinalido/the-villa---batangas
- Repository: https://github.com/jhnirvinalido/the-villa---batangas

## Overview

The repository implements The Villa’s guest booking and feedback experience alongside staff and admin tools for bookings, villa operations, maintenance, and task management. The guest-facing path spans villa discovery, booking, and post-stay feedback; staff-facing paths support front-desk work and operational coordination. The backend’s FastAPI entry point connects these domains to authentication, business modules, and live updates. Several UI and backend modules are listed but unsampled, and the README is empty, so uncertain links are omitted rather than inferred.

Main entry points: [`backend/main.py`](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/main.py) (API entry point), [`backend/admin.py`](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/admin.py) (Admin services), [`backend/booking.py`](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/booking.py) (Booking service), [`backend/live_updates.py`](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/live_updates.py) (Live updates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest experience"]
  node_public_site["Public site<br/>[App.jsx]"]
  node_booking_form["Booking form<br/>[BookForm.jsx]"]
  node_guest_feedback["Guest feedback<br/>[GuestFeedback.jsx]"]
end

subgraph group_booking["Booking operations"]
  node_booking_api["Booking service<br/>[booking.py]"]
  node_booking_assignments["Booking assignments"]
  node_admin_api["Admin services<br/>[admin.py]"]
  node_front_desk["Front desk"]
  node_villa_catalog[("Villa catalog<br/>[villa_catalog.py]")]
end

subgraph group_operations["Staff operations"]
  node_staff_portal["Staff portal<br/>[staffDashboard.jsx]"]
  node_staff_services["Staff services<br/>[staff.py]"]
  node_maintenance["Maintenance<br/>[maintenance.py]"]
  node_task_workflow["Task workflow<br/>[task_workflow.py]"]
end

subgraph group_feedback["Feedback intelligence"]
  node_feedback_service["Feedback service"]
  node_feedback_analysis["Feedback analysis"]
  node_feedback_model["ML inference<br/>[inference.py]"]
  node_feedback_policy["Feedback policy<br/>[feedback_policy.py]"]
end

subgraph group_platform["Application platform"]
  node_api_entry["API entry point<br/>[main.py]"]
  node_staff_auth["Staff authentication"]
  node_live_updates["Live updates<br/>[live_updates.py]"]
  node_database[("Supabase data<br/>[db_pool.py]")]
  node_live_hook["Live update hook<br/>[useLiveUpdates.js]"]
end

node_guest(("Guest"))
node_staff(("Staff"))
node_admin(("Administrator"))

node_guest -->|"browses"| node_public_site
node_guest -->|"submits booking"| node_booking_form
node_guest -.->|"submits feedback"| node_guest_feedback
node_staff -->|"uses"| node_staff_portal
node_admin -->|"manages"| node_admin_api
node_booking_form -.->|"requests booking"| node_booking_api
node_public_site -.->|"loads catalog"| node_booking_api
node_api_entry -->|"imports"| node_booking_api
node_api_entry -->|"imports"| node_admin_api
node_api_entry -->|"imports"| node_staff_services
node_api_entry -->|"imports"| node_maintenance
node_api_entry -->|"imports"| node_villa_catalog
node_api_entry -->|"imports"| node_staff_auth
node_api_entry -->|"imports"| node_live_updates
node_booking_api -->|"uses catalog"| node_villa_catalog
node_admin_api -->|"uses bookings"| node_booking_api
node_admin_api -->|"uses staff data"| node_staff_services
node_admin_api -->|"uses feedback"| node_feedback_service
node_admin_api -->|"applies policy"| node_feedback_policy
node_staff_services -->|"uses workflow"| node_task_workflow
node_staff_services -->|"uses assignments"| node_booking_assignments
node_maintenance -->|"reads catalog"| node_villa_catalog
node_maintenance -->|"publishes updates"| node_live_updates
node_booking_assignments -->|"publishes updates"| node_live_updates
node_feedback_service -->|"uses booking data"| node_booking_api
node_feedback_service -->|"checks eligibility"| node_feedback_policy
node_feedback_analysis -->|"uses inference"| node_feedback_model
node_feedback_model -->|"normalizes input"| node_feedback_policy
node_feedback_model -->|"emits changes"| node_live_updates
node_live_hook -.->|"subscribes"| node_live_updates
node_live_hook -->|"refreshes view"| node_staff_portal
node_staff_auth -->|"reads accounts"| node_database
node_booking_api -.->|"reads and writes"| node_database
node_admin_api -.->|"reads and writes"| node_database

click node_public_site "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/App.jsx"
click node_booking_form "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/BookForm.jsx"
click node_guest_feedback "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/GuestFeedback.jsx"
click node_booking_api "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/booking.py"
click node_booking_assignments "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/booking_assignments.py"
click node_admin_api "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/admin.py"
click node_front_desk "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/FrontDeskDashboard.jsx"
click node_villa_catalog "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/villa_catalog.py"
click node_staff_portal "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/staffDashboard.jsx"
click node_staff_services "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/staff.py"
click node_maintenance "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/maintenance.py"
click node_task_workflow "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/task_workflow.py"
click node_feedback_service "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/feedback_service.py"
click node_feedback_analysis "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/feedback_analysis.py"
click node_feedback_model "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/ml/inference.py"
click node_feedback_policy "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/feedback_policy.py"
click node_api_entry "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/main.py"
click node_staff_auth "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/staff_admin_auth.py"
click node_live_updates "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/live_updates.py"
click node_database "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/db_pool.py"
click node_live_hook "https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/useLiveUpdates.js"

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_site,node_booking_form,node_guest_feedback toneBlue
class node_booking_api,node_booking_assignments,node_admin_api,node_front_desk,node_villa_catalog toneAmber
class node_staff_portal,node_staff_services,node_maintenance,node_task_workflow toneMint
class node_feedback_service,node_feedback_analysis,node_feedback_model,node_feedback_policy toneRose
class node_api_entry,node_staff_auth,node_live_updates,node_database,node_live_hook,node_guest,node_staff,node_admin toneIndigo
```

## Components

### Guest experience

- [Public site](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Booking form](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/BookForm.jsx): `frontend/src/BookForm.jsx`
- [Guest feedback](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/GuestFeedback.jsx): `frontend/src/GuestFeedback.jsx`

### Booking operations

- [Booking service](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/booking.py): `backend/booking.py`
- [Booking assignments](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/booking_assignments.py): `backend/booking_assignments.py`
- [Admin services](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/admin.py): `backend/admin.py`
- [Front desk](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/FrontDeskDashboard.jsx): `frontend/src/FrontDeskDashboard.jsx`
- [Villa catalog](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/villa_catalog.py): `backend/villa_catalog.py`

### Staff operations

- [Staff portal](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/staffDashboard.jsx): `frontend/src/staffDashboard.jsx`
- [Staff services](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/staff.py): `backend/staff.py`
- [Maintenance](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/maintenance.py): `backend/maintenance.py`
- [Task workflow](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/task_workflow.py): `backend/task_workflow.py`

### Feedback intelligence

- [Feedback service](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/feedback_service.py): `backend/feedback_service.py`
- [Feedback analysis](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/feedback_analysis.py): `backend/feedback_analysis.py`
- [ML inference](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/ml/inference.py): `backend/ml/inference.py`
- [Feedback policy](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/feedback_policy.py): `backend/feedback_policy.py`

### Application platform

- [API entry point](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/main.py): `backend/main.py`
- [Staff authentication](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/staff_admin_auth.py): `backend/staff_admin_auth.py`
- [Live updates](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/live_updates.py): `backend/live_updates.py`
- [Supabase data](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/backend/db_pool.py): `backend/db_pool.py`
- [Live update hook](https://github.com/jhnirvinalido/the-villa---batangas/blob/main/frontend/src/useLiveUpdates.js): `frontend/src/useLiveUpdates.js`

### Other components

- **Guest**
- **Staff**
- **Administrator**

## Connections

- Guest → Public site: browses (evidence: `frontend/src/App.jsx`)
- Guest → Booking form: submits booking (evidence: `frontend/src/BookForm.jsx`)
- Guest → Guest feedback: submits feedback
- Staff → Staff portal: uses (evidence: `frontend/src/staffDashboard.jsx`)
- Administrator → Admin services: manages (evidence: `backend/admin.py`)
- Booking form → Booking service: requests booking
- Public site → Booking service: loads catalog
- API entry point → Booking service: imports (evidence: `backend/main.py`)
- API entry point → Admin services: imports (evidence: `backend/main.py`)
- API entry point → Staff services: imports (evidence: `backend/main.py`)
- API entry point → Maintenance: imports (evidence: `backend/main.py`)
- API entry point → Villa catalog: imports (evidence: `backend/main.py`)
- API entry point → Staff authentication: imports (evidence: `backend/main.py`)
- API entry point → Live updates: imports (evidence: `backend/main.py`)
- Booking service → Villa catalog: uses catalog (evidence: `backend/booking.py`)
- Admin services → Booking service: uses bookings (evidence: `backend/admin.py`)
- Admin services → Staff services: uses staff data (evidence: `backend/admin.py`)
- Admin services → Feedback service: uses feedback (evidence: `backend/admin.py`)
- Admin services → Feedback policy: applies policy (evidence: `backend/admin.py`)
- Staff services → Task workflow: uses workflow (evidence: `backend/staff.py`)
- Staff services → Booking assignments: uses assignments (evidence: `backend/staff.py`)
- Maintenance → Villa catalog: reads catalog (evidence: `backend/maintenance.py`)
- Maintenance → Live updates: publishes updates (evidence: `backend/maintenance.py`)
- Booking assignments → Live updates: publishes updates (evidence: `backend/booking_assignments.py`)
- Feedback service → Booking service: uses booking data (evidence: `backend/feedback_service.py`)
- Feedback service → Feedback policy: checks eligibility (evidence: `backend/feedback_service.py`)
- Feedback analysis → ML inference: uses inference (evidence: `backend/feedback_analysis.py`)
- ML inference → Feedback policy: normalizes input (evidence: `backend/ml/inference.py`)
- ML inference → Live updates: emits changes (evidence: `backend/ml/inference.py`)
- Live update hook → Live updates: subscribes
- Live update hook → Staff portal: refreshes view (evidence: `frontend/src/staffDashboard.jsx`)
- Staff authentication → Supabase data: reads accounts (evidence: `backend/staff_admin_auth.py`)
- Booking service → Supabase data: reads and writes (evidence: `backend/booking.py`)
- Admin services → Supabase data: reads and writes (evidence: `backend/admin.py`)
