Inspiration

What it does

How we built it

Challenges we ran into

Accomplishments that we're proud of

💡 Inspiration

Every retail store on the planet shares a single point of failure: fragile internet connectivity. When cloud POS systems lose connection, cash registers freeze, transactions fail, and customers holding cash are turned away. Traditional offline sync modes fail silently by dropping transactions, corrupting distributed inventory tallies, or relying on drifting system clocks.

We built NexusPOS Engine to deliver true, mathematically deterministic offline resilience: an event-sourced distributed retail engine that operates locally with zero latency, guarantees non-repudiation, and authoritatively resolves split-brain race conditions.


⚡ What it Does

  • Zero-Latency Offline Checkout: Operates completely offline with sub-millisecond checkout response times using a browser IndexedDB outbox.
  • Cryptographic Non-Repudiation: Generates asymmetric Ed25519/ECDSA keypairs locally via the native WebCrypto API to sign each transaction log, preventing tampering in browser storage.
  • Hybrid Logical Clock (HLC) Total Ordering: Establishes unambiguous causal event ordering across concurrent distributed registers without relying on NTP or wall clocks.
  • Resilient Negative Deficit Engine: Follows the AP trade-off of the CAP Theorem. Never blocks paying in-person customers; concurrent sales push stock into explicit negative deficits.
  • Autonomous Edge AI Auditor: Evaluates out-of-order event traces upon network healing, pinpoints the split-brain collision, and automatically generates an inventory backorder voucher.
  • Binary ESC/POS Hardware Bridge: Builds raw binary byte streams (1B 40, 1D 56 01) directly for WebUSB/WebSerial thermal receipt printers with idempotent reprint recovery.

🛠️ How We Built It

  • Architecture: Offline-First, Event-Sourced Distributed State Machine.
  • Frontend: Next.js 15 (App Router), React 19, TypeScript, Tailwind CSS.
  • Local Storage: IndexedDB with an asynchronous outbox queue and compaction engine.
  • Security & Clocks: WebCrypto API for client-side cryptographic signatures; custom monotonic Hybrid Logical Clock implementation.
  • Hardware Layer: Custom ESC/POS binary command encoder with paper-jam simulation and hardware telemetry state.
  • Testing & Quality Assurance: 30 comprehensive Vitest unit tests across 8 test suites verifying HLC monotonicity, deficit reconciliation, and event log compaction.

🚧 Challenges We Overcame

  1. Clock Drift in Distributed Nodes: Standard POS systems fail when offline terminal clocks disagree. We implemented an HLC combining physical wall-clock time with an incrementing logical counter to maintain monotonic causal order.
  2. Preventing Double-Spend Corruption: Rather than locking registers or rejecting sales during split-brain partitions, our ledger embraces explicit deficits and offloads resolution to an embedded causal AI auditor.
  3. Hardware Reliability Without Native Drivers: Generating low-level binary ESC/POS streams directly in the browser with raw hex debugging views and idempotent reprint capabilities.

🏆 Accomplishments that We're Proud Of

  • 100% deterministic offline checkout verified with 30 passing automated tests.
  • Full-fledged dual-terminal interactive chaos simulator embedded directly into the UI.
  • Production-grade deployment running globally on Vercel with zero external database dependencies at checkout.

🔮 What's Next for NexusPOS

  • Peer-to-peer WebRTC mesh synchronization between local registers without routing through any central WAN router.
  • Direct biometric cashier authentication integrated with WebAuthn.
  • Native POS hardware distribution as a standalone local-first desktop binary via Tauri/Rust. ## What we learned

What's next for NexusPOS Engine

Built With

  • distributed-systems
  • escpos
  • event-sourcing
  • indexeddb
  • next.js
  • react
  • tailwind-css
  • typescript
  • vitest
  • webcrypto
Share this project:

Updates

Submission history