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: v96View latest version
Raffle app for live events with:
- Public entry page (
/) - Public live odds board (
/odds) - Admin Home (
/admin?key=...) for draw/reset - Admin Manage (
/admin/manage?key=...) for prize CRUD and submission review
- Dynamic prize pool
- One entry per email (enforced server-side)
- Each entrant gets exactly
Ntickets whereN = number of prizes - Tickets are allocated per prize via
- / +controls - Submission is only valid when all tickets are allocated
- Winner selection is weighted by ticket count for that prize
- A person can only win once across different prizes
- Redraw supported for no-show winners
deno run -A --watch main.http.ts
Open:
- Public entry:
http://localhost:8000/ - Live odds:
http://localhost:8000/odds - 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="replace-with-your-own-secret"
In Val Town, add ADMIN_KEY in Environment Variables.
GET /: raffle entry UIGET /odds: public live odds boardPOST /api/entries: create entryGET /api/odds: anonymous odds + winner state JSON
Admin-protected (?key=... required):
GET /admin: draw + redraw + reset + submissionsGET /admin/manage: prize management + detailed submissionsGET /api/admin/state: admin snapshotPOST /api/admin/draw: draw winner for one prizePOST /api/admin/redraw: redraw winner for one prizePOST /api/admin/reset: clear entries + winnersPOST /api/admin/prizes: add prizePATCH /api/admin/prizes/:prizeId: rename prizeDELETE /api/admin/prizes/:prizeId: remove prize
Current canonical keys:
devfest26_raffle_prizesdevfest26_raffle_entriesdevfest26_raffle_winners
- Configure prizes in
/admin/manage?key=... - Share
/for entries and/oddson screen - Draw from
/admin?key=... - If winner is absent, use
Redrawfor that prize - Use
Resetonly for test cycles
