§01
Overview
- What it is: Multilingual (ru/uz/en) Telegram e-commerce bot for the Restaurant chain (UZ) pizzeria chain (choparpizza.uz). Menu/cart, delivery/pickup, terminal selection, stop-lists, authorization, reviews, mass broadcasts. Frontend to an external Laravel API (
api.choparpizza.uz-style). Same repo owner (ShahzodSalimsakov) and architecture as Restaurant chain (UZ)Bot. - Type / status / role: bot / maintained / contributor (2–3 developers; the user has 174 of 317 commits, ~55%).
- Active period: 2021-07-31 → 2026-05-18, ~5 years. Alive: 2025–2026 show a fresh wave of features with clean conventional-commits (some — with Claude).
§02
Stack
- Languages: JavaScript (Node.js, CommonJS). TypeScript only in devDeps (unused).
- Frameworks/libraries: Telegraf 4.15 (newer than Restaurant chain (UZ)Bot's 4.4; Scenes/WizardScene), telegraf-i18n (ru/uz/en), Fastify 3 + fastify-telegraf, Bull 4 + @bull-board, ioredis, luxon, hashids, bwip-js/canvas (barcodes), axios.
- Infra/deploy: PM2, Sentry, @inspector-apm/inspector-nodejs (APM monitoring — the only notable dependency difference from Restaurant chain (UZ)Bot), choparpizza.uz / Contabo server. Bun (
bun.lockbpresent) + yarn.lock — package manager migration. - Data: MongoDB (sessions +
event_systemscollection), Redis (Bull + pub/sub). - Notable tooling: agenda/node-cron/sfn-scheduler (partly legacy/commented out).
§03
What was shipped
Early history — junk messages ("asd", "dsd", "fix"); from 2025 onward — clean conventional commits (some generated by Claude).
- Menu/cart —
controllers/menu/index.js>2755 lines (larger than Restaurant chain (UZ)Bot's): pagination, cart, modifiers, half-products, promotions (threeSaleProducts,8246873). - Per-terminal stop-lists —
f241cf3 fix: Enforce stop-list check on product variants+b0697e4(answerCbQuery when blocked). - Scheduled broadcasts —
bot.js+util/queue.js: Bull cron jobs, progress reported to the API, message deletion;cb9c9f3 feat: endpoint to remove scheduled events from MongoDB,0dac3ce feat: Emit 'removed' event on job removal. - send_notify with reply —
30928f3 refactor: Add support for replying to a message. - Business updates: cities (
94653c7 trying to fix cities issue), close time, delivery copy. - Final refactor (`5880f35`, 2026-05-18): replaced
/api/configs/publicwith a static env config (same refactor as Restaurant chain (UZ)Bot — a shared update across both bots). - Volume: 317 commits over ~5 years, 174 by the user. Activity in waves; recently revived with AI assistance.
§04
Technical challenges
- Stop-list at the variant/modifier level (
controllers/menu/index.js,addToCart, commitf241cf3): previously only the parent product ID was validated → out-of-stock pizza sizes (40 cm) slipped into the cart. Fix: GETterminals/get_stock?terminal_id=..., buildblockedIdsfrom[selectedProdId, rightProduct.id, ...selectedModifiers.map(id)], check intersection with the stop-list, block withproductIsNotInStock. → A real production bug in domain logic; correctly extending the check to all product components. - Removing scheduled messages from MongoDB (
bot.js,cb9c9f3): endpoint/api/schedule_event/remove_within_mongo— cursor overevent_systemsbyjobId,bot.telegram.deleteMessage(chatId, message_id)+ document deletion, with detailed logging and try/catch per message. → Managing broadcast state (also has a bug: a reference toqueueJob.idoutside the scope — a potential ReferenceError). - Custom Bull queue with Redis pub/sub (
util/queue.js) — same as in Restaurant chain (UZ)Bot: cross-process cancellation of running jobs (a shared infra pattern of the family). - APM instrumentation (
@inspector-apm/inspector-nodejs) — production performance monitoring of the bot.
§05
AI-assisted development
- Sessions found: 1 (within the local Claude Code sessions directory,
0f95e959-...jsonl, ~3.2 MB). - What was done with AI: sample of the first prompt — "commit and push" (minimal manual input); actual AI edits visible in commits with
Co-Authored-By: Claude Opus 4.7 (1M context): variant-level stop-list (f241cf3), logging for sending/deleting messages, env-config refactor (5880f35). - AI-workflow patterns: using Claude Code for targeted bugfixes and refactoring inside a large legacy file (menu/index.js, 2.7k+ lines), with clean conventional-commit messages generated by AI. Delegating routine ("commit and push").
- Unlike alfaclean — here AI was used pointedly on legacy code, not for greenfield architecture.
§06
Achievements & metrics
- Real production bot for the Restaurant chain (UZ) pizzeria chain; 3 languages; integration with Laravel API/MongoDB/Redis/Sentry/APM.
- 174 user commits out of 317 over ~5 years — a long-lived product.
- menu/index.js >2755 lines — the largest controller; rich domain logic (modifiers, half-products, stop-lists, promotions).
- No exact business metrics in the code.