Help contributors and automation tools work effectively in this repo by providing quick orientation, safe defaults, and high-signal commands.
cp .env.example .envand fill required tokens/keys.npm installnpm --prefix src/frontend installnpm run dev(backend)npm --prefix src/frontend run dev(frontend)
- Prefer TypeScript edits under
src/. - Avoid changing generated or built assets under
build/unless requested. - Keep ESM import style (no CommonJS
require). - Frontend (
src/frontend/) is a separate package — keep deps isolated. - No semicolons, single quotes, 2-space indent (Prettier enforced).
src/main.ts— Bot startup, MongoDB connection, server wiringsrc/server.ts— HTTP server, API routes, static filessrc/bot/index.ts— Bot middleware chain and feature registrationsrc/config.ts— Environment configuration (znv + zod)src/frontend/src/router/index.ts— Frontend routessrc/frontend/src/stores/userStore.ts— Frontend state (Pinia)
All Typegoose models live in src/common/models/:
- User — Telegram user profile, wallet, game state, votes
- Balance — Balance change history (deposit, withdraw, claim, dice, etc.)
- Claim — Daily claim streaks and rewards
- CNFT — Compressed NFT metadata and types
- Transaction — TON blockchain transaction records
- Vote — Referral tracking
POST /api/auth/login— Telegram initData authPOST /api/auth/set-wallet— Store TON walletPOST /api/captcha— Bot captchaGET /api/nft/:index— NFT metadata + imagesGET /api/users/balance— User balanceGET /api/users/leaderboard— Ranked leaderboardPOST /api/users/claim— Daily reward claim
npm run lint— ESLintnpm run typecheck— TypeScript checknpm run format— Prettiernpm run test:backend— Run backend tests (Node.js test runner)npm run build:all— Build backend + frontend
CLAUDE.md— Comprehensive project guide for AI agentsARCHITECTURE.md— System architecture overviewAGENTS.md— Agent-specific orientation guidedocs/FUTURE_DEVELOPMENT.md— Prioritized improvement and feature ideas