# shane-anne/h-a-cozy-pad-booking-system architecture

> Architecture diagram of the GitHub repository shane-anne/h-a-cozy-pad-booking-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shane-anne/h-a-cozy-pad-booking-system
- Repository: https://github.com/shane-anne/h-a-cozy-pad-booking-system

## Overview

H&A Cozy Pad is a lodging-booking marketplace with guest discovery and reservations, host property management, and administrative tools. The main flow is routed through the React app: guests search listings, open a booking page, and check date availability; hosts manage listings and reservations, while users can view trips and profile information. PHP endpoints provide the visible login, availability, FAQ, and listing/booking operations, with database access in the shared PHP database module. The tree also includes a calendar server and calendar page; their connection is not established by the excerpts.

Main entry points: [`src/App.jsx`](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/App.jsx) (App routes), [`src/components/AuthModal.jsx`](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/AuthModal.jsx) (Sign-in), [`src/pages/home_page/HomePage.jsx`](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/HomePage.jsx) (Home and search), [`src/pages/booking_page/Bookingconfirmation.jsx`](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/booking_page/Bookingconfirmation.jsx) (Booking and availability)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and identity"]
  node_app_router["App routes<br/>[App.jsx]"]
  node_auth["Sign-in<br/>[AuthModal.jsx]"]
  node_google_button["Google sign-in button"]
end

subgraph group_guest["Guest experience"]
  node_home["Home and search<br/>[HomePage.jsx]"]
  node_search_section["Search section<br/>[SearchSection.jsx]"]
  node_property_section["Property results"]
  node_listing_detail["Property details<br/>[ListedProperty.jsx]"]
  node_booking["Booking and availability"]
  node_trips["Trips<br/>[Trips.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_help["Help center<br/>[HelpCenter.jsx]"]
  node_chatbot["Chatbot<br/>[Chatbot.jsx]"]
end

subgraph group_host["Host operations"]
  node_listing_wizard["Listing workflow"]
  node_listing_draft["Listing draft state<br/>[listingDraft.js]"]
  node_host_listings["Host listings"]
  node_reservations["Reservation management"]
  node_calendar["Host calendar"]
  node_user_admin["User management<br/>[UserManagement.jsx]"]
  node_faq_admin["FAQ management<br/>[FaqManagement.jsx]"]
end

subgraph group_backend["API and persistence"]
  node_api_client["API base URL<br/>[api.js]"]
  node_auth_api["Login endpoint<br/>[login.php]"]
  node_google_api["Google login endpoint<br/>[google_login.php]"]
  node_availability_api["Availability endpoint"]
  node_faq_api["FAQ endpoint<br/>[faqs.php]"]
  node_booking_api["Booking endpoint<br/>[create_booking.php]"]
  node_listing_api["Listing endpoint<br/>[create_listing.php]"]
  node_php_db[("PHP database access<br/>[db.php]")]
  node_calendar_server["Calendar service"]
end

node_guest_actor(("Guest or host"))

node_guest_actor -->|"opens app"| node_app_router
node_app_router -->|"routes to"| node_home
node_app_router -->|"routes to"| node_booking
node_app_router -->|"routes to"| node_trips
node_app_router -->|"routes to"| node_profile
node_app_router -->|"routes to"| node_help
node_app_router -->|"routes to"| node_host_listings
node_app_router -->|"routes to"| node_reservations
node_app_router -->|"routes to"| node_calendar
node_app_router -->|"routes to"| node_user_admin
node_app_router -->|"routes to"| node_faq_admin
node_auth -->|"submits login"| node_auth_api
node_auth -->|"renders"| node_google_button
node_auth -->|"submits credential"| node_google_api
node_home -.->|"renders"| node_search_section
node_home -.->|"renders"| node_property_section
node_booking -->|"checks dates"| node_availability_api
node_faq_admin -->|"saves FAQs"| node_faq_api
node_host_listings -->|"uses draft"| node_listing_draft
node_booking_api -->|"uses database"| node_php_db
node_listing_api -->|"uses database"| node_php_db
node_booking -.->|"creates booking"| node_booking_api
node_host_listings -.->|"manages listings"| node_listing_api
node_calendar -.->|"calendar integration"| node_calendar_server

click node_app_router "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/App.jsx"
click node_auth "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/AuthModal.jsx"
click node_google_button "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/GoogleAuthButton.jsx"
click node_home "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/HomePage.jsx"
click node_search_section "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/SearchSection.jsx"
click node_property_section "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/PropertySection.jsx"
click node_listing_detail "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/ListedProperty.jsx"
click node_booking "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/booking_page/Bookingconfirmation.jsx"
click node_trips "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/Trips.jsx"
click node_profile "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/Profile.jsx"
click node_help "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/faq_page/HelpCenter.jsx"
click node_chatbot "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/Chatbot.jsx"
click node_listing_wizard "https://github.com/shane-anne/h-a-cozy-pad-booking-system/tree/main/src/pages/listing_page"
click node_listing_draft "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/lib/listingDraft.js"
click node_host_listings "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/DashboardListings.jsx"
click node_reservations "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/DashboardReservations.jsx"
click node_calendar "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/DashboardCalendar.jsx"
click node_user_admin "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/UserManagement.jsx"
click node_faq_admin "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/faq_page/FaqManagement.jsx"
click node_api_client "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/lib/api.js"
click node_auth_api "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/login.php"
click node_google_api "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/google_login.php"
click node_availability_api "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/check_availability.php"
click node_faq_api "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/faqs.php"
click node_booking_api "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/create_booking.php"
click node_listing_api "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/create_listing.php"
click node_php_db "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/db.php"
click node_calendar_server "https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/server/google-calendar-server.mjs"

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_app_router,node_auth,node_google_button toneBlue
class node_home,node_search_section,node_property_section,node_listing_detail,node_booking,node_trips,node_profile,node_help,node_chatbot toneAmber
class node_listing_wizard,node_listing_draft,node_host_listings,node_reservations,node_calendar,node_user_admin,node_faq_admin toneMint
class node_api_client,node_auth_api,node_google_api,node_availability_api,node_faq_api,node_booking_api,node_listing_api,node_php_db,node_calendar_server toneRose
class node_guest_actor toneIndigo
```

## Components

### Application and identity

- [App routes](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/App.jsx): `src/App.jsx`
- [Sign-in](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/AuthModal.jsx): `src/components/AuthModal.jsx`
- [Google sign-in button](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/GoogleAuthButton.jsx): `src/components/GoogleAuthButton.jsx`

### Guest experience

- [Home and search](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/HomePage.jsx): `src/pages/home_page/HomePage.jsx`
- [Search section](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/SearchSection.jsx): `src/pages/home_page/SearchSection.jsx`
- [Property results](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/home_page/PropertySection.jsx): `src/pages/home_page/PropertySection.jsx`
- [Property details](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/ListedProperty.jsx): `src/pages/ListedProperty.jsx`
- [Booking and availability](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/booking_page/Bookingconfirmation.jsx): `src/pages/booking_page/Bookingconfirmation.jsx`
- [Trips](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/Trips.jsx): `src/pages/Trips.jsx`
- [Profile](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Help center](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/faq_page/HelpCenter.jsx): `src/pages/faq_page/HelpCenter.jsx`
- [Chatbot](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/components/Chatbot.jsx): `src/components/Chatbot.jsx`

### Host operations

- [Listing workflow](https://github.com/shane-anne/h-a-cozy-pad-booking-system/tree/main/src/pages/listing_page): `src/pages/listing_page`
- [Listing draft state](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/lib/listingDraft.js): `src/lib/listingDraft.js`
- [Host listings](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/DashboardListings.jsx): `src/pages/dashboard_page/DashboardListings.jsx`
- [Reservation management](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/DashboardReservations.jsx): `src/pages/dashboard_page/DashboardReservations.jsx`
- [Host calendar](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/DashboardCalendar.jsx): `src/pages/dashboard_page/DashboardCalendar.jsx`
- [User management](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/dashboard_page/UserManagement.jsx): `src/pages/dashboard_page/UserManagement.jsx`
- [FAQ management](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/pages/faq_page/FaqManagement.jsx): `src/pages/faq_page/FaqManagement.jsx`

### API and persistence

- [API base URL](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/src/lib/api.js): `src/lib/api.js`
- [Login endpoint](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/login.php): `api/login.php`
- [Google login endpoint](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/google_login.php): `api/google_login.php`
- [Availability endpoint](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/check_availability.php): `api/check_availability.php`
- [FAQ endpoint](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/faqs.php): `api/faqs.php`
- [Booking endpoint](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/create_booking.php): `api/create_booking.php`
- [Listing endpoint](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/create_listing.php): `api/create_listing.php`
- [PHP database access](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/api/db.php): `api/db.php`
- [Calendar service](https://github.com/shane-anne/h-a-cozy-pad-booking-system/blob/main/server/google-calendar-server.mjs): `server/google-calendar-server.mjs`

### Other components

- **Guest or host**

## Connections

- Guest or host → App routes: opens app (evidence: `src/App.jsx`)
- App routes → Home and search: routes to (evidence: `src/App.jsx`)
- App routes → Booking and availability: routes to (evidence: `src/App.jsx`)
- App routes → Trips: routes to (evidence: `src/App.jsx`)
- App routes → Profile: routes to (evidence: `src/App.jsx`)
- App routes → Help center: routes to (evidence: `src/App.jsx`)
- App routes → Host listings: routes to (evidence: `src/App.jsx`)
- App routes → Reservation management: routes to (evidence: `src/App.jsx`)
- App routes → Host calendar: routes to (evidence: `src/App.jsx`)
- App routes → User management: routes to (evidence: `src/App.jsx`)
- App routes → FAQ management: routes to (evidence: `src/App.jsx`)
- Sign-in → Login endpoint: submits login (evidence: `src/components/AuthModal.jsx`)
- Sign-in → Google sign-in button: renders (evidence: `src/components/AuthModal.jsx`)
- Sign-in → Google login endpoint: submits credential (evidence: `src/components/AuthModal.jsx`)
- Home and search → Search section: renders
- Home and search → Property results: renders
- Booking and availability → Availability endpoint: checks dates (evidence: `src/pages/booking_page/Bookingconfirmation.jsx`)
- FAQ management → FAQ endpoint: saves FAQs (evidence: `src/pages/faq_page/FaqManagement.jsx`)
- Host listings → Listing draft state: uses draft (evidence: `src/pages/dashboard_page/DashboardListings.jsx`)
- Booking endpoint → PHP database access: uses database (evidence: `api/create_booking.php`)
- Listing endpoint → PHP database access: uses database (evidence: `api/create_listing.php`)
- Booking and availability → Booking endpoint: creates booking
- Host listings → Listing endpoint: manages listings
- Host calendar → Calendar service: calendar integration
