~/hassan
← back to projects

"case_study": "nejobi"

A Telegram casino the client can't cheat

A play-money casino running natively inside Telegram — roulette, plinko, sky-rush, wheel — where every outcome is decided by the server and the client only animates the result.

"role"

Frontend — Next.js Mini App (the API and game logic live in a companion Express + Prisma server)

"stack": [7]

  • Next.js
  • React
  • TypeScript
  • Tailwind CSS
  • Telegram Mini Apps SDK
  • Express.js
  • Prisma

The problem

Casino games are the worst case for client trust: the code runs on the player's device, and any value the client computes, the player can manipulate. Even with play money, an exploitable economy kills the product.

Telegram Mini Apps add a second constraint — the whole experience runs inside Telegram's webview, authenticated by Telegram's own init data, and it has to feel like a native game, not a website.

The design

Why it matters

This is the same trust architecture real-money gaming and fintech products use. Deciding early that the client is untrusted shaped every API: endpoints return results, never formulas, and balances only ever change server-side.