case study — demo · source private

TeleGap

Telegram control panel

Real MTProto sessions that farm groups, channels and bots — then broadcast and AI-drip across every chat they own, with flood-wait parking so the queue never loses an operation.

telegap.rec — 1:50
$ buffering — streaming…
MTProtogramjs + @mtcute, the real thing
50/24hper-account rate budget
AIGroq-written drip pool
WSevery op logged live

$ cat build.log

  1. 0:00

    The brief: drive real Telegram user accounts — MTProto through gramjs and @mtcute, no bot-API shortcuts — from one Next.js 15 panel with a dedicated Node.js backend.

  2. 0:07

    Bird's eye: the panel never touches Telegram itself — REST + WebSocket to a Node.js backend that owns the MTProto clients, with Supabase as the single spine for sessions, budgets and queues.

  3. 0:15

    Login first: phone → Telegram code → optional 2FA password → session_string in Postgres. Proxy attached, budget reset, the account is a real client that survives restarts.

  4. 0:23

    The accounts view never lies: live budgets from check_rate_limit() — 50 groups per 24h, cooldowns counting down, next slot per account, flood-waited accounts parked and skipped.

  5. 0:31

    Group farming shows its work: 10 s between groups, seeded starter messages, randomized Adjective_noun123 usernames — every anti-ban delay is a visible control, not a hidden constant.

  6. 0:40

    Channels run the same engine with broadcast-grade naming and content protection — plus a backfill that syncs counts with the external auto-leave bot. Bots too: /newbot through BotFather itself, token captured the moment it replies.

  7. 0:50

    Then the payoff — one messaging engine, two tempos. Broadcast: text or image+caption to every chat, now. Chat IDs are never stored; iterDialogs discovers them live at send time.

  8. 1:00

    Drip is the patient one: one Groq call writes the whole message pool, you edit it in MessagePreview, then the scheduler spreads X messages evenly across Y days per chat — resumable, flood-aware.

  9. 1:11

    Proof, side by side: the real Telegram client on the left, the panel's console on the right — every send queued on the right lands on the left, 1.5 s apart.

  10. 1:23

    And the queue never loses an operation: per-account progress in messaging_targets, FLOOD_WAIT parking instead of dying, retries with next_attempt_at, everything streamed over WebSocket.

  11. 1:34

    From login to drip — accounts, groups, channels, bots, broadcast — one panel runs the whole Telegram fleet while its owner sleeps.

$ ls stack

  • Next.js 15
  • Node.js
  • Supabase
  • MTProto (gramjs, @mtcute/node)
  • WebSocket