Abandoned

Telegram
Mini App Game

A Hamster Kombat-style idle game built as a Telegram Mini App. Players earn passive income, buy upgrades, compete on a leaderboard, and make purchases with Telegram Stars — all without a dedicated backend server.

What telegram mini apps are?

Tech Stack

Frontend
Next.jsTypeScriptTailwind CSSGSAPZustand
Backend
Next.js Server ActionsMongoDBTelegram Bot API
Architecture
Serverless (no dedicated API)Telegram Mini App SDK

Architecture

Serverless architecture with no dedicated API. Next.js Server Actions handle all game logic, communicating directly with MongoDB and the Telegram Bot API.

CLIENT
Next.js App RouterTelegram Mini App SDKZustand StoreServer actions
HTTP / Internal calls
EXTERNAL APIS
Telegram Bot APIStars Payment Webhooks
HTTP / Internal calls
DATA
MongoDB

Key Features

01

Idle Passive Income

Core clicker-style loop where players accumulate in-game currency passively over time. Offline earnings calculated on session resume based on elapsed time and owned upgrades.

02

Upgrades & Shop

Players can spend earned currency on upgrades that boost passive income rate. Each upgrade tier unlocks new multipliers, persisted in MongoDB per user.

03

Telegram Stars Payments

Integrated native Telegram Stars invoices for in-app purchases. Users can buy premium upgrades or boosters directly within the Mini App using Telegram's built-in payment flow.

04

Leaderboard, Referrals & Daily Rewards

Global leaderboard ranked by total earnings. Referral system tied to Telegram's invite links grants bonus currency. Daily reward streak incentivizes return sessions.

Challenges & Solutions

Real problems encountered during development and how they were resolved.

Problem

No dedicated backend

Solution

Used Next.js Server Actions as a lightweight serverless API layer; each game action (collect earnings, buy upgrade, claim reward) maps to a single server action with MongoDB read/write

Problem

Calculating offline earnings without a background worker

Solution

Stored last-seen timestamp in MongoDB per user; on session start, server action computes elapsed time and applies the income rate formula before returning updated state to the client

Problem

Validating Telegram Stars invoice callbacks securely

Solution

Verified payment webhooks using Telegram Bot API's pre_checkout_query flow inside a Server Action; purchase credited only after successful_payment event confirmed by Telegram

Why It Was Abandoned

The only purpose of this project was to learn how telegram mini apps work.

;