IHNYC Games keeps the public site and admin interface separate from the API and database, while Cloudflare Access protects administrative work.
- Live site: games.ihnyc-rc.org
- API: api.games.ihnyc-rc.org
System overview
flowchart TD people[Residents and organizers] --> pages[Cloudflare Pages<br/>Public site and admin UI] pages --> worker[Cloudflare Worker<br/>Public and admin APIs] worker --> d1[(Cloudflare D1<br/>Events, results, imports, submissions)] access[Cloudflare Access<br/>Admin route protection] -.-> pages access -.-> worker
- Pages serves the public site and the
/adminUI. - Worker provides JSON APIs for public + admin flows.
- D1 stores events, results, imports, and submissions.
Admin access model
/adminshould be protected at the edge with Cloudflare Access.- Admin API endpoints (
/api/admin/*) require either:- Cloudflare Access headers, or
X-Admin-TokenmatchingADMIN_TOKEN(dev only).
Data flow
- Events + Results are created in Admin Console.
- CSV Import ingests Google Forms exports into
signup_submissions. - Standings are computed on read from
results.
Deploy flow
- API:
npx wrangler deploy(Worker) - UI: Cloudflare Pages build from repo (
apps/web) - D1 schema:
npx wrangler d1 execute ihnyc-games --file=../../infra/d1/schema.sql --remote