case · 004
Telegram Mini App on TON.
A mobile-first Telegram Mini App that runs inside Telegram's web view with the Telegram WebApp SDK injected at runtime — a tap-to-earn game loop with mining boosts, daily rewards, task-based progression, referral mechanics, leaderboard rankings, and a full admin panel for task management. Built as a Next.js frontend paired with an Express + Prisma backend, designed to be opened from a Telegram bot without ever installing a separate app.
fig. 0.1
Cover image · game loop diagram
Telegram Mini Apps live or die on three things: the WebApp SDK has to be present at runtime (we mock it in dev so the same code runs without Telegram injected), the game loop has to be rewarding within a single tap (mining rate visible immediately, first reward within seconds), and the leaderboard has to be fair across devices (which means state in a real database, not localStorage).
Our team built the full stack: a Next.js 15 frontend using the Telegram WebApp SDK injected via the standard script tag (with a `mockTelegramWebApp.js` shim for local development), Radix UI primitives for the in-Telegram dialogs, GSAP micro-animations on the mine button and progress arcs, Recharts for the leaderboard time series, and Zustand stores for client state. The Express + Prisma backend holds user state, tasks, referral trees, and leaderboard scores in MySQL so concurrent players see consistent ordering.
user-facing screens (mining, tasks, leaderboard, rewards, boosts, referrals)
admin panel for live task management
time-to-first-reward on first open
Onboarding is intentionally short: the user lands, taps once to claim the daily reward, mines a few times to see the cooldown, and gets pointed at tasks (join channel, invite friend, post in chat) that pay out across the next 24 hours. Admin can push new tasks live from an operator console — task form, payout config, audience targeting — and they go active immediately without a backend deploy.
Referral mechanics use Telegram's invite links with a server-validated attribution: the referral cookie is set on first open, the back-end credits the referrer only when the referee hits a configured milestone (first mine, first task, total mined > X), so invite spam doesn't farm the leaderboard.
/ stack
- TON (The Open Network) wallet integration pattern via Telegram Mini App SDK
- Next.js 15
- React 19
- Radix UI
- Zustand
- GSAP
- Recharts
- Tailwind
- Express + Prisma 6
- MySQL
- JWT auth
- GSAP timelines
next case study
Prediction-market resolver..
A resolution service that watches a prediction market for closure, fetches authoritative sources for the underlying question, reasons through the market's stated rules, and submits a citation-backed outcome (YES / NO / UNKNOWN / EARLY) within seconds. Designed for prediction markets that don't want token-weighted oracles deciding outcomes.
/ start a project