# jianleighqq/snapandsnack architecture

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

- Interactive diagram: https://gitdiagram.com/jianleighqq/snapandsnack
- Repository: https://github.com/jianleighqq/snapandsnack

## Overview

Snap & Snack is a web photo-booth and event-queue system. Guests register and wait; operators manage events and call guests to the booth; the booth captures and formats photos, which can be printed or published to personal and event galleries. The map includes documented intake, template, and hardware capabilities as well as the sampled runtime paths. Some route-to-screen wiring and implementation details are unsampled, so those relationships are omitted or marked as documented rather than inferred from module names.

Main entry points: [`components/booth/ShootConsole.tsx`](https://github.com/jianleighqq/snapandsnack/blob/main/components/booth/ShootConsole.tsx) (Shoot Console), [`lib/db.ts`](https://github.com/jianleighqq/snapandsnack/blob/main/lib/db.ts) (Data Access), [`app/api/gallery/route.ts`](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/gallery/route.ts) (Gallery API), [`lib/supabase-server.ts`](https://github.com/jianleighqq/snapandsnack/blob/main/lib/supabase-server.ts) (Supabase)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest Experience"]
  node_guest_registration["Guest Registration<br/>[route.ts]"]
  node_guest_status["Queue Status"]
  node_guest_gallery["Personal Gallery"]
  node_public_gallery["Event Gallery<br/>[page.tsx]"]
end

subgraph group_operations["Event Operations"]
  node_queue_board["Queue Board<br/>[QueueBoardView.tsx]"]
  node_event_setup["Event Setup<br/>[EventSetupView.tsx]"]
  node_template_management["Template Management<br/>[TemplatesTab.tsx]"]
  node_hardware_diagnostics["Hardware Diagnostics"]
end

subgraph group_booth["Booth &amp; Media"]
  node_booth_display["Booth Display"]
  node_shoot_console["Shoot Console<br/>[ShootConsole.tsx]"]
  node_template_renderer["Template Renderer"]
  node_hardware_adapter["Hardware Adapter<br/>[hardware.ts]"]
end

subgraph group_services["Application Services"]
  node_event_api["Event API<br/>[route.ts]"]
  node_queue_api["Queue API<br/>[route.ts]"]
  node_gallery_api["Gallery API<br/>[route.ts]"]
  node_media_upload["Media Upload<br/>[route.ts]"]
  node_print_api["Print API<br/>[route.ts]"]
  node_ui_primitives["UI Primitives"]
end

subgraph group_storage["Data &amp; Integrations"]
  node_db_layer["Data Access<br/>[db.ts]"]
  node_queue_engine["Queue Engine<br/>[queue.ts]"]
  node_supabase[("Supabase<br/>[supabase-server.ts]")]
  node_rate_limit["Rate Limiting<br/>[rate-limit.ts]"]
end

node_guest(("Guest"))
node_operator(("Operator"))

node_guest -->|"registers through"| node_guest_registration
node_guest -->|"checks status"| node_guest_status
node_guest -->|"views photos"| node_guest_gallery
node_operator -->|"manages queue"| node_queue_board
node_operator -->|"configures events"| node_event_setup
node_operator -->|"checks hardware"| node_hardware_diagnostics
node_queue_board -->|"calls guest"| node_shoot_console
node_booth_display -->|"shows attract screen"| node_operator
node_shoot_console -->|"renders layouts"| node_template_renderer
node_shoot_console -->|"uses hardware"| node_hardware_adapter
node_shoot_console -->|"publishes memories"| node_guest_gallery
node_shoot_console -.->|"uploads media"| node_media_upload
node_shoot_console -.->|"requests printing"| node_print_api
node_event_setup -.->|"manages events"| node_event_api
node_event_setup -->|"configures templates"| node_template_management
node_guest_registration -->|"adds guest"| node_queue_engine
node_guest_registration -->|"stores intake"| node_supabase
node_event_api -->|"reads events"| node_db_layer
node_queue_api -->|"updates queue"| node_db_layer
node_gallery_api -->|"saves gallery"| node_db_layer
node_gallery_api -->|"queries media"| node_supabase
node_gallery_api -->|"limits requests"| node_rate_limit
node_db_layer -->|"applies transitions"| node_queue_engine
node_db_layer -->|"reads and writes"| node_supabase
node_media_upload -->|"stores assets"| node_supabase
node_print_api -->|"reads print data"| node_db_layer
node_public_gallery -->|"loads event gallery"| node_gallery_api
node_guest_gallery -->|"loads guest gallery"| node_gallery_api
node_queue_board -->|"renders controls"| node_ui_primitives

click node_guest_registration "https://github.com/jianleighqq/snapandsnack/blob/main/app/api/intake/route.ts"
click node_guest_status "https://github.com/jianleighqq/snapandsnack/blob/main/components/guest/GuestStatusView.tsx"
click node_guest_gallery "https://github.com/jianleighqq/snapandsnack/blob/main/components/guest/GuestGalleryView.tsx"
click node_public_gallery "https://github.com/jianleighqq/snapandsnack/blob/main/app/(admin)/admin/gallery/page.tsx"
click node_queue_board "https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/QueueBoardView.tsx"
click node_event_setup "https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/setup/EventSetupView.tsx"
click node_template_management "https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/setup/TemplatesTab.tsx"
click node_hardware_diagnostics "https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/setup/HardwareStatusPanel.tsx"
click node_booth_display "https://github.com/jianleighqq/snapandsnack/blob/main/components/booth/BoothAttractScreen.tsx"
click node_shoot_console "https://github.com/jianleighqq/snapandsnack/blob/main/components/booth/ShootConsole.tsx"
click node_template_renderer "https://github.com/jianleighqq/snapandsnack/blob/main/lib/template-builder.ts"
click node_hardware_adapter "https://github.com/jianleighqq/snapandsnack/blob/main/lib/hardware.ts"
click node_event_api "https://github.com/jianleighqq/snapandsnack/blob/main/app/api/events/route.ts"
click node_queue_api "https://github.com/jianleighqq/snapandsnack/blob/main/app/api/queue/route.ts"
click node_gallery_api "https://github.com/jianleighqq/snapandsnack/blob/main/app/api/gallery/route.ts"
click node_media_upload "https://github.com/jianleighqq/snapandsnack/blob/main/app/api/media/upload/route.ts"
click node_print_api "https://github.com/jianleighqq/snapandsnack/blob/main/app/api/print/route.ts"
click node_db_layer "https://github.com/jianleighqq/snapandsnack/blob/main/lib/db.ts"
click node_queue_engine "https://github.com/jianleighqq/snapandsnack/blob/main/lib/queue.ts"
click node_supabase "https://github.com/jianleighqq/snapandsnack/blob/main/lib/supabase-server.ts"
click node_rate_limit "https://github.com/jianleighqq/snapandsnack/blob/main/lib/rate-limit.ts"
click node_ui_primitives "https://github.com/jianleighqq/snapandsnack/tree/main/components/ui"

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_guest_registration,node_guest_status,node_guest_gallery,node_public_gallery toneBlue
class node_queue_board,node_event_setup,node_template_management,node_hardware_diagnostics toneAmber
class node_booth_display,node_shoot_console,node_template_renderer,node_hardware_adapter toneMint
class node_event_api,node_queue_api,node_gallery_api,node_media_upload,node_print_api,node_ui_primitives toneRose
class node_db_layer,node_queue_engine,node_supabase,node_rate_limit,node_guest,node_operator toneIndigo
```

## Components

### Guest Experience

- [Guest Registration](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/intake/route.ts): `app/api/intake/route.ts`
- [Queue Status](https://github.com/jianleighqq/snapandsnack/blob/main/components/guest/GuestStatusView.tsx): `components/guest/GuestStatusView.tsx`
- [Personal Gallery](https://github.com/jianleighqq/snapandsnack/blob/main/components/guest/GuestGalleryView.tsx): `components/guest/GuestGalleryView.tsx`
- [Event Gallery](https://github.com/jianleighqq/snapandsnack/blob/main/app/(admin)/admin/gallery/page.tsx): `app/(admin)/admin/gallery/page.tsx`

### Event Operations

- [Queue Board](https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/QueueBoardView.tsx): `components/admin/QueueBoardView.tsx`
- [Event Setup](https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/setup/EventSetupView.tsx): `components/admin/setup/EventSetupView.tsx`
- [Template Management](https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/setup/TemplatesTab.tsx): `components/admin/setup/TemplatesTab.tsx`
- [Hardware Diagnostics](https://github.com/jianleighqq/snapandsnack/blob/main/components/admin/setup/HardwareStatusPanel.tsx): `components/admin/setup/HardwareStatusPanel.tsx`

### Booth & Media

- [Booth Display](https://github.com/jianleighqq/snapandsnack/blob/main/components/booth/BoothAttractScreen.tsx): `components/booth/BoothAttractScreen.tsx`
- [Shoot Console](https://github.com/jianleighqq/snapandsnack/blob/main/components/booth/ShootConsole.tsx): `components/booth/ShootConsole.tsx`
- [Template Renderer](https://github.com/jianleighqq/snapandsnack/blob/main/lib/template-builder.ts): `lib/template-builder.ts`
- [Hardware Adapter](https://github.com/jianleighqq/snapandsnack/blob/main/lib/hardware.ts): `lib/hardware.ts`

### Application Services

- [Event API](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/events/route.ts): `app/api/events/route.ts`
- [Queue API](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/queue/route.ts): `app/api/queue/route.ts`
- [Gallery API](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/gallery/route.ts): `app/api/gallery/route.ts`
- [Media Upload](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/media/upload/route.ts): `app/api/media/upload/route.ts`
- [Print API](https://github.com/jianleighqq/snapandsnack/blob/main/app/api/print/route.ts): `app/api/print/route.ts`
- [UI Primitives](https://github.com/jianleighqq/snapandsnack/tree/main/components/ui): `components/ui`

### Data & Integrations

- [Data Access](https://github.com/jianleighqq/snapandsnack/blob/main/lib/db.ts): `lib/db.ts`
- [Queue Engine](https://github.com/jianleighqq/snapandsnack/blob/main/lib/queue.ts): `lib/queue.ts`
- [Supabase](https://github.com/jianleighqq/snapandsnack/blob/main/lib/supabase-server.ts): `lib/supabase-server.ts`
- [Rate Limiting](https://github.com/jianleighqq/snapandsnack/blob/main/lib/rate-limit.ts): `lib/rate-limit.ts`

### Other components

- **Guest**
- **Operator**

## Connections

- Guest → Guest Registration: registers through (evidence: `README.md`)
- Guest → Queue Status: checks status (evidence: `README.md`)
- Guest → Personal Gallery: views photos (evidence: `README.md`)
- Operator → Queue Board: manages queue (evidence: `README.md`)
- Operator → Event Setup: configures events (evidence: `README.md`)
- Operator → Hardware Diagnostics: checks hardware (evidence: `README.md`)
- Queue Board → Shoot Console: calls guest (evidence: `README.md`)
- Booth Display → Operator: shows attract screen (evidence: `README.md`)
- Shoot Console → Template Renderer: renders layouts (evidence: `components/booth/ShootConsole.tsx`)
- Shoot Console → Hardware Adapter: uses hardware (evidence: `components/booth/ShootConsole.tsx`)
- Shoot Console → Personal Gallery: publishes memories (evidence: `README.md`)
- Shoot Console → Media Upload: uploads media
- Shoot Console → Print API: requests printing
- Event Setup → Event API: manages events
- Event Setup → Template Management: configures templates (evidence: `README.md`)
- Guest Registration → Queue Engine: adds guest (evidence: `README.md`)
- Guest Registration → Supabase: stores intake (evidence: `app/api/intake/route.ts`)
- Event API → Data Access: reads events (evidence: `app/api/events/route.ts`)
- Queue API → Data Access: updates queue (evidence: `app/api/queue/route.ts`)
- Gallery API → Data Access: saves gallery (evidence: `app/api/gallery/route.ts`)
- Gallery API → Supabase: queries media (evidence: `app/api/gallery/route.ts`)
- Gallery API → Rate Limiting: limits requests (evidence: `app/api/gallery/route.ts`)
- Data Access → Queue Engine: applies transitions (evidence: `lib/db.ts`)
- Data Access → Supabase: reads and writes (evidence: `lib/db.ts`)
- Media Upload → Supabase: stores assets (evidence: `app/api/media/upload/route.ts`)
- Print API → Data Access: reads print data (evidence: `app/api/print/route.ts`)
- Event Gallery → Gallery API: loads event gallery (evidence: `app/(admin)/admin/gallery/page.tsx`)
- Personal Gallery → Gallery API: loads guest gallery (evidence: `README.md`)
- Queue Board → UI Primitives: renders controls (evidence: `components/admin/QueueBoardView.tsx`)
