You are the lead architect and engineer for this repository. Read this file fully before every task.
docs/SPEC.md — the original master specification (business requirements). Never violate it.docs/ARCHITECTURE.md — chosen stack and the decisions resolving contradictions between the spec and the hosting.docs/DATABASE.md, docs/SECURITY.md, docs/DEVICE_PROTOCOL.md, docs/DEPLOYMENT.md.docs/ROADMAP.md — phases and per-phase acceptance criteria.docs/PROGRESS.md — what is done. Update it at the end of every work session.If the SPEC and ARCHITECTURE disagree, ARCHITECTURE wins only where it explicitly documents the reason (hosting limits). Otherwise stop and ask the owner.
The owner will write messages like “Phase 3 ni boshla” or “Phase 3 davom et”. For each phase:
composer test, npm test, pio test as relevant). Fix failures.phase-N-short-name and open a PR into main with a checklist of acceptance criteria.
The owner authorized Claude (2026-09-30) to merge the PR itself — the owner does not merge. Merge only when CI is green on the PR head and no critical errors remain; use a merge commit. A PR may also be merged mid-phase when the owner needs something from main (e.g. a manual workflow), as long as CI is green..env.example. Telegram tokens are encrypted at rest.tenant_id + composite FKs (see DATABASE.md).apps/api Laravel 13 backend (REST API, scheduler, Telegram, storage)
apps/web-admin React + Vite + TS SPA (Super Admin + Client Admin)
apps/tablet React + Vite + TS PWA (customer kiosk UI)
apps/android-kiosk Kotlin WebView shell (Lock Task / kiosk, auto-start, camera)
devices/esp32 PlatformIO (Arduino-ESP32) firmware
packages/protocol JSON Schemas + TS types for tablet & device protocol (single source)
infrastructure/ deployment scripts, cron definitions, backup scripts
docs/ all documentation
.github/workflows/ CI (tests), build (web, apk, firmware), deploy
cd apps/api && composer install && php artisan test (needs a real DB; phpunit.xml defaults to MySQL on 127.0.0.1:3306 root/root db bilyart_test). All three engines locally: scripts/test-all-db.sh --start once, then scripts/test-all-db.sh. Style: vendor/bin/pint --testcd apps/web-admin && npm ci && npm test && npm run typecheck && npm run build (PWA under /admin/, dev server proxies /api to :8000)cd apps/tablet && npm ci && npm test && npm run typecheck && npm run build (PWA under /tablet/, dev server :5174 proxies /api). Setup for halls: docs/TABLET_SETUP.mdcd devices/esp32 && pio test -e native && pio run -e esp32dev (no PlatformIO registry access, e.g. in the cloud dev container: scripts/native-test.sh; CI builds the .bin). After changing certs/: python scripts/make_ca_bundle.pycd apps/android-kiosk && gradle assembleRelease lintRelease); signed APK only in “Release package” (infrastructure/release/build-kiosk.sh, secrets KIOSK_KEYSTORE_BASE64 / KIOSK_KEYSTORE_PASSWORD). Setup: docs/TABLET_SETUP.md §Acd packages/protocol && npm ci && npm test && npm run typecheck && npm run check-generated (after editing schemas: npm run generate)infrastructure/hosting-check/tests/run.sh (build for owner: Actions → “Hosting check (build file)”)infrastructure/release/build.sh <version> [out] (owner: Actions → “Release package”). Deploy-script test: DB_CONNECTION=… DB_HOST=… DB_PORT=… DB_DATABASE=… DB_USERNAME=… DB_PASSWORD=… infrastructure/deploy/tests/run.sh. Hosting install/update: docs/DEPLOY_UZ.mdgitleaks git --redact . (runs in CI)composer audit --no-dev, npm audit --omit=dev --audit-level=high (web-admin, protocol). Security test map: docs/TESTING.mdphp artisan user:2fa-reset <login>