# sjm176/sophie-keith-rsvp architecture

> Architecture diagram of the GitHub repository sjm176/sophie-keith-rsvp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sjm176/sophie-keith-rsvp
- Repository: https://github.com/sjm176/sophie-keith-rsvp

## Overview

This appears to be a wedding RSVP site with guest response collection and a password-protected RSVP dashboard. The sampled code confirms submission, storage, notification, authentication, and statistics behavior; page markup was not sampled, so links from the pages to their handlers are omitted where unverified.

Main entry points: [`src/lib/store.ts`](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/store.ts) (RSVP store), [`src/middleware.ts`](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/middleware.ts) (Access middleware), [`src/pages/api/rsvp.ts`](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/rsvp.ts) (RSVP handler), [`src/lib/notify.ts`](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/notify.ts) (Email notification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_site["Wedding site"]
  node_home["Wedding page<br/>[index.astro]"]
  node_wedding["Wedding details<br/>[wedding.ts]"]
end

subgraph group_rsvp["Guest responses"]
  node_rsvp_api["RSVP handler<br/>[rsvp.ts]"]
  node_store["RSVP store<br/>[store.ts]"]
  node_notify["Email notification<br/>[notify.ts]"]
end

subgraph group_admin["Dashboard access"]
  node_login_page["Login page<br/>[login.astro]"]
  node_login_api["Login handler<br/>[login.ts]"]
  node_auth["Session signing<br/>[auth.ts]"]
  node_middleware["Access middleware<br/>[middleware.ts]"]
  node_dashboard["RSVP dashboard<br/>[dashboard.astro]"]
  node_stats_api["Statistics handler<br/>[stats.ts]"]
  node_logout_api["Logout handler<br/>[logout.ts]"]
end

subgraph group_services["External services"]
  node_redis[("RSVP records")]
  node_formspree["Formspree"]
end

node_guest(("Guest"))

node_guest -->|"visits"| node_home
node_rsvp_api -->|"saves RSVP"| node_store
node_store -->|"writes"| node_redis
node_rsvp_api -->|"forwards copy"| node_notify
node_notify -.->|"sends notification"| node_formspree
node_login_api -->|"creates token"| node_auth
node_middleware -->|"validates token"| node_auth
node_middleware -->|"protects"| node_dashboard
node_middleware -->|"protects"| node_stats_api
node_stats_api -->|"reads and aggregates"| node_store
node_store -->|"reads records"| node_redis
node_guest -->|"visits"| node_login_page
node_guest -->|"submits password"| node_login_api
node_guest -->|"requests logout"| node_logout_api

click node_home "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/index.astro"
click node_wedding "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/data/wedding.ts"
click node_rsvp_api "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/rsvp.ts"
click node_store "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/store.ts"
click node_notify "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/notify.ts"
click node_login_page "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/login.astro"
click node_login_api "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/login.ts"
click node_auth "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/auth.ts"
click node_middleware "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/middleware.ts"
click node_dashboard "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/dashboard.astro"
click node_stats_api "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/stats.ts"
click node_logout_api "https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/logout.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_wedding toneBlue
class node_rsvp_api,node_store,node_notify toneAmber
class node_login_page,node_login_api,node_auth,node_middleware,node_dashboard,node_stats_api,node_logout_api toneMint
class node_redis,node_formspree toneRose
class node_guest toneIndigo
```

## Components

### Wedding site

- [Wedding page](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/index.astro): `src/pages/index.astro`
- [Wedding details](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/data/wedding.ts): `src/data/wedding.ts`

### Guest responses

- [RSVP handler](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/rsvp.ts): `src/pages/api/rsvp.ts`
- [RSVP store](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/store.ts): `src/lib/store.ts`
- [Email notification](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/notify.ts): `src/lib/notify.ts`

### Dashboard access

- [Login page](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/login.astro): `src/pages/login.astro`
- [Login handler](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/login.ts): `src/pages/api/login.ts`
- [Session signing](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Access middleware](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/middleware.ts): `src/middleware.ts`
- [RSVP dashboard](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/dashboard.astro): `src/pages/dashboard.astro`
- [Statistics handler](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/stats.ts): `src/pages/api/stats.ts`
- [Logout handler](https://github.com/sjm176/sophie-keith-rsvp/blob/main/src/pages/api/logout.ts): `src/pages/api/logout.ts`

### External services

- **RSVP records**
- **Formspree**

### Other components

- **Guest**

## Connections

- Guest → Wedding page: visits
- RSVP handler → RSVP store: saves RSVP
- RSVP store → RSVP records: writes
- RSVP handler → Email notification: forwards copy
- Email notification → Formspree: sends notification
- Login handler → Session signing: creates token
- Access middleware → Session signing: validates token
- Access middleware → RSVP dashboard: protects
- Access middleware → Statistics handler: protects
- Statistics handler → RSVP store: reads and aggregates
- RSVP store → RSVP records: reads records
- Guest → Login page: visits
- Guest → Login handler: submits password
- Guest → Logout handler: requests logout
