A lightweight horse-racing betting game for Telegram Mini Apps. Pick a
horse, place a bet, and win bet × odds if your horse crosses first.
Built as a dependency-free static web app (HTML/CSS/vanilla JS) — no engine, no build step, instant load. Deployed on Vercel.
webapp/ # the game (served at site root)
index.html # single screen: balance, track, horse picker, bet bar
styles.css # dark-green / gold brand theme
src/
main.js # UI + betting/race controller
simulation.js # odds-weighted race simulation + horse roster
telegram.js # Telegram WebApp lifecycle + haptics
api.js # /auth client with local guest fallback
api/ # Vercel serverless functions (auth / play / leaderboard)
vercel.json # deploy config (outputDirectory = webapp)
No build needed — edit files under webapp/ and open webapp/index.html,
or deploy a preview. Race feel is tuned in webapp/src/simulation.js
(BIAS_SPREAD, RACE_VAR, SPEED_BASE, and the HORSES roster/odds).
Push to master → the deploy-vercel GitHub Action runs vercel deploy --prod
(requires the VERCEL_TOKEN repo secret). The api/ functions are deployed
alongside the static app.
- Coin balance is currently client-side (
localStorage); the leaderboard API returns mock data. Real persistence needs a database. - Win rates are tuned to match the priced odds (≈30% house edge).