§01
Overview
- What it is: an ERP/back-office platform for the franchise restaurant network Restaurant chain (UZ) / Restaurant chain (UZ). Manages users/roles/permissions, locations and terminals, nomenclature, invoices, OLAP reports, schedules, stop-lists, sales plans, reconciliation of payment gateways. 5 independent services in one repo, shared types via TS path aliases.
- Type / status / role: web-app / backend platform (monorepo) / active (latest commit 2026-05-08) / lead — the user (Davr / Davron Yuldashev / Dave93, combined) = 410 of 939 commits (~44%), top author. Team: Ilhombek (~208), Shahzod (~122), Bobur (~121).
- Activity window: 2023-08-05 → 2026-05-08 (~2 years 9 months) — the longest-lived project in the portfolio. 939 commits.
§02
Stack
- Languages: TypeScript (everywhere), Bun + Node.
- Services (per CLAUDE.md + manifests):
- admin/ — Next.js 15 + React 19 dashboard (Bun, port 6762), HeroUI + Radix UI, Eden (a typed client into the backend — imports the backend's
Apptype). - backend/ — Elysia API on Bun, Drizzle ORM + PostgreSQL, Redis (sessions, ioredis + item-store-redis), BullMQ (queues), JWT/bearer, OpenAPI, websockets. 44 domain modules (users, roles, permissions, invoices, report_olap, sales_plans, terminals, nomenclature, stoplist, timesheet, scheduled_reports, …).
- cron/ — Bun + node-cron/@elysiajs/cron: sync with iiko, OLAP backfill, role assignments (port 8080).
- duck_api/ — Hono + DuckDB (+ duckdb-async) — analytical data-warehouse sync (Node, tsc-build).
- merchants_api/ — Elysia + Puppeteer: scrapes reports from payment gateways (Payme, Click, Yandex, Express, iiko-kassa), tRPC.
- Infra/deploy: PM2 (office_api/office_cron/office_duck/office_merchant_api), per-service
pm2.config.js.dump.rdb(Redis snapshot). gRPC tooling (protoc-ts). ⚠️ Zoo of lockfiles (bun.lockb + pnpm-lock + yarn.lock + package-lock) — inconsistency. - Data: PostgreSQL (Drizzle, schema
backend/drizzle/schema.ts), Redis, DuckDB (OLAP).
§03
What was shipped
The user is the lead developer of the platform (~44% over 2.7 years).
- Backend (Elysia): 44 modules under a single pattern (Elysia plugin per module,
controller.ts+dto/, context pluginctx). Domains: users/roles/permissions (RBAC), invoices and line items, OLAP reports, terminals/locations, nomenclature (+ org mapping), schedules/timesheet, stop-lists, sales plans, scheduled_reports, hanging_orders, internal_transfer, etc. - Admin (Next.js 15): dashboard with E2E typing through Eden (the backend's
Apptype imported into the frontend — type-safe calls without hand-written DTOs). - merchants_api: automated report collection from 5 payment gateways via Puppeteer (acquiring reconciliation).
- cron: integration with iiko (POS), OLAP backfill, role auto-assignment.
- duck_api: a DuckDB analytics datamart.
- Volume: 410 user commits; 5 services; 44 backend modules; ~2.7 years of evolution.
§04
Technical challenges
Confirmed by CLAUDE.md / manifests / structure.
- End-to-end type safety across the service boundary → admin imports the Elysia backend's
Apptype and calls the API via Eden; Next configexperimental.externalDir: true+ path aliases (@backend/*,@admin/*) instead of npm workspaces. A strong "types as contract" pattern without codegen. - Modular Elysia architecture → 44 domains as isolated plugins with a single shared context; scalable and uniform. Mature backend design.
- Polyglot persistence per task → PostgreSQL (OLTP, Drizzle) + Redis (sessions/cache/queues) + DuckDB (OLAP datamart, separate Hono service). A deliberate OLTP/OLAP split.
- Queues and background work → BullMQ (backend) + cron service (iiko sync, OLAP backfill) — a thoughtful background processing setup.
- Real-business integrations → iiko POS, and scraping of 5 payment gateways (Payme/Click/Yandex/Express) via Puppeteer for financial reconciliation — non-trivial, high-value automation.
- Long evolution → different Elysia versions across services (0.8 in merchants vs 1.4 in backend) — typical tech debt in a live monorepo.
§05
AI-assisted development
- Sessions found: 1 under the local Claude Code sessions key for this project (1
.jsonl). - What was done with AI: there's a detailed
CLAUDE.md(8.5 KB) — an engineering guide for the repo (module-add pattern, aliases, PM2 names, "don't claim tests passed without actually running them"). AI-assisted maintenance of a large legacy monorepo. - AI workflow patterns: using CLAUDE.md as a "map" to onboard the AI into a complex multi-service repository — a good practice.
§06
Achievements & metrics
- 939 commits / ~2.7 years, user ~44% (410) — lead author.
- 5 production services under PM2; 44 backend modules.
- Integrations: iiko POS + 5 payment gateways (Payme/Click/Yandex/Express/iiko) + OLAP.
- 3 data stores (Postgres/Redis/DuckDB), BullMQ queues, websockets, OpenAPI.
- E2E type safety front↔back via Eden.