# matt-joe/avanti architecture

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

- Interactive diagram: https://gitdiagram.com/matt-joe/avanti
- Repository: https://github.com/matt-joe/avanti

## Overview

Avanti Lodge is a guest-facing lodge website with accommodation discovery, room availability and booking, account management, and local visitor information. The documented booking flow checks room availability, sends booking details to the Express backend to create a Stripe Checkout session, then records a completed payment through a Stripe webhook in Supabase. The graph also preserves the site’s signup, login, profile, promotions, accommodation, and visitor-information areas. Some frontend modules are indexed but not excerpted, so their internal connections are omitted rather than inferred.

Main entry points: [`Backend/server.js`](https://github.com/matt-joe/avanti/blob/main/Backend/server.js) (Express payment backend), [`Booking/booking.js`](https://github.com/matt-joe/avanti/blob/main/Booking/booking.js) (Room browsing), [`index.js`](https://github.com/matt-joe/avanti/blob/main/index.js) (Home and promotions), [`Sign Up/signup.js`](https://github.com/matt-joe/avanti/blob/main/Sign%20Up/signup.js) (Signup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest experience"]
  node_home["Home and promotions<br/>[index.js]"]
  node_gallery["Image gallery<br/>[galleryTest.js]"]
end

subgraph group_booking["Booking and payment"]
  node_roombrowse["Room browsing<br/>[booking.js]"]
  node_availability["Availability checks<br/>[booking.js]"]
  node_checkout["Checkout initiation<br/>[booking.js]"]
  node_paymentdisplay["Payment details display<br/>[payment.js]"]
  node_backend["Express payment backend<br/>[server.js]"]
  node_stripe["Stripe"]
end

subgraph group_identity["Guest accounts"]
  node_supabase[("Supabase auth and data")]
  node_signup["Signup<br/>[signup.js]"]
  node_login["Login and reset<br/>[login.js]"]
  node_profile["Profile and bookings<br/>[profile.js]"]
end

subgraph group_information["Lodge information"]
  node_about["About the lodge<br/>[aboutus.js]"]
  node_standard["Standard rooms<br/>[standardrooms.js]"]
  node_selfcatering["Self catering<br/>[selfcatering.js]"]
  node_contact["Contact<br/>[contact.js]"]
  node_activities["Activities<br/>[activities.js]"]
  node_eatout["Dining recommendations<br/>[eatout.js]"]
  node_outabout["Out and about<br/>[outandabout.js]"]
end

node_guest(("Guest"))

node_guest -->|"browses"| node_home
node_guest -->|"selects room"| node_roombrowse
node_roombrowse -->|"checks dates"| node_availability
node_availability -->|"reads bookings"| node_supabase
node_roombrowse -->|"loads rooms"| node_supabase
node_checkout -->|"requests session"| node_backend
node_backend -->|"creates session"| node_stripe
node_stripe -->|"sends webhook"| node_backend
node_backend -->|"inserts booking"| node_supabase
node_signup -->|"registers account"| node_supabase
node_login -->|"authenticates"| node_supabase
node_profile -->|"reads and updates"| node_supabase
node_home -->|"loads promotions"| node_supabase
node_guest -.->|"views"| node_about
node_guest -.->|"views"| node_standard
node_guest -.->|"views"| node_selfcatering
node_guest -.->|"views"| node_contact
node_guest -.->|"views"| node_activities
node_guest -.->|"views"| node_eatout
node_guest -.->|"views"| node_outabout
node_guest -.->|"views"| node_gallery

click node_home "https://github.com/matt-joe/avanti/blob/main/index.js"
click node_roombrowse "https://github.com/matt-joe/avanti/blob/main/Booking/booking.js"
click node_availability "https://github.com/matt-joe/avanti/blob/main/Booking/booking.js"
click node_checkout "https://github.com/matt-joe/avanti/blob/main/Booking/booking.js"
click node_paymentdisplay "https://github.com/matt-joe/avanti/blob/main/Payment/payment.js"
click node_backend "https://github.com/matt-joe/avanti/blob/main/Backend/server.js"
click node_signup "https://github.com/matt-joe/avanti/blob/main/Sign%20Up/signup.js"
click node_login "https://github.com/matt-joe/avanti/blob/main/Login/login.js"
click node_profile "https://github.com/matt-joe/avanti/blob/main/Profile/profile.js"
click node_about "https://github.com/matt-joe/avanti/blob/main/About%20Us/aboutus.js"
click node_standard "https://github.com/matt-joe/avanti/blob/main/Accomodation/Standard%20Rooms/standardrooms.js"
click node_selfcatering "https://github.com/matt-joe/avanti/blob/main/Accomodation/Self%20Catering/selfcatering.js"
click node_contact "https://github.com/matt-joe/avanti/blob/main/Contact/contact.js"
click node_activities "https://github.com/matt-joe/avanti/blob/main/Things%20To%20Do/Activities/activities.js"
click node_eatout "https://github.com/matt-joe/avanti/blob/main/Things%20To%20Do/Eat%20Out/eatout.js"
click node_outabout "https://github.com/matt-joe/avanti/blob/main/Things%20To%20Do/Out%20and%20About/outandabout.js"
click node_gallery "https://github.com/matt-joe/avanti/blob/main/Gallery%20Test/galleryTest.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_home,node_gallery toneBlue
class node_roombrowse,node_availability,node_checkout,node_paymentdisplay,node_backend,node_stripe toneAmber
class node_supabase,node_signup,node_login,node_profile toneMint
class node_about,node_standard,node_selfcatering,node_contact,node_activities,node_eatout,node_outabout toneRose
class node_guest toneIndigo
```

## Components

### Guest experience

- [Home and promotions](https://github.com/matt-joe/avanti/blob/main/index.js): `index.js`
- [Image gallery](https://github.com/matt-joe/avanti/blob/main/Gallery%20Test/galleryTest.js): `Gallery Test/galleryTest.js`

### Booking and payment

- [Room browsing](https://github.com/matt-joe/avanti/blob/main/Booking/booking.js): `Booking/booking.js`
- [Availability checks](https://github.com/matt-joe/avanti/blob/main/Booking/booking.js): `Booking/booking.js`
- [Checkout initiation](https://github.com/matt-joe/avanti/blob/main/Booking/booking.js): `Booking/booking.js`
- [Payment details display](https://github.com/matt-joe/avanti/blob/main/Payment/payment.js): `Payment/payment.js`
- [Express payment backend](https://github.com/matt-joe/avanti/blob/main/Backend/server.js): `Backend/server.js`
- **Stripe**

### Guest accounts

- **Supabase auth and data**
- [Signup](https://github.com/matt-joe/avanti/blob/main/Sign%20Up/signup.js): `Sign Up/signup.js`
- [Login and reset](https://github.com/matt-joe/avanti/blob/main/Login/login.js): `Login/login.js`
- [Profile and bookings](https://github.com/matt-joe/avanti/blob/main/Profile/profile.js): `Profile/profile.js`

### Lodge information

- [About the lodge](https://github.com/matt-joe/avanti/blob/main/About%20Us/aboutus.js): `About Us/aboutus.js`
- [Standard rooms](https://github.com/matt-joe/avanti/blob/main/Accomodation/Standard%20Rooms/standardrooms.js): `Accomodation/Standard Rooms/standardrooms.js`
- [Self catering](https://github.com/matt-joe/avanti/blob/main/Accomodation/Self%20Catering/selfcatering.js): `Accomodation/Self Catering/selfcatering.js`
- [Contact](https://github.com/matt-joe/avanti/blob/main/Contact/contact.js): `Contact/contact.js`
- [Activities](https://github.com/matt-joe/avanti/blob/main/Things%20To%20Do/Activities/activities.js): `Things To Do/Activities/activities.js`
- [Dining recommendations](https://github.com/matt-joe/avanti/blob/main/Things%20To%20Do/Eat%20Out/eatout.js): `Things To Do/Eat Out/eatout.js`
- [Out and about](https://github.com/matt-joe/avanti/blob/main/Things%20To%20Do/Out%20and%20About/outandabout.js): `Things To Do/Out and About/outandabout.js`

### Other components

- **Guest**

## Connections

- Guest → Home and promotions: browses (evidence: `README.md`)
- Guest → Room browsing: selects room (evidence: `Booking/booking.js`)
- Room browsing → Availability checks: checks dates (evidence: `Booking/booking.js`)
- Availability checks → Supabase auth and data: reads bookings (evidence: `Booking/booking.js`)
- Room browsing → Supabase auth and data: loads rooms (evidence: `Booking/booking.js`)
- Checkout initiation → Express payment backend: requests session (evidence: `Booking/booking.js`)
- Express payment backend → Stripe: creates session (evidence: `Backend/server.js`)
- Stripe → Express payment backend: sends webhook (evidence: `Backend/server.js`)
- Express payment backend → Supabase auth and data: inserts booking (evidence: `Backend/server.js`)
- Signup → Supabase auth and data: registers account (evidence: `Sign Up/signup.js`)
- Login and reset → Supabase auth and data: authenticates (evidence: `Login/login.js`)
- Profile and bookings → Supabase auth and data: reads and updates (evidence: `Profile/profile.js`)
- Home and promotions → Supabase auth and data: loads promotions (evidence: `index.js`)
- Guest → About the lodge: views
- Guest → Standard rooms: views
- Guest → Self catering: views
- Guest → Contact: views
- Guest → Activities: views
- Guest → Dining recommendations: views
- Guest → Out and about: views
- Guest → Image gallery: views
