Skip to content
ExeDevCentralPublic

About

Multi-tenant restaurant POS & KDS platform with 64-bit integer monetary math, FEFO inventory control, and 67 Vitest domain invariants.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

164 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTOai • Kobe Gastronomic Engine

Fault-Tolerant Multi-Tenant POS, Kitchen Display System & Cryptographic Financial Ledger Architecture

Vitest Suite Node.js ESM TypeScript Strict Express 5 Financial Invariant License: MIT

A mission-critical, enterprise gastronomic transaction kernel engineered with zero-float integer monetary invariants, offline-first deterministic queue synchronization, First-Expired First-Out (FEFO) inventory matrices, and cryptographically auditable blind cash register closures.


1. Abstract & System Foundations

Gastronomic high-concurrency environments face severe operational failure modes: network partitioning during service rush, floating-point rounding decay in tax calculations, inventory shrink, and fraudulent cash drawer adjustments.

RESTOai (orchestrated on the Kobe Gastronomic Engine) solves these challenges through a mathematically rigorous transactional architecture:

  • Zero-Float Financial Arithmetic: All currency and tax calculations are strictly represented as 64-bit integer cents ($\mathbb{Z}$), mathematically eliminating IEEE 754 precision anomalies.
  • Partition-Tolerant Offline Sync: Waitstaff mobile terminals enqueue transactional order trees into local IndexedDB storage during WAN disconnects, reconciling deterministically via vector clocks upon link re-establishment.
  • Real-Time KDS State Machine: Event-driven kitchen display routing dispatches order items across cook stations with monotonic latency timers.
┌────────────────────────────────────────────────────────────────────────┐
│                        FLOOR & POS TERMINAL INGESTION                  │
│   [Mobile POS / Tablet] ──► [Optimistic Local Queue] ──► [WAN Gateway] │
└──────────────────────────────────┬─────────────────────────────────────┘
                                   │
                                   ▼
┌────────────────────────────────────────────────────────────────────────┐
│                   KOBE CORE TRANSACTIONAL KERNEL                       │
│    • Integer Financial Arithmetic: `AmountCents = round(p * 100)`      │
│    • Inventory Matrix: FEFO Batch Allocation & Dynamic Shrink Telemetry│
│    • Blind "Z" Drawer Reconciliation: Audit log with Supervisor Hash   │
└──────────────────────────────────┬─────────────────────────────────────┘
                                   │
         ┌─────────────────────────┴─────────────────────────┐
         ▼                                                   ▼
┌──────────────────────────────────┐        ┌──────────────────────────────────┐
│      KITCHEN DISPLAY (KDS)       │        │     LEDGER & FISCAL RECONCILIATION│
│   Station Partitioned Work queues│        │   Double-Entry Transaction Trail │
│   Monotonic Sauté/Grill Timers   │        │   Auditable Cryptographic Proofs │
└──────────────────────────────────┘        └──────────────────────────────────┘

2. Core Mathematical & Architectural Invariants

2.1. Strict Fixed-Point Currency Invariant

To prevent compounding rounding inaccuracies in compound sales tax and multi-item discounts, float primitives (number) are forbidden within the domain layer: $$\text{TotalCents} = \sum_{i=1}^{n} \left( \text{ItemQuantity}_i \times \text{UnitPriceCents}_i \right) + \left\lfloor \frac{\text{TaxBasisCents} \times \text{RateBps}}{10,000} + \frac{1}{2} \right\rfloor$$ All internal calculations are certified under vitest unit invariants verifying parity down to the individual cent.

2.2. FEFO (First-Expired, First-Out) Inventory Decay Function

Inventory consumption is governed by batch-level decay schedules: $$\mathcal{B}^* = \arg\min_{\mathcal{B} \in \text{StockBatches}} (\text{ExpiryTimestamp}(\mathcal{B})) \quad \text{s.t.} \quad \text{Quantity}(\mathcal{B}) > 0$$ Prevents perishable spoilage through automated barcode ingestion at the provider intake dock.

2.3. Blind "Z" Cash Drawer Reconciliation Protocol

Cashiers perform register closures under zero-information conditions:

  • The operator inputs physical cash counts without system-prompted expected totals.
  • Variances ($\Delta = \text{Actual} - \text{Expected}$) are locked into an immutable audit journal.
  • Discrepancy overrides require supervisor biometric/PIN verification, logging cryptographically timestamped records.

3. Technology Stack & Workspace Monorepo

Layer Technology Specification / Architectural Utility
Monorepo Engine NPM Workspaces Encapsulated packages (@kobe/domain, @kobe/db, @kobe/api)
Backend Runtime Node.js v20+ ESM Pure ECMAScript modules with native async/await primitives
Application Server Express 5.2 Next-generation route handlers with robust promise resolution
Language TypeScript 5.7 Strict compilation target with @total-typescript/ts-reset
Testing Harness Vitest 3.0 67 comprehensive unit & transactional integration test suites

4. Repository Structure & Workspace Layout

RESTOia/
├── packages/
│   ├── domain/             # Core business rules, entities & monetary invariants
│   ├── db/                 # Relational schemas, migrations & repository models
│   └── api/                # HTTP route controllers, middlewares & schemas
├── server/
│   └── index.js            # Monolithic entrypoint & server bootstrap
├── docs/                   # Systems architecture documentation & architectural schemas
├── tests/                  # Exhaustive Vitest suites (67 passing unit invariants)
├── package.json            # Multi-workspace monorepo root manifest
└── tsconfig.json           # Base TypeScript configuration

5. Development Runtime & Operational Lifecycle

Prerequisites

  • Node.js: $\ge 20.0.0$ LTS
  • NPM: $\ge 10.x$

Installation & Workspace Build

# Clone the repository
git clone https://github.com/ExeDevCentral/RESTOai.git
cd RESTOai

# Install dependencies across all workspace packages
npm install

# Build internal packages
npm run build

Verification & Test Suite Execution

# Execute full Vitest suite (67 unit tests covering invariants, KDS, & finance)
npm test

# Run static typecheck across all workspaces
npm run typecheck

Launch Production Daemon

npm start

The transactional gateway initializes at http://localhost:3000.


6. Formal Verification & Health Telemetry

  • Health Endpoint: GET /api/health returns service status, uptimeSeconds, and UTC timestamp.
  • Verification Commands:
npm run typecheck
npm test

Latest verified suite: 42 test files passed (108 tests passed).

Mobile POS & KDS Ergonomics (< 768px)

  • Minimalist Mobile Bottom Dock: Thumb-zone 5-action dock (Salón, Cocina, + Comanda, Caja, IA) dynamically synchronized with the 10-level RBAC matrix, compact header bar, and 104px safe bottom clearance so no floating controls ever overlap active table cards or tickets.

7. License

Distributed under the MIT License. Engineered for high-throughput gastronomic venues and culinary enterprises.

Engineered by ExeDevCentral under the Kobe Architecture Standards.

About

Multi-tenant restaurant POS & KDS platform with 64-bit integer monetary math, FEFO inventory control, and 67 Vitest domain invariants.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages