Web & Mobile App
Web (apps/web)
Section titled “Web (apps/web)”| Aspek | Nilai |
|---|---|
| Framework | Next.js 14 (App Router) |
| Deployment | Cloudflare Pages via @cloudflare/next-on-pages |
| Runtime | edge (export const runtime = "edge") |
Auth bridge
Section titled “Auth bridge”Proxy route /api/staff/[...path] meneruskan cookie session API (httpOnly)
sebagai Bearer token + device headers. Allowlist: /admin/*,
/auth/{login,logout,refresh,session}.
Integrasi API nyata (E2E terverifikasi)
Section titled “Integrasi API nyata (E2E terverifikasi)”- Katalog:
readCatalogDirectory→GET /admin/products - POS submit:
createPosOrderViaApi→POST /admin/orders - Orders read:
readOrderDirectoryFromApi→GET /admin/orders - Loyalty config:
GET/PATCH /admin/loyalty/config - Accounting:
GET /admin/accounting/{accounts,journal} - Vouchers:
GET/POST /admin/vouchers - Suppliers:
GET/POST /admin/suppliers - Portal publik:
GET /public/business/:slug - Laundry:
GET/POST /admin/laundry/* - Laporan jurnal:
readJournalEntriesFromApi→ laporan P&L/pajak
Setiap adapter mengembalikan undefined saat sesi/API tidak tersedia, sehingga
fixture demo tetap berfungsi sebagai fallback.
Mobile (apps/mobile)
Section titled “Mobile (apps/mobile)”| Aspek | Nilai |
|---|---|
| Framework | Expo Router + React Native |
| State | Zustand stores |
| Data | SDK repository ports (core/repository/) |
| Sync | Durable outbox + SDK mutations.apply/sync |
| API default | https://klola.treonstudio.workers.dev (EXPO_PUBLIC_API_URL) |
Sync runtime
Section titled “Sync runtime”apps/mobile/src/core/sync/mobile-sync-runtime.tsx→ outbox.repository.ts (durable queue)→ sdk-sync-transport.ts (SDK mutations.apply)→ sync.machine.ts (state machine)Command ID dipakai sebagai server idempotency key.