# sakhr-ai/majd-wedding architecture

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

- Interactive diagram: https://gitdiagram.com/sakhr-ai/majd-wedding
- Repository: https://github.com/sakhr-ai/majd-wedding

## Overview

Spark is a wedding-invitation web app. Guests view the invitation and event details, save the date or navigate to the venue, then submit an RSVP and optionally leave a wish; RSVP totals and wishes are queried from Supabase. The main route composes the invitation sections, while shared invitation data and guestbook validation/query logic support those experiences. The graph also shows the router, SSR entry points, and preview-auth storage. Some components and server setup are unsampled, so their connections are included only where the index or excerpts support them.

Main entry points: [`src/routes/index.tsx`](https://github.com/sakhr-ai/majd-wedding/blob/main/src/routes/index.tsx) (Invitation page), [`src/integrations/supabase/client.ts`](https://github.com/sakhr-ai/majd-wedding/blob/main/src/integrations/supabase/client.ts) (Supabase client), [`src/components/invite/Rsvp.tsx`](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Rsvp.tsx) (RSVP form), [`src/components/invite/Wishes.tsx`](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Wishes.tsx) (Wishes guestbook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest experience"]
  node_home["Invitation page<br/>[index.tsx]"]
  node_details["Invitation details<br/>[invitation.ts]"]
  node_countdown["Countdown<br/>[Countdown.tsx]"]
  node_save["Save date<br/>[SaveTheDate.tsx]"]
  node_nav["Invitation navigation<br/>[BottomNav.tsx]"]
  node_rsvp["RSVP form<br/>[Rsvp.tsx]"]
  node_wishes["Wishes guestbook<br/>[Wishes.tsx]"]
  node_reveal["Reveal effects<br/>[Reveal.tsx]"]
end

subgraph group_data["Guestbook data"]
  node_guestbook["Guestbook queries<br/>[guestbook.ts]"]
  node_supabase["Supabase client<br/>[client.ts]"]
  node_preview["Preview auth storage"]
  node_backend[("Supabase backend")]
end

subgraph group_platform["App runtime"]
  node_router["Router setup<br/>[router.tsx]"]
  node_route_tree["Generated route tree<br/>[routeTree.gen.ts]"]
  node_root["Root route<br/>[__root.tsx]"]
  node_start["Start entry<br/>[start.ts]"]
  node_server["SSR server<br/>[server.ts]"]
  node_error_capture["Error capture<br/>[error-capture.ts]"]
  node_error_page["Error page<br/>[error-page.ts]"]
end

node_guest(("Guest"))
node_calendar["Google Calendar"]
node_maps["Map service"]

node_guest -->|"opens"| node_home
node_home -->|"reads details"| node_details
node_home -->|"renders"| node_countdown
node_home -->|"renders"| node_save
node_home -->|"renders"| node_nav
node_home -->|"renders"| node_rsvp
node_home -->|"renders"| node_wishes
node_home -->|"renders"| node_reveal
node_countdown -->|"reads event date"| node_details
node_save -->|"reads event info"| node_details
node_rsvp -->|"validates and queries"| node_guestbook
node_wishes -->|"validates and queries"| node_guestbook
node_rsvp -->|"writes RSVP"| node_supabase
node_wishes -->|"reads and writes wishes"| node_supabase
node_guestbook -->|"queries totals and wishes"| node_supabase
node_supabase -->|"sends requests"| node_backend
node_supabase -->|"configures auth storage"| node_preview
node_home -->|"links to calendar"| node_calendar
node_home -->|"embeds venue map"| node_maps
node_router -->|"uses routes"| node_route_tree
node_route_tree -->|"registers route"| node_home
node_route_tree -->|"registers root"| node_root
node_root -.->|"hosts route"| node_home
node_start -->|"uses error page"| node_error_page
node_start -->|"attaches capture"| node_error_capture
node_server -->|"consumes captured error"| node_error_capture
node_server -->|"renders failures"| node_error_page

click node_home "https://github.com/sakhr-ai/majd-wedding/blob/main/src/routes/index.tsx"
click node_details "https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/invitation.ts"
click node_countdown "https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Countdown.tsx"
click node_save "https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/SaveTheDate.tsx"
click node_nav "https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/BottomNav.tsx"
click node_rsvp "https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Rsvp.tsx"
click node_wishes "https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Wishes.tsx"
click node_reveal "https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Reveal.tsx"
click node_guestbook "https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/guestbook.ts"
click node_supabase "https://github.com/sakhr-ai/majd-wedding/blob/main/src/integrations/supabase/client.ts"
click node_preview "https://github.com/sakhr-ai/majd-wedding/blob/main/src/integrations/supabase/previewAuthStorage.ts"
click node_router "https://github.com/sakhr-ai/majd-wedding/blob/main/src/router.tsx"
click node_route_tree "https://github.com/sakhr-ai/majd-wedding/blob/main/src/routeTree.gen.ts"
click node_root "https://github.com/sakhr-ai/majd-wedding/blob/main/src/routes/__root.tsx"
click node_start "https://github.com/sakhr-ai/majd-wedding/blob/main/src/start.ts"
click node_server "https://github.com/sakhr-ai/majd-wedding/blob/main/src/server.ts"
click node_error_capture "https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/error-capture.ts"
click node_error_page "https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/error-page.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_details,node_countdown,node_save,node_nav,node_rsvp,node_wishes,node_reveal toneBlue
class node_guestbook,node_supabase,node_preview,node_backend toneAmber
class node_router,node_route_tree,node_root,node_start,node_server,node_error_capture,node_error_page toneMint
class node_guest,node_calendar,node_maps toneIndigo
```

## Components

### Guest experience

- [Invitation page](https://github.com/sakhr-ai/majd-wedding/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Invitation details](https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/invitation.ts): `src/lib/invitation.ts`
- [Countdown](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Countdown.tsx): `src/components/invite/Countdown.tsx`
- [Save date](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/SaveTheDate.tsx): `src/components/invite/SaveTheDate.tsx`
- [Invitation navigation](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/BottomNav.tsx): `src/components/invite/BottomNav.tsx`
- [RSVP form](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Rsvp.tsx): `src/components/invite/Rsvp.tsx`
- [Wishes guestbook](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Wishes.tsx): `src/components/invite/Wishes.tsx`
- [Reveal effects](https://github.com/sakhr-ai/majd-wedding/blob/main/src/components/invite/Reveal.tsx): `src/components/invite/Reveal.tsx`

### Guestbook data

- [Guestbook queries](https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/guestbook.ts): `src/lib/guestbook.ts`
- [Supabase client](https://github.com/sakhr-ai/majd-wedding/blob/main/src/integrations/supabase/client.ts): `src/integrations/supabase/client.ts`
- [Preview auth storage](https://github.com/sakhr-ai/majd-wedding/blob/main/src/integrations/supabase/previewAuthStorage.ts): `src/integrations/supabase/previewAuthStorage.ts`
- **Supabase backend**

### App runtime

- [Router setup](https://github.com/sakhr-ai/majd-wedding/blob/main/src/router.tsx): `src/router.tsx`
- [Generated route tree](https://github.com/sakhr-ai/majd-wedding/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Root route](https://github.com/sakhr-ai/majd-wedding/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Start entry](https://github.com/sakhr-ai/majd-wedding/blob/main/src/start.ts): `src/start.ts`
- [SSR server](https://github.com/sakhr-ai/majd-wedding/blob/main/src/server.ts): `src/server.ts`
- [Error capture](https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Error page](https://github.com/sakhr-ai/majd-wedding/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`

### Other components

- **Guest**
- **Google Calendar**
- **Map service**

## Connections

- Guest → Invitation page: opens (evidence: `src/routes/index.tsx`)
- Invitation page → Invitation details: reads details (evidence: `src/routes/index.tsx`)
- Invitation page → Countdown: renders (evidence: `src/routes/index.tsx`)
- Invitation page → Save date: renders (evidence: `src/routes/index.tsx`)
- Invitation page → Invitation navigation: renders (evidence: `src/routes/index.tsx`)
- Invitation page → RSVP form: renders (evidence: `src/routes/index.tsx`)
- Invitation page → Wishes guestbook: renders (evidence: `src/routes/index.tsx`)
- Invitation page → Reveal effects: renders (evidence: `src/routes/index.tsx`)
- Countdown → Invitation details: reads event date (evidence: `src/components/invite/Countdown.tsx`)
- Save date → Invitation details: reads event info (evidence: `src/components/invite/SaveTheDate.tsx`)
- RSVP form → Guestbook queries: validates and queries (evidence: `src/components/invite/Rsvp.tsx`)
- Wishes guestbook → Guestbook queries: validates and queries (evidence: `src/components/invite/Wishes.tsx`)
- RSVP form → Supabase client: writes RSVP (evidence: `src/components/invite/Rsvp.tsx`)
- Wishes guestbook → Supabase client: reads and writes wishes (evidence: `src/components/invite/Wishes.tsx`)
- Guestbook queries → Supabase client: queries totals and wishes (evidence: `src/lib/guestbook.ts`)
- Supabase client → Supabase backend: sends requests (evidence: `src/integrations/supabase/client.ts`)
- Supabase client → Preview auth storage: configures auth storage (evidence: `src/integrations/supabase/client.ts`)
- Invitation page → Google Calendar: links to calendar
- Invitation page → Map service: embeds venue map (evidence: `src/routes/index.tsx`)
- Router setup → Generated route tree: uses routes (evidence: `src/router.tsx`)
- Generated route tree → Invitation page: registers route (evidence: `src/routeTree.gen.ts`)
- Generated route tree → Root route: registers root (evidence: `src/routeTree.gen.ts`)
- Root route → Invitation page: hosts route
- Start entry → Error page: uses error page (evidence: `src/start.ts`)
- Start entry → Error capture: attaches capture (evidence: `src/start.ts`)
- SSR server → Error capture: consumes captured error (evidence: `src/server.ts`)
- SSR server → Error page: renders failures (evidence: `src/server.ts`)
