# damarlanandu2005-jpg/eventsnap architecture

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

- Interactive diagram: https://gitdiagram.com/damarlanandu2005-jpg/eventsnap
- Repository: https://github.com/damarlanandu2005-jpg/eventsnap

## Overview

EventSnap appears to be an event-photo discovery and delivery product with photographer and admin workflows. The central guest journey is event discovery, selfie submission, face matching, and viewing or downloading matched photos. Photographer upload and face-indexing form a separate operational path. The README is still the uncustomized Next.js starter, so capability details come mainly from the file tree and sampled code; edges are limited to shown imports, calls, or navigation.

Main entry points: [`pages/api/cron/process-queue.js`](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/cron/process-queue.js) (Queue processor), [`pages/api/scan.js`](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/scan.js) (Face scan API), [`lib/face/index.js`](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/index.js) (Face provider), [`lib/supabase.js`](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/supabase.js) (Supabase data and storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guest["Guest discovery"]
  node_home["Event discovery<br/>[index.js]"]
  node_event["Event page<br/>[&#91;slug&#93;.js]"]
  node_selfie["Selfie capture<br/>[SelfieUploader.js]"]
  node_scan["Face scan API<br/>[scan.js]"]
  node_results["Match results<br/>[&#91;sessionId&#93;.js]"]
  node_downloads["Photo downloads<br/>[zip.js]"]
end

subgraph group_photographer["Photographer operations"]
  node_photographer(("Photographer"))
  node_studio["Photographer portal<br/>[index.js]"]
  node_upload["Photo upload APIs"]
  node_admin["Admin operations"]
end

subgraph group_processing["Photo processing"]
  node_queue["Queue processor<br/>[process-queue.js]"]
  node_face["Face provider<br/>[index.js]"]
  node_image["Image preparation<br/>[image.js]"]
  node_awsface["AWS Rekognition<br/>[aws.js]"]
  node_insightface["InsightFace provider<br/>[insightface.js]"]
end

subgraph group_platform["Platform services"]
  node_auth["Account auth<br/>[auth.js]"]
  node_supabase[("Supabase data and storage<br/>[supabase.js]")]
  node_r2[("R2 object storage<br/>[r2.js]")]
  node_redis[("Redis cache<br/>[redis.js]")]
  node_pricing["Pricing rules<br/>[pricing.js]"]
end

node_guest(("Photo seeker"))

node_guest -->|"browses"| node_home
node_home -->|"opens event"| node_event
node_event -->|"renders"| node_selfie
node_guest -.->|"submits selfie"| node_scan
node_scan -->|"searches faces"| node_face
node_scan -->|"reads event photos"| node_supabase
node_scan -->|"checks cache"| node_redis
node_guest -.->|"views matches"| node_results
node_guest -.->|"requests archive"| node_downloads
node_photographer -.->|"manages events"| node_studio
node_studio -->|"uses plans"| node_pricing
node_photographer -.->|"uploads photos"| node_upload
node_photographer -.->|"administers events"| node_admin
node_queue -->|"claims and updates"| node_supabase
node_queue -->|"downloads originals"| node_r2
node_queue -->|"indexes faces"| node_face
node_queue -->|"prepares images"| node_image
node_face -->|"selects provider"| node_awsface
node_face -->|"selects provider"| node_insightface
node_awsface -->|"normalizes images"| node_image
node_auth -->|"verifies users"| node_supabase

click node_home "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/index.js"
click node_event "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/event/%5Bslug%5D.js"
click node_selfie "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/components/SelfieUploader.js"
click node_scan "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/scan.js"
click node_results "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/results/%5BsessionId%5D.js"
click node_downloads "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/download/zip.js"
click node_studio "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/photographer/index.js"
click node_auth "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/auth.js"
click node_upload "https://github.com/damarlanandu2005-jpg/eventsnap/tree/main/pages/api/photographer"
click node_admin "https://github.com/damarlanandu2005-jpg/eventsnap/tree/main/pages/admin"
click node_queue "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/cron/process-queue.js"
click node_face "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/index.js"
click node_image "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/image.js"
click node_awsface "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/aws.js"
click node_insightface "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/insightface.js"
click node_supabase "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/supabase.js"
click node_r2 "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/r2.js"
click node_redis "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/redis.js"
click node_pricing "https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/pricing.js"

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_event,node_selfie,node_scan,node_results,node_downloads toneBlue
class node_photographer,node_studio,node_upload,node_admin toneAmber
class node_queue,node_face,node_image,node_awsface,node_insightface toneMint
class node_auth,node_supabase,node_r2,node_redis,node_pricing toneRose
class node_guest toneIndigo
```

## Components

### Guest discovery

- [Event discovery](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/index.js): `pages/index.js`
- [Event page](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/event/%5Bslug%5D.js): `pages/event/[slug].js`
- [Selfie capture](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/components/SelfieUploader.js): `components/SelfieUploader.js`
- [Face scan API](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/scan.js): `pages/api/scan.js`
- [Match results](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/results/%5BsessionId%5D.js): `pages/results/[sessionId].js`
- [Photo downloads](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/download/zip.js): `pages/api/download/zip.js`

### Photographer operations

- **Photographer**
- [Photographer portal](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/photographer/index.js): `pages/photographer/index.js`
- [Photo upload APIs](https://github.com/damarlanandu2005-jpg/eventsnap/tree/main/pages/api/photographer): `pages/api/photographer`
- [Admin operations](https://github.com/damarlanandu2005-jpg/eventsnap/tree/main/pages/admin): `pages/admin`

### Photo processing

- [Queue processor](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/pages/api/cron/process-queue.js): `pages/api/cron/process-queue.js`
- [Face provider](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/index.js): `lib/face/index.js`
- [Image preparation](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/image.js): `lib/face/image.js`
- [AWS Rekognition](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/aws.js): `lib/face/aws.js`
- [InsightFace provider](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/face/insightface.js): `lib/face/insightface.js`

### Platform services

- [Account auth](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/auth.js): `lib/auth.js`
- [Supabase data and storage](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/supabase.js): `lib/supabase.js`
- [R2 object storage](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/r2.js): `lib/r2.js`
- [Redis cache](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/redis.js): `lib/redis.js`
- [Pricing rules](https://github.com/damarlanandu2005-jpg/eventsnap/blob/main/lib/pricing.js): `lib/pricing.js`

### Other components

- **Photo seeker**

## Connections

- Photo seeker → Event discovery: browses (evidence: `pages/index.js`)
- Event discovery → Event page: opens event (evidence: `pages/index.js`)
- Event page → Selfie capture: renders (evidence: `pages/event/[slug].js`)
- Photo seeker → Face scan API: submits selfie
- Face scan API → Face provider: searches faces (evidence: `pages/api/scan.js`)
- Face scan API → Supabase data and storage: reads event photos (evidence: `pages/api/scan.js`)
- Face scan API → Redis cache: checks cache (evidence: `pages/api/scan.js`)
- Photo seeker → Match results: views matches
- Photo seeker → Photo downloads: requests archive
- Photographer → Photographer portal: manages events
- Photographer portal → Pricing rules: uses plans (evidence: `pages/photographer/index.js`)
- Photographer → Photo upload APIs: uploads photos
- Photographer → Admin operations: administers events
- Queue processor → Supabase data and storage: claims and updates (evidence: `pages/api/cron/process-queue.js`)
- Queue processor → R2 object storage: downloads originals (evidence: `pages/api/cron/process-queue.js`)
- Queue processor → Face provider: indexes faces (evidence: `pages/api/cron/process-queue.js`)
- Queue processor → Image preparation: prepares images (evidence: `pages/api/cron/process-queue.js`)
- Face provider → AWS Rekognition: selects provider (evidence: `lib/face/index.js`)
- Face provider → InsightFace provider: selects provider (evidence: `lib/face/index.js`)
- AWS Rekognition → Image preparation: normalizes images (evidence: `lib/face/aws.js`)
- Account auth → Supabase data and storage: verifies users (evidence: `lib/auth.js`)
