# rudra1358/aurelia-cafe architecture

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

- Interactive diagram: https://gitdiagram.com/rudra1358/aurelia-cafe
- Repository: https://github.com/rudra1358/aurelia-cafe

## Overview

Aurelia is a café website with a public-facing menu, events, multilingual interface, legal pages, and a real reservation-request and booking-management workflow. Guests submit requests through the site; the API validates and rate-limits them, logs them to Google Sheets, and sends email. Sheet-driven status changes trigger guest notifications, while signed links let guests change or cancel eligible bookings. The README documents integrations and behavior beyond the sampled excerpts; edges for those relationships cite it.

Main entry points: [`app/api/reservations/route.ts`](https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/reservations/route.ts) (Reservation API), [`components/Reservation.tsx`](https://github.com/rudra1358/aurelia-cafe/blob/main/components/Reservation.tsx) (Reservation Form), [`app/page.tsx`](https://github.com/rudra1358/aurelia-cafe/blob/main/app/page.tsx) (Home Page), [`app/api/booking/route.ts`](https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/booking/route.ts) (Booking API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Café Website"]
  node_home["Home Page<br/>[page.tsx]"]
  node_events_page["Events Page<br/>[page.tsx]"]
  node_legal_pages["Legal Pages<br/>[page.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_language["Language Switch<br/>[Language.tsx]"]
end

subgraph group_content["Site Content"]
  node_menu["Menu<br/>[Menu.tsx]"]
  node_menu_data["Menu Data<br/>[menu.ts]"]
  node_events["Events<br/>[Events.tsx]"]
  node_events_data["Event Data<br/>[events.ts]"]
  node_site_config["Café Settings<br/>[site.ts]"]
  node_translations["Translations<br/>[translations.ts]"]
end

subgraph group_booking["Booking Workflows"]
  node_reservation_form["Reservation Form<br/>[Reservation.tsx]"]
  node_reservations_api["Reservation API<br/>[route.ts]"]
  node_manage_page["Manage Booking Page<br/>[page.tsx]"]
  node_manage_form["Change or Cancel<br/>[ManageBooking.tsx]"]
  node_booking_api["Booking API<br/>[route.ts]"]
  node_notify_api["Notification API<br/>[route.ts]"]
end

subgraph group_services["Booking Services"]
  node_validation["Reservation Validation<br/>[validation.ts]"]
  node_rate_limit["Rate Limiting<br/>[rate-limit.ts]"]
  node_sheet_store[("Google Sheets<br/>[sheets.ts]")]
  node_mailer["Email Delivery<br/>[mailer.ts]"]
  node_email_templates["Email Templates<br/>[email-templates.ts]"]
  node_booking_token["Signed Booking Links<br/>[booking-token.ts]"]
  node_notifications["Booking Notifications<br/>[notifications.ts]"]
end

node_guest(("Guest"))
node_owner(("Café Owner"))
node_sheets_service{{"Apps Script Trigger"}}
node_smtp{{"Gmail SMTP"}}
node_whatsapp{{"WhatsApp Cloud API"}}

node_guest -->|"browses"| node_home
node_home -->|"renders"| node_menu
node_menu -->|"reads"| node_menu_data
node_home -->|"renders"| node_events
node_events_page -->|"renders"| node_events
node_events -->|"reads"| node_events_data
node_home -->|"renders"| node_reservation_form
node_events -->|"prefills booking"| node_reservation_form
node_guest -->|"submits request"| node_reservation_form
node_reservation_form -->|"validates"| node_validation
node_reservation_form -->|"posts request"| node_reservations_api
node_reservations_api -->|"revalidates"| node_validation
node_reservations_api -->|"checks limits"| node_rate_limit
node_reservations_api -->|"saves request"| node_sheet_store
node_reservations_api -->|"sends emails"| node_mailer
node_mailer -->|"renders"| node_email_templates
node_mailer -->|"delivers via"| node_smtp
node_smtp -->|"alerts"| node_owner
node_smtp -->|"acknowledges"| node_guest
node_owner -->|"updates status"| node_sheet_store
node_sheet_store -->|"triggers notification"| node_sheets_service
node_sheets_service -->|"calls"| node_notify_api
node_notify_api -->|"dispatches"| node_notifications
node_notifications -->|"sends email"| node_mailer
node_notifications -.->|"alerts optionally"| node_whatsapp
node_smtp -->|"confirms or reminds"| node_guest
node_guest -->|"opens signed link"| node_manage_page
node_manage_page -->|"renders"| node_manage_form
node_manage_form -->|"requests change"| node_booking_api
node_booking_api -->|"verifies link"| node_booking_token
node_booking_api -->|"reads and updates"| node_sheet_store
node_booking_api -->|"notifies guest"| node_notifications
node_navbar -->|"uses switch"| node_language
node_language -->|"translates interface"| node_translations
node_legal_pages -->|"reads settings"| node_site_config

click node_home "https://github.com/rudra1358/aurelia-cafe/blob/main/app/page.tsx"
click node_events_page "https://github.com/rudra1358/aurelia-cafe/blob/main/app/events/page.tsx"
click node_legal_pages "https://github.com/rudra1358/aurelia-cafe/blob/main/app/privacy-policy/page.tsx"
click node_navbar "https://github.com/rudra1358/aurelia-cafe/blob/main/components/Navbar.tsx"
click node_language "https://github.com/rudra1358/aurelia-cafe/blob/main/components/Language.tsx"
click node_menu "https://github.com/rudra1358/aurelia-cafe/blob/main/components/Menu.tsx"
click node_menu_data "https://github.com/rudra1358/aurelia-cafe/blob/main/data/menu.ts"
click node_events "https://github.com/rudra1358/aurelia-cafe/blob/main/components/Events.tsx"
click node_events_data "https://github.com/rudra1358/aurelia-cafe/blob/main/data/events.ts"
click node_site_config "https://github.com/rudra1358/aurelia-cafe/blob/main/data/site.ts"
click node_translations "https://github.com/rudra1358/aurelia-cafe/blob/main/data/translations.ts"
click node_reservation_form "https://github.com/rudra1358/aurelia-cafe/blob/main/components/Reservation.tsx"
click node_reservations_api "https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/reservations/route.ts"
click node_validation "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/validation.ts"
click node_rate_limit "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/rate-limit.ts"
click node_sheet_store "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/sheets.ts"
click node_mailer "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/mailer.ts"
click node_email_templates "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/email-templates.ts"
click node_manage_page "https://github.com/rudra1358/aurelia-cafe/blob/main/app/booking/%5Breference%5D/page.tsx"
click node_manage_form "https://github.com/rudra1358/aurelia-cafe/blob/main/components/ManageBooking.tsx"
click node_booking_api "https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/booking/route.ts"
click node_booking_token "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/booking-token.ts"
click node_notifications "https://github.com/rudra1358/aurelia-cafe/blob/main/lib/notifications.ts"
click node_notify_api "https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/notify/route.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_events_page,node_legal_pages,node_navbar,node_language toneBlue
class node_menu,node_menu_data,node_events,node_events_data,node_site_config,node_translations toneAmber
class node_reservation_form,node_reservations_api,node_manage_page,node_manage_form,node_booking_api,node_notify_api,node_whatsapp toneMint
class node_validation,node_rate_limit,node_sheet_store,node_mailer,node_email_templates,node_booking_token,node_notifications toneRose
class node_guest,node_owner,node_sheets_service,node_smtp toneIndigo
```

## Components

### Café Website

- [Home Page](https://github.com/rudra1358/aurelia-cafe/blob/main/app/page.tsx): `app/page.tsx`
- [Events Page](https://github.com/rudra1358/aurelia-cafe/blob/main/app/events/page.tsx): `app/events/page.tsx`
- [Legal Pages](https://github.com/rudra1358/aurelia-cafe/blob/main/app/privacy-policy/page.tsx): `app/privacy-policy/page.tsx`
- [Navigation](https://github.com/rudra1358/aurelia-cafe/blob/main/components/Navbar.tsx): `components/Navbar.tsx`
- [Language Switch](https://github.com/rudra1358/aurelia-cafe/blob/main/components/Language.tsx): `components/Language.tsx`

### Site Content

- [Menu](https://github.com/rudra1358/aurelia-cafe/blob/main/components/Menu.tsx): `components/Menu.tsx`
- [Menu Data](https://github.com/rudra1358/aurelia-cafe/blob/main/data/menu.ts): `data/menu.ts`
- [Events](https://github.com/rudra1358/aurelia-cafe/blob/main/components/Events.tsx): `components/Events.tsx`
- [Event Data](https://github.com/rudra1358/aurelia-cafe/blob/main/data/events.ts): `data/events.ts`
- [Café Settings](https://github.com/rudra1358/aurelia-cafe/blob/main/data/site.ts): `data/site.ts`
- [Translations](https://github.com/rudra1358/aurelia-cafe/blob/main/data/translations.ts): `data/translations.ts`

### Booking Workflows

- [Reservation Form](https://github.com/rudra1358/aurelia-cafe/blob/main/components/Reservation.tsx): `components/Reservation.tsx`
- [Reservation API](https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/reservations/route.ts): `app/api/reservations/route.ts`
- [Manage Booking Page](https://github.com/rudra1358/aurelia-cafe/blob/main/app/booking/%5Breference%5D/page.tsx): `app/booking/[reference]/page.tsx`
- [Change or Cancel](https://github.com/rudra1358/aurelia-cafe/blob/main/components/ManageBooking.tsx): `components/ManageBooking.tsx`
- [Booking API](https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/booking/route.ts): `app/api/booking/route.ts`
- [Notification API](https://github.com/rudra1358/aurelia-cafe/blob/main/app/api/notify/route.ts): `app/api/notify/route.ts`

### Booking Services

- [Reservation Validation](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/validation.ts): `lib/validation.ts`
- [Rate Limiting](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/rate-limit.ts): `lib/rate-limit.ts`
- [Google Sheets](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/sheets.ts): `lib/sheets.ts`
- [Email Delivery](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/mailer.ts): `lib/mailer.ts`
- [Email Templates](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/email-templates.ts): `lib/email-templates.ts`
- [Signed Booking Links](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/booking-token.ts): `lib/booking-token.ts`
- [Booking Notifications](https://github.com/rudra1358/aurelia-cafe/blob/main/lib/notifications.ts): `lib/notifications.ts`

### Other components

- **Guest**
- **Café Owner**
- **Apps Script Trigger**
- **Gmail SMTP**
- **WhatsApp Cloud API**

## Connections

- Guest → Home Page: browses
- Home Page → Menu: renders (evidence: `app/page.tsx`)
- Menu → Menu Data: reads (evidence: `components/Menu.tsx`)
- Home Page → Events: renders (evidence: `app/page.tsx`)
- Events Page → Events: renders (evidence: `app/events/page.tsx`)
- Events → Event Data: reads (evidence: `components/Events.tsx`)
- Home Page → Reservation Form: renders (evidence: `app/page.tsx`)
- Events → Reservation Form: prefills booking
- Guest → Reservation Form: submits request
- Reservation Form → Reservation Validation: validates (evidence: `components/Reservation.tsx`)
- Reservation Form → Reservation API: posts request
- Reservation API → Reservation Validation: revalidates (evidence: `app/api/reservations/route.ts`)
- Reservation API → Rate Limiting: checks limits (evidence: `app/api/reservations/route.ts`)
- Reservation API → Google Sheets: saves request (evidence: `app/api/reservations/route.ts`)
- Reservation API → Email Delivery: sends emails (evidence: `app/api/reservations/route.ts`)
- Email Delivery → Email Templates: renders (evidence: `lib/mailer.ts`)
- Email Delivery → Gmail SMTP: delivers via
- Gmail SMTP → Café Owner: alerts
- Gmail SMTP → Guest: acknowledges
- Café Owner → Google Sheets: updates status
- Google Sheets → Apps Script Trigger: triggers notification
- Apps Script Trigger → Notification API: calls
- Notification API → Booking Notifications: dispatches (evidence: `app/api/notify/route.ts`)
- Booking Notifications → Email Delivery: sends email (evidence: `lib/notifications.ts`)
- Booking Notifications → WhatsApp Cloud API: alerts optionally
- Gmail SMTP → Guest: confirms or reminds
- Guest → Manage Booking Page: opens signed link
- Manage Booking Page → Change or Cancel: renders (evidence: `app/booking/[reference]/page.tsx`)
- Change or Cancel → Booking API: requests change
- Booking API → Signed Booking Links: verifies link (evidence: `app/api/booking/route.ts`)
- Booking API → Google Sheets: reads and updates (evidence: `app/api/booking/route.ts`)
- Booking API → Booking Notifications: notifies guest (evidence: `app/api/booking/route.ts`)
- Navigation → Language Switch: uses switch (evidence: `components/Navbar.tsx`)
- Language Switch → Translations: translates interface (evidence: `components/Language.tsx`)
- Legal Pages → Café Settings: reads settings (evidence: `app/privacy-policy/page.tsx`)
