I-House Games logo


🧭 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 /events for the schedule
  • Use “Sign up” links to open Google Forms

Public standings

  • /standings shows 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)

PathMethodAuthPurposeSource
/GETPublicHome pageihnyc-games/apps/web/src/App.tsx
/eventsGETPublicEvent schedule + Google Form linksihnyc-games/apps/web/src/App.tsx
/standingsGETPublicMedal tableihnyc-games/apps/web/src/App.tsx
/adminGETAccess (edge)Admin dashboardihnyc-games/apps/web/src/App.tsx
/admin/eventsGETAccess (edge)Events managerihnyc-games/apps/web/src/App.tsx
/admin/resultsGETAccess (edge)Results entryihnyc-games/apps/web/src/App.tsx
/admin/importGETAccess (edge)CSV import utilityihnyc-games/apps/web/src/App.tsx
/admin/submissionsGETAccess (edge)Submission reviewihnyc-games/apps/web/src/App.tsx
/admin/settingsGETAccess (edge)Admin settingsihnyc-games/apps/web/src/App.tsx

API endpoints (Worker)

PathMethodAuthPurposeSource
/api/healthGETPublicHealth checkihnyc-games/services/api/src/index.ts
/api/eventsGETPublicList eventsihnyc-games/services/api/src/index.ts
/api/events/:idGETPublicFetch one eventihnyc-games/services/api/src/index.ts
/api/standingsGETPublicMedal table by floorihnyc-games/services/api/src/index.ts
/api/admin/eventsGET/POSTAdminList/create eventsihnyc-games/services/api/src/index.ts
/api/admin/events/:idPATCHAdminUpdate eventihnyc-games/services/api/src/index.ts
/api/admin/resultsGET/POSTAdminGet/save resultsihnyc-games/services/api/src/index.ts
/api/admin/results/:idDELETEAdminDelete result rowihnyc-games/services/api/src/index.ts
/api/admin/import/csvPOSTAdminImport CSV submissionsihnyc-games/services/api/src/index.ts
/api/admin/importsGETAdminImport run historyihnyc-games/services/api/src/index.ts
/api/admin/submissionsGETAdminSubmission reviewihnyc-games/services/api/src/index.ts
/api/admin/submissions/:idDELETEAdminDelete submissionihnyc-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 project
    • api.games.ihnyc-rc.org → Worker
  • Admin: protect /admin and /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 --remote

Binding name: ihnyc_games

Deploy

npx wrangler deploy

CORS allowlist


4 items under this folder.