- Service Name:
ihnyc-games - Live Site: https://games.ihnyc-rc.org
- API: https://api.games.ihnyc-rc.org
- Repository:
https://github.com/dghauri0/ihnyc-games.git
🧭 Overview
- Cloudflare Pages frontend with a Worker API backend
- D1 database stores events and results
- Public-only MVP: signups handled via Google Forms links
- API responses use
{ ok, data, error }envelopes - Logo updated to a larger display in header and hero
Sources: ihnyc-games/README.md, ihnyc-games/services/api/src/index.ts, ihnyc-games/infra/d1/schema.sql
🎨 Design documentation
DESIGN_UPDATES.md(comprehensive design system, component and layout reference)DESIGN_GUIDE.md(quick reference for colors, typography, and patterns)
📚 Documentation index
ihnyc-games-architecture.md(system diagram + deployment flow)ihnyc-games-data.md(D1 schema + import rules)ihnyc-games-api.md(public + admin endpoint catalog)ihnyc-games-admin.md(admin console UX + access model)
👥 Key user flows
Public events
- Browse
/eventsfor the schedule - Use “Sign up” links to open Google Forms
Public standings
/standingsshows medal totals by floor
🗃️ Data model
events
- id (TEXT, PK)
- title (TEXT)
- sport (TEXT)
- description (TEXT)
- location (TEXT)
- start_at (TEXT)
- end_at (TEXT)
- capacity (INTEGER)
- form_url (TEXT)
- source_label (TEXT)
- created_at (TEXT)
results
- id (TEXT, PK)
- event_id (TEXT, FK → events.id)
- floor_number (INTEGER)
- placement (INTEGER)
- points (INTEGER)
- medal (TEXT: gold|silver|bronze|NULL)
- created_at (TEXT)
import_runs
- id (TEXT, PK)
- created_at (TEXT)
- rows_read (INTEGER)
- inserted (INTEGER)
- skipped (INTEGER)
- errors_json (TEXT)
signup_submissions
- id (TEXT, PK)
- import_run_id (TEXT, FK → import_runs.id)
- name (TEXT)
- email (TEXT)
- room (TEXT)
- floor_number (INTEGER)
- raw_json (TEXT)
- created_at (TEXT)
submission_event_choices
- id (TEXT, PK)
- submission_id (TEXT, FK → signup_submissions.id)
- event_id (TEXT, FK → events.id)
- source_label (TEXT)
- created_at (TEXT)
🔗 Key routes and endpoints
UI routes (Pages)
| Path | Method | Auth | Purpose | Source |
|---|---|---|---|---|
/ | GET | Public | Home page | ihnyc-games/apps/web/src/App.tsx |
/events | GET | Public | Event schedule + Google Form links | ihnyc-games/apps/web/src/App.tsx |
/standings | GET | Public | Medal table | ihnyc-games/apps/web/src/App.tsx |
/admin | GET | Access (edge) | Admin dashboard | ihnyc-games/apps/web/src/App.tsx |
/admin/events | GET | Access (edge) | Events manager | ihnyc-games/apps/web/src/App.tsx |
/admin/results | GET | Access (edge) | Results entry | ihnyc-games/apps/web/src/App.tsx |
/admin/import | GET | Access (edge) | CSV import utility | ihnyc-games/apps/web/src/App.tsx |
/admin/submissions | GET | Access (edge) | Submission review | ihnyc-games/apps/web/src/App.tsx |
/admin/settings | GET | Access (edge) | Admin settings | ihnyc-games/apps/web/src/App.tsx |
API endpoints (Worker)
| Path | Method | Auth | Purpose | Source |
|---|---|---|---|---|
/api/health | GET | Public | Health check | ihnyc-games/services/api/src/index.ts |
/api/events | GET | Public | List events | ihnyc-games/services/api/src/index.ts |
/api/events/:id | GET | Public | Fetch one event | ihnyc-games/services/api/src/index.ts |
/api/standings | GET | Public | Medal table by floor | ihnyc-games/services/api/src/index.ts |
/api/admin/events | GET/POST | Admin | List/create events | ihnyc-games/services/api/src/index.ts |
/api/admin/events/:id | PATCH | Admin | Update event | ihnyc-games/services/api/src/index.ts |
/api/admin/results | GET/POST | Admin | Get/save results | ihnyc-games/services/api/src/index.ts |
/api/admin/results/:id | DELETE | Admin | Delete result row | ihnyc-games/services/api/src/index.ts |
/api/admin/import/csv | POST | Admin | Import CSV submissions | ihnyc-games/services/api/src/index.ts |
/api/admin/imports | GET | Admin | Import run history | ihnyc-games/services/api/src/index.ts |
/api/admin/submissions | GET | Admin | Submission review | ihnyc-games/services/api/src/index.ts |
/api/admin/submissions/:id | DELETE | Admin | Delete submission | ihnyc-games/services/api/src/index.ts |
🛠️ Ops notes
- D1 database:
ihnyc-games(production-backed) - Worker name:
ihnyc-games-api - Custom domains:
games.ihnyc-rc.org→ Pages projectapi.games.ihnyc-rc.org→ Worker
- Admin: protect
/adminand/api/admin*with Cloudflare Access
D1 setup (production-backed)
npx wrangler d1 create ihnyc-games
npx wrangler d1 execute ihnyc-games --file=../../infra/d1/schema.sql --remote
npx wrangler d1 execute ihnyc-games --file=../../infra/d1/seed.sql --remoteBinding name: ihnyc_games
Deploy
npx wrangler deploy