Private Persian/RTL Telegram Mini App for Iranian OTC gold trading intelligence and execution. Zarbit connects to a fixed trading group and authoritative management bot, providing an official quote & trade terminal, recent trades tape, active order radar, and a 7-day rolling trader analytics leaderboard. Each allowlisted user connects their own Telegram account via phone → code → optional two-step verification password. The worker alone owns all MTProto sessions.
Requires Node.js 24 and pnpm 10.26.0.
- Database: Provision PostgreSQL 16+ (see docs/POSTGRES.md).
- Environment:
- Configure
apps/server/.envandapps/worker/.envusing their.env.exampletemplates, setting identicalDATABASE_URLandWORKER_INTERNAL_TOKENvalues. - Configure
apps/web/.envwithVITE_SERVER_URL(e.g.http://localhost:3000in dev). - The root
.envis used for Docker Compose, not shared package configuration. - For local web development outside Telegram, set
DEV_TELEGRAM_USER_IDto an ID listed inALLOWED_TELEGRAM_USER_IDS.
- Configure
- Install & Migrate:
pnpm install pnpm run db:generate MIGRATION_DATABASE_URL="postgresql://..." pnpm --filter @zarbit/db exec prisma migrate deploy
- Run Services:
pnpm run dev
- Web:
http://localhost:3001 - Server:
http://localhost:3000(OpenAPI spec at/api/openapi.json) - Worker: private internal HTTP at
http://localhost:3002
- Web:
- Set the repository build variable
VITE_SERVER_URLin GitHub Actions before building images; the web client embeds this URL at build time. - In Dokploy, deploy using
compose.ymlwith environment values fromdeploy/compose.env.example. - Route public domains to
web:80(Mini App) andserver:3000(API). Do not expose the worker port (3002). - The
migrateservice incompose.ymlruns automatically on release cutover, applying migrations and preparing session volume permissions before server and worker start. - Full operational procedures, health checks, and rollback instructions: docs/OPERATIONS.md.
Run project checks:
pnpm run test
pnpm run check-types
pnpm run buildLive Telegram behavior (login, 2FA, message reception, and order dispatch) requires acceptance testing by the owner with real accounts in a controlled group.
- Product Specification
- Architecture
- Business Rules
- Telegram Integration
- PostgreSQL Architecture
- Dokploy Operations
- RPC Contracts
- Market Data Specification
- Product Roadmap
- Home Page Feature Specification
- Telegram Room Protocol
Never send phone codes, passwords, or authentication secrets to the bot, or include them in bug reports or logs.