devfest26-raffle
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v49View latest version
Dynamic raffle app built for Val Town with a public entry page and two admin views:
- Admin Home: draw winners, view submissions, reset test data
- Admin Manage: manage prize pool (add, rename, remove) and inspect submissions
- Dynamic prize pool (not hard-coded to 3 prizes)
- One entry per email
- Entrants can opt into one or more prizes
- One winner per prize
- A single entrant can only win once across all prizes
- Mobile-friendly public and admin UI
- Val Town blob-backed persistence with compatibility handling for older data shapes
main.http.ts: main HTTP val (Hono app, routes, UI rendering, handlers)server.ts: compatibility re-exportREADME.md: quickstart and operator usageDOCS.md: architecture + API + reasoning guide
deno run -A --watch main.http.ts
Open:
- Public:
http://localhost:8000/ - Admin Home:
http://localhost:8000/admin?key=<ADMIN_KEY> - Admin Manage:
http://localhost:8000/admin/manage?key=<ADMIN_KEY>
Set admin auth key:
export ADMIN_KEY="devfest26"
In Val Town, set ADMIN_KEY in Environment Variables.
GET /: public entry pagePOST /api/entries: create entryGET /admin?key=...: admin home (draw/reset/overview)GET /admin/manage?key=...: prize management + deep data viewGET /api/admin/state?key=...: admin data snapshotPOST /api/admin/draw?key=...: draw winner for one prizePOST /api/admin/reset?key=...: reset winners + entriesPOST /api/admin/prizes?key=...: add prizePATCH /api/admin/prizes/:prizeId?key=...: rename prizeDELETE /api/admin/prizes/:prizeId?key=...: remove prize
main.http.tsmust be file typehttp- Keep admin links private (
?key=...) - Use
/admin/manage?key=...when changing prize pool
Blob keys used by this val:
devfest26_raffle_prizes_v1devfest26_raffle_entries_v2devfest26_raffle_winners_v2
- Open
/admin/manage?key=...and set prize pool. - Share public
/page for entries. - Use
/admin?key=...during event to draw winners. - Use reset only for test cycles.
