Resort POS: Offline-First Resort Management & Audit System — Resort POS Front-Desk & Unit Availability Dashboard

Resort POS: Offline-First Resort Management & Audit System

Web App
Node.js
Cloudflare Workers
SQLite
IoT
AI
Security
C++
ArchitectureOffline-First Edge

Local SQLite + Cloudflare D1 30s background sync engine

Security GradeSHA-256 HMAC

Cryptographic hash-chained audit log & signed QR receipts

Hardware IoTESP32 C++ Gate

Automated vehicle loop & lift counter with tamper detection

On-Device AIMediaPipe Vision

Offline in-browser person detection for staff attendance

About the Project

Resort POS & Management System is a full-stack, offline-first Point of Sale (POS) and property management system engineered specifically for cash-heavy resorts and hospitality venues. Built to operate seamlessly during local internet outages while mirroring data to a Cloudflare Workers + D1 serverless cloud every 30 seconds for remote owner visibility, its primary innovation is an anti-skimming architecture that cryptographically secures transactions and cross-references sales against physical gate entries and housekeeping statuses. Key Technical & Architectural Pillars: 1. Local-First Edge Synchronization: Engineered a resilient local server environment using Node.js and SQLite running locally on the resort network (LAN). Transactions complete instantly with zero internet latency, while a background synchronization daemon pushes incremental changes to a Cloudflare Workers + D1 serverless edge database every 30 seconds for remote owner monitoring. 2. Cryptographic Audit Trail & Signed QR Receipts: Implemented a SHA-256 hash-chained audit log that makes local database tampering mathematically impossible to hide. Every generated guest receipt carries an HMAC-signed QR code that gate guards and guests scan to verify exact items and total amounts paid, instantly exposing forged or altered physical receipts. 3. IoT Gate Counter & Hardware Telemetry: Developed custom C++ firmware for an ESP32 microcontroller that independently counts vehicle entries and exits using inductive loops and arm switches. The system automatically cross-references gate sensor pulses against scanned QR receipts to flag undocumented entries, tailgating, or gate holding. 4. On-Device AI Desk Attendance Monitoring: Integrated Google MediaPipe (EfficientDet-Lite) directly into the browser to run real-time, offline computer vision via desk webcams. Automatically flags unattended desk periods or camera tamper events without storing or transmitting any video footage, adhering to Philippine Data Privacy Act (RA 10173) mandates. 5. Anti-Skimming Decentralized Workflow: Decentralizes operational control across isolated user roles (Front Desk Cashier, Gate Guard, Housekeeping). If a cashier collects cash off-the-books, the gate scan fails. If cashier and gate collude, housekeeping flags unbilled usage on release. Every workflow traps fraudulent behavior. 6. Philippine Regulatory & Statutory Compliance: Supports BIR TRAIN Law tax compliance, mandatory Senior Citizen/PWD statutory discounts (20% discount + ID tracking), and role-based data masking.

Challenges

Architecting an offline-first synchronization engine between a local SQLite database and Cloudflare D1 edge database while guaranteeing an unbroken SHA-256 hash-chained audit trail. Solved by implementing strict transaction-level HMAC signatures, no-delete SQLite database triggers, and audit ledger state validation on every edge push.

Learnings

Mastered offline-first local network architecture, SHA-256 cryptographic audit chains, Cloudflare Workers & D1 serverless edge deployment, embedded ESP32 C++ hardware telemetry, and on-device MediaPipe computer vision integration.

What I'd Do Differently

Relying on a 30-second polling interval for cloud replication created brief synchronization lag between physical desk check-ins and remote owner dashboard updates during high-density gate queues. I would replace polling with a WebSocket/WebRTC fallback connection when online to push instant live events. Additionally, transitioning the ESP32 hardware telemetry from raw socket byte payloads to an MQTT publish-subscribe architecture over TLS would simplify multi-gate hardware expansion.

Development Journey

Phase 1: Local Core & Hash LedgersWeeks 1-2

SQLite POS Engine & SHA-256 Audit Chains

Engineered high-speed local Express.js/SQLite backend with trigger-enforced immutable ledgers and SHA-256 hash chains.

Phase 2: Edge Sync & ReplicationWeeks 3-4

Cloudflare Workers & D1 Mirroring

Built incremental edge sync pushing resort sales metrics and audit logs to Cloudflare D1 every 30 seconds.

Phase 3: Hardware IoT & Browser AIWeeks 5-6

ESP32 Firmware & MediaPipe Monitor

Programmed ESP32 C++ inductive loop gate counters and embedded Google MediaPipe vision into cashier UI for offline staff monitoring.

Phase 4: Multi-Role UI & ComplianceWeeks 7-8

Role-Based Frontends & Statutory Compliance

Designed tailored interfaces for Cashier, Gate, and Housekeeping roles with BIR Senior/PWD discount compliance.

    Meshary AI

    Gemini 2.5 Flash

    Portfolio Assistant

    Hello! I'm Meshary AI, your interactive portfolio assistant powered by Gemini. Ask me anything about Meshary's software projects, n8n automation workflows, or technical skills!

    08:51 AM