
BIG MARKET POS — ARCHITECTURE & EVIDENCE BRIEF
CONCURRENT CASH CHECKOUT PIPELINE (POSTGRESQL 17)
- 1. STAFF AUTHRate-Limited Login
- 2. IDEMPOTENCYDuplicate Guard
- 3. ROW LOCKPG17 Stock Lock
- 4. SERVER CALCHPP & Change
- 5. RECEIPT + LOGPrintable Struk
01 // PROBLEM
Multi-branch retail checkout terminals suffer oversold inventory, race conditions under simultaneous cashiers, client-tamperable totals, and unverified branch cash expenses.
02 // SOLUTION
Built an Indonesian-localized (IDR, Asia/Jakarta) Laravel 13 POS and supermarket inventory system with branch-scoped RBAC, transactional stock updates, cash checkout receipts, HPP profit reports, and expense approval workflows.
03 // TECHNICAL ARCHITECTURE
PHP 8.3 + Laravel 13 targeting PostgreSQL 17, using Blade + Tailwind CSS 4 + Vite on the frontend, interactive `app:bootstrap` CLI provisioning (zero default demo credentials), and PHPUnit 12 suites across SQLite and live PostgreSQL.
04 // INDIVIDUAL CONTRIBUTIONS
Independently architected and implemented with AI coding-agent assistance; Daniel owns concurrency locking design, branch permission boundaries, and PostgreSQL test verification.
05 // DESIGN DECISIONS
Calculated line prices, discounts, taxes, and HPP strictly server-side inside PostgreSQL `FOR UPDATE` row locks while gating expense approvals against self-approval.
06 // SECURITY CONSIDERATIONS & CAVEATS
Rate-limited staff login, session regeneration, inactive-account rejection, idempotent checkout keys, and branch isolation. Scope note: vendor purchasing, cashier shift open/close, refunds, and payment gateways remain outside the current v1 scope.
07 // TEST EVIDENCE
55 PHPUnit tests (222 assertions) passed against PostgreSQL 17 including concurrent checkout and row-locking tests; `npm run build` and Laravel `pint` passed.
08 // CHALLENGES & TRADE-OFFS
Strict `FOR UPDATE` row locking prevents negative stock under parallel checkouts at the cost of waiting on hot SKUs during simultaneous branch sales.
09 // REPOSITORY: https://github.com/0xyz-exe/big-market-pos · MIT