# itoohealth/frontend-waitlist architecture

> Architecture diagram of the GitHub repository itoohealth/frontend-waitlist, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/itoohealth/frontend-waitlist
- Repository: https://github.com/itoohealth/frontend-waitlist

## Overview

iTOO is a vision-care waitlist site: visitors review the landing page, submit their details (optionally with a referral code), and are directed to a success page with their referral code and queue position. The API validates and stores registrations; admin routes expose waitlist statistics and CSV export. Landing-page composition and registration calls are evidenced in excerpts. Admin-page wiring and the success page’s internal behavior were not sampled, so those relationships are left unverified.

Main entry points: [`src/app/page.tsx`](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/page.tsx) (Landing page), [`src/db/index.ts`](https://github.com/itoohealth/frontend-waitlist/blob/main/src/db/index.ts) (Database client), [`src/app/components/Form.tsx`](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Form.tsx) (Signup form), [`src/app/admin/page.tsx`](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/admin/page.tsx) (Admin page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public_site["Public site"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_hero["Hero section<br/>[Hero.tsx]"]
  node_overview["Overview section<br/>[Overview.tsx]"]
  node_features["Features section<br/>[Features.tsx]"]
  node_steps["Waitlist steps<br/>[WaitlistSteps.tsx]"]
  node_footer["Footer CTA<br/>[FooterCTA.tsx]"]
  node_animations["Fade animations<br/>[animations.tsx]"]
end

subgraph group_registration["Waitlist registration"]
  node_form["Signup form<br/>[Form.tsx]"]
  node_success["Success page<br/>[page.tsx]"]
  node_signup_api["Signup API<br/>[route.ts]"]
end

subgraph group_administration["Waitlist administration"]
  node_admin["Admin page<br/>[page.tsx]"]
  node_admin_api["Waitlist API<br/>[route.ts]"]
  node_export_api["CSV export API<br/>[route.ts]"]
end

subgraph group_persistence["Persistence"]
  node_db_client["Database client<br/>[index.ts]"]
  node_waitlist_schema["Waitlist schema<br/>[schema.ts]"]
end

node_visitor(("Visitor"))
node_neon[("Neon PostgreSQL")]
node_admin_user(("Admin"))

node_visitor -->|"visits"| node_landing
node_landing -->|"renders"| node_navbar
node_landing -->|"renders"| node_hero
node_landing -->|"renders"| node_overview
node_landing -->|"renders"| node_features
node_landing -->|"renders"| node_steps
node_landing -->|"renders"| node_footer
node_landing -->|"wraps sections"| node_animations
node_hero -->|"renders"| node_form
node_form -->|"POSTs signup"| node_signup_api
node_form -->|"redirects with details"| node_success
node_signup_api -->|"queries and inserts"| node_db_client
node_db_client -->|"configures ORM"| node_waitlist_schema
node_db_client -->|"connects"| node_neon
node_admin_user -.->|"opens"| node_admin
node_admin -.->|"requests entries"| node_admin_api
node_admin -.->|"requests export"| node_export_api
node_admin_api -->|"reads entries"| node_db_client
node_export_api -->|"reads entries"| node_db_client

click node_landing "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/page.tsx"
click node_navbar "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Navbar.tsx"
click node_hero "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Hero.tsx"
click node_form "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Form.tsx"
click node_overview "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Overview.tsx"
click node_features "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Features.tsx"
click node_steps "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/WaitlistSteps.tsx"
click node_footer "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/FooterCTA.tsx"
click node_animations "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/animations.tsx"
click node_success "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/success/page.tsx"
click node_signup_api "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/api/waitlist/route.ts"
click node_admin "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/admin/page.tsx"
click node_admin_api "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/api/admin/waitlist/route.ts"
click node_export_api "https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/api/admin/export-csv/route.ts"
click node_db_client "https://github.com/itoohealth/frontend-waitlist/blob/main/src/db/index.ts"
click node_waitlist_schema "https://github.com/itoohealth/frontend-waitlist/blob/main/src/db/schema.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_landing,node_navbar,node_hero,node_overview,node_features,node_steps,node_footer,node_animations toneBlue
class node_form,node_success,node_signup_api,node_neon toneAmber
class node_admin,node_admin_api,node_export_api toneMint
class node_db_client,node_waitlist_schema toneRose
class node_visitor,node_admin_user toneIndigo
```

## Components

### Public site

- [Landing page](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Navigation](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Navbar.tsx): `src/app/components/Navbar.tsx`
- [Hero section](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Hero.tsx): `src/app/components/Hero.tsx`
- [Overview section](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Overview.tsx): `src/app/components/Overview.tsx`
- [Features section](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Features.tsx): `src/app/components/Features.tsx`
- [Waitlist steps](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/WaitlistSteps.tsx): `src/app/components/WaitlistSteps.tsx`
- [Footer CTA](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/FooterCTA.tsx): `src/app/components/FooterCTA.tsx`
- [Fade animations](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/animations.tsx): `src/app/components/animations.tsx`

### Waitlist registration

- [Signup form](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/components/Form.tsx): `src/app/components/Form.tsx`
- [Success page](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/success/page.tsx): `src/app/success/page.tsx`
- [Signup API](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/api/waitlist/route.ts): `src/app/api/waitlist/route.ts`

### Waitlist administration

- [Admin page](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Waitlist API](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/api/admin/waitlist/route.ts): `src/app/api/admin/waitlist/route.ts`
- [CSV export API](https://github.com/itoohealth/frontend-waitlist/blob/main/src/app/api/admin/export-csv/route.ts): `src/app/api/admin/export-csv/route.ts`

### Persistence

- [Database client](https://github.com/itoohealth/frontend-waitlist/blob/main/src/db/index.ts): `src/db/index.ts`
- [Waitlist schema](https://github.com/itoohealth/frontend-waitlist/blob/main/src/db/schema.ts): `src/db/schema.ts`

### Other components

- **Visitor**
- **Neon PostgreSQL**
- **Admin**

## Connections

- Visitor → Landing page: visits (evidence: `src/app/page.tsx`)
- Landing page → Navigation: renders (evidence: `src/app/page.tsx`)
- Landing page → Hero section: renders (evidence: `src/app/page.tsx`)
- Landing page → Overview section: renders (evidence: `src/app/page.tsx`)
- Landing page → Features section: renders (evidence: `src/app/page.tsx`)
- Landing page → Waitlist steps: renders (evidence: `src/app/page.tsx`)
- Landing page → Footer CTA: renders (evidence: `src/app/page.tsx`)
- Landing page → Fade animations: wraps sections (evidence: `src/app/page.tsx`)
- Hero section → Signup form: renders (evidence: `src/app/components/Hero.tsx`)
- Signup form → Signup API: POSTs signup (evidence: `src/app/components/Form.tsx`)
- Signup form → Success page: redirects with details (evidence: `src/app/components/Form.tsx`)
- Signup API → Database client: queries and inserts (evidence: `src/app/api/waitlist/route.ts`)
- Database client → Waitlist schema: configures ORM (evidence: `src/db/index.ts`)
- Database client → Neon PostgreSQL: connects (evidence: `src/db/index.ts`)
- Admin → Admin page: opens
- Admin page → Waitlist API: requests entries
- Admin page → CSV export API: requests export
- Waitlist API → Database client: reads entries (evidence: `src/app/api/admin/waitlist/route.ts`)
- CSV export API → Database client: reads entries (evidence: `src/app/api/admin/export-csv/route.ts`)
