Back to archive
IV. Client Builds & Logistics Platformssupportingcontributorclient anonymised

Food Delivery Telegram Bot — sister brand

Production Telegram food-ordering bot for the "Restaurant chain (UZ) / Restaurant chain (UZ)" delivery chain (Uzbekistan): menu, cart, delivery/pickup, loyalty, broadcasts.

Status
maintained
Period
2021-12-08 → 2026-05-18
AI sessions
Stack
Languages
JavaScript
Frameworks · Infra
Telegraf 4FastifyBulltelegraf-i18n
§01

Overview

  • What it is: A multilingual (ru/uz/en) Telegram e-commerce bot for a restaurant chain. The user places an order (delivery or pickup), picks a branch, goes through OTP authorization, views their orders, gets a cashback barcode, leaves reviews. The bot is a frontend to an external Laravel API (api.restaurant-chain.uz); it doesn't store the catalog itself, but proxies and orchestrates.
  • Type / status / role: bot / maintained / contributor (repo owned by ShahzodSalimsakov; user is one of 2–3 main developers, ~50% of commits).
  • Active period: first commit 2021-12-08, last 2026-05-18. A long-lived workhorse: edits arrive in waves driven by business changes (delivery fees, payment types, enabling/disabling cashback).
§02

Stack

  • Languages: JavaScript (Node.js, CommonJS). TypeScript only in devDependencies — effectively unused (sources are .js).
  • Frameworks/libraries: Telegraf 4 (Scenes / WizardScene + Composer as a dialog state machine), telegraf-i18n (ru/uz/en), Fastify 3 + fastify-telegraf (webhook), Bull 4 + @bull-board (queues and admin UI), ioredis, luxon (dates/timezones), hashids (tg_id obfuscation), bwip-js / barcode (barcode generation), axios, lodash.
  • Infra/deploy: PM2 (pm2.config.js, app les_bot), webhook https://newbot.restaurant-chain.uz, Sentry (@sentry/node), Contabo server (vmi849112.contaboserver.net / choparpizza.uz). Dev — polling + local session.
  • Data: MongoDB (telegraf-session-mongodb for sessions, event_systems collection for tracking sent messages), Redis (Bull broadcast queue + pub/sub).
  • Notable tooling: agenda (scheduler, disabled in code), node-cron / sfn-scheduler / cron-converter (partially commented out — traces of iterations on broadcast scheduling).
§03

What was shipped

The user's commit messages are mostly junk ("asd", "asdf", "dsds", "sdsd"), so milestones are reconstructed from diffs and code, not commit text.

  • Order flow (delivery/pickup)controllers/startOrder: WizardScene with steps address → building → entrance, geocoding via API, nearest terminal lookup, branch selection.
  • Branch working-hours calculationstartOrder/index.js (luxon), including overnight shifts and weekday/weekend logic.
  • Menu and cartcontrollers/menu/index.js (~79 KB, bot core): category pagination, cart, OTP authorization, minimum order amount.
  • Cashback with barcodecontrollers/cashback: code128 generation (bwip-js) from the phone number, PNG sent to the chat.
  • Mass broadcastsbot.js + util/queue.js: Bull queue with repeatable cron jobs, progress reported back to Laravel API, cancellation of active jobs via Redis pub/sub.
  • Business updates: delivery prices/weights (d653fcd, f3d5a1b, 02eef03), payment types (85824d1, 4d1d9f5 removed payment type uzcard, 03fbbb5 turn off payment links), enabling/disabling cashback (1373664 cashback disabled, 232b9b9), languages/locales.
  • Latest milestone (`b4f848f`, 2026-05-18): clean refactor — replaced runtime fetch of /api/configs/public (with base64 decode) with a static util/config.js from env. The only commit with a human-readable description and Co-Authored-By: Claude Opus 4.7.
  • Volume: 257 commits total, 129 by the user (Davron Yuldashev yul.davron.93@gmail.com, aliases Davron/Davr/Dave93), over ~4.5 years. Co-authors: shahaa (Shahzod Salimsakov, owner, 89 commits), root (deploy).
§04

Technical challenges

  • Custom Bull queue with cross-process job cancellation (util/queue.js): ExtendedQueue extends Queue + ExtendedJob, tracking active job promises, cancellation via Redis pub/sub (getInternalEventEmitter) with a direct reference to Bull GitHub issues (#1056/#1067) as justification for working around the sandboxed-process limitation. → Demonstrates understanding of distributed task processing and infrastructure-level workarounds at the queue layer. The most non-trivial piece of code in the repo.
  • Broadcast with backpressure reporting (bot.js sendQueue.process): sequential delivery over a list of tg_ids, checking job state at each step (cancellation on the fly), POSTing progress to the API every 50 messages, removing sent messages on a removed event via the event_systems collection. → Real-world handling of Telegram rate limits and broadcast state.
  • Branch working-hours logic across midnight (startOrder/index.js:169–234, luxon): current time compared to open/close, day correction when close.hour < open.hour (overnight shifts), separate branches for weekdays/weekends. → Careful edge-case handling of dates/timezones (Asia/Tashkent).
  • OTP authorization (menu/index.js): hashids-encoding tg_id, assembling a bearer token (base64 OTP_TOKEN + random salt → hex), resending the code. → Custom signing scheme for backend requests.
  • Refactor `b4f848f` (util/config.js): parsePositiveInt preserving historical behavior (fallback 0 on NaN, explicitly commented). → A rare example of clean, deliberate code in the project.
§05

AI-assisted development

  • Sessions found: 0 (no local Claude Code sessions directory for this project).
  • What was done with AI: indirect trace — the last commit b4f848f is tagged Co-Authored-By: Claude Opus 4.7 (1M context). This is the only clean, documented commit in the repository (config refactor), which contrasts with the rest of the history and points to a one-off use of AI for cleaning up legacy code.
  • AI-workflow patterns: insufficient data for conclusions (one data point).
  • No full Claude Code sessions exist for this project.
§06

Achievements & metrics

  • Real production product: bot for an active food-delivery chain (newbot.restaurant-chain.uz), 3 interface languages, integration with Laravel API, MongoDB, Redis, Sentry, PM2.
  • 129 user commits over ~4.5 years of maintenance (2021–2026) — a long-lived product, not a prototype.
  • Functionality: delivery/pickup ordering, geocoding, nearest-terminal lookup, OTP authorization, cashback barcode, reviews, scheduled mass broadcasts with progress.
  • No exact business metrics (DAU, order counts) in the code.
§07

Contributors

git shortlog · all branches

  1. Dave93137
  2. shahzodsalimsakov89
  3. root20
  4. Boburt9
  5. User1
  6. i76717571
6 contributors257 commits total
Currently

Open to Senior / Staff engineering roles and selective freelance — production AI, platform, and full-stack work.

Get in touch