§01
Overview
- What it is: management backend for fiscalization/payments of the Restaurant chain (UZ) chain — a web counterpart to
ofdplugin(#40, C# for iiko). The admin manages organizations (multi-tenant), products, terminals, payment types, roles/permissions; syncs data with iiko Cloud and payment providers. - Type / status / role: web-app (API + admin) / active / solo (~11/14 user commits; 3 — Shahzod).
- Active period: 2026-02-07 → 2026-02-27 (~3 weeks, compact). 13 CC sessions.
§02
Stack
- API (`api/`): Elysia.js (Bun) + bearer-auth + typebox, Drizzle ORM + PostgreSQL (
postgres), Redis (ioredis), jose (JWT), otp-generator, radash/lodash, dayjs. - Admin (`admin/`): Next.js + react-hook-form + Zustand (product store).
- Crons (`crons/`): background sync.
- API modules: organizations (multi-tenant), organizations_users, products, terminals, payment_types, roles/permissions/users/users_roles/roles_permissions (full RBAC), cache_control.
§03
What was shipped
- RBAC + multi-tenant: roles/permissions/users modules + organizations.
- Payment-type sync (
f0be309,40f6e27): sync endpoint + button in admin, pulls/updates payment types from an external service per organization; UzCard integration, card_type. - Terminal sync via iiko Cloud API (
d3a9e39). - Product sync (
5ba77cf— scoped to a single organization instead of all;f0be309). - SPIC selector (
6a2e731— fiscal product codes from a separate endpoint). - UI: form migration to react-hook-form, Zustand store + floating toolbar + product search/sort, Russification.
- Volume: 14 commits, ~11 user's, 3 weeks.
§04
Technical challenges
- iiko Cloud API integration (
d3a9e39): sync of terminals from iiko cloud into own DB. → API integration with a restaurant platform (cloud-based, vs plugin-based in ofdplugin). - Payment-type sync with external provider (
f0be309): per-organization sync (UzCard/Humo), card_type mapping, manual trigger from admin with notifications. → domain work with UZ payment systems. - SPIC codes (
6a2e731): selector for fiscal product classifiers (SPIC — mandatory fiscalization code in Uzbekistan). → knowledge of local fiscal specifics. - Multi-tenant RBAC (organizations + roles/permissions/users_roles/roles_permissions): full permission model on top of Elysia/Drizzle.
- Sync scope fixes (
5ba77cf— for one organization, not all) — correct tenant data isolation.
§05
AI-assisted development
- Sessions found: 13 .jsonl.
.claude/. - What was done with AI: building modules/syncs, form migration to react-hook-form, drizzle-kit v0.31 fixes (dialect/url), hoisting drizzle-orm types into root workspace. Clean descriptive commits.
- Pattern: Claude Code for rapid assembly of CRUD+sync backend on Elysia/Drizzle.
§06
Achievements & metrics
- Solo fiscal/payments backend in ~3 weeks: multi-tenant, RBAC, 3 syncs (payments/terminals/products), SPIC.
- Modern stack (Elysia/Bun/Drizzle/Redis/jose).
- Small volume; no metrics.