Delivered remotely for a business based in Milan, Italy. Names withheld by agreement.
Project Overview
Industry: Hospitality POS & Kitchen Operations
Solution scope: A cross-platform restaurant point-of-sale, kitchen display, and central venue management system built with Flutter, Laravel, MySQL, Redis, and WebSockets.
Context: Multi-floor dining rooms and busy urban venues juggle high table turnover across floor tablets, bar printers, and staggered kitchen stations. Any pause at checkout, dropped ticket on a weak Wi-Fi corner, or uncoordinated table merge delays plates and skews shift closes. We engineered an offline-capable Flutter client paired with a Laravel and MySQL core to unify floor service, kitchen pacing, and multi-branch financial control.
Service Floor & Kitchen Bottleneck
Wireless dead zones stalled active tables. Thick walls and crowded dining rooms interrupted cloud-only POS tablets, freezing split-check screens during peak service.
Unstructured ticket routing overwhelmed the pass. Printing every order line to a single kitchen spooler without station filtering or course holds caused appetizers and mains to fire simultaneously.
Manual shift closes masked ingredient shrinkage. Reconciling paper Z-tapes against separate spreadsheet inventory logs hid modifier over-portions, void abuse, and unrecorded comps.
Fragmented branch catalogs complicated group updates. Updating seasonal prices, allergen tags, or VAT brackets required logging into isolated local servers per site.
Architectural Strategy
Adopt local-first state on floor terminals. Handheld Flutter devices commit table openings, modifiers, and course holds into embedded SQLite first, synchronizing deltas to Laravel asynchronously so service never waits on WAN latency.
Split order intake from kitchen routing and stock accounting. Interactive endpoints handle check persistence and immediate LAN printer or WebSocket dispatch, pushing recipe bill-of-materials deductions and exports onto Redis workers.
Use append-only order events to prevent overwrites. Line items and payment tenders append as immutable records keyed by client ULIDs rather than overwriting shared table blobs.
Centralize governance while keeping execution local. Menus, tax matrices, and staff policies publish from Laravel and MySQL, while terminals cache versioned snapshots locally and print directly to venue ESC/POS hardware over LAN.
Core Capabilities
- Interactive floor plan & table lifecycle: Drag-and-drop room layouts supporting table merges, split checks by seat or item, cover counts, and visual turn-time indicators.
- Modifier & course pacing engine: Nested mandatory and optional modifiers (cooking temperatures, allergies, side swaps) paired with fire-on-hold course triggers.
- Station-scoped Kitchen Display System (KDS): Dedicated Flutter displays for cold prep, hot line, bar, and expeditor pass featuring color-coded ticket aging and one-tap recall.
- Direct LAN thermal printing: Deterministic ESC/POS formatting for bar chits, duplicate kitchen slips, and itemized guest bills with automatic fallback printer routing.
- Recipe-level inventory depletion: Multi-unit bill-of-materials rules deducting raw ingredients per sold dish and modifier, including waste logging and supplier purchase orders.
- Shift drawer & Z-report reconciliation: Blind cash counts, card batch totals, void/discount reason auditing, and tamper-evident sequential fiscal check numbering.
- Multi-branch menu & tax overrides: Shared group item definitions with branch-specific pricing windows, happy-hour schedules, and regional VAT mappings.
Technical Architecture
Cross-platform Flutter terminals and KDS. A single Dart codebase compiles for Android handhelds, iPad counter stands, and landscape kitchen monitors. State management isolates UI rendering from a background sync engine that watches connectivity transitions and flushes pending SQLite outbox rows in strict causal order.
Laravel domain core & idempotent API. Laravel exposes versioned REST endpoints guarded by Sanctum device tokens and per-staff short PIN sessions. Every sync payload carries an idempotency key so tablet retries after packet loss never duplicate charges or kitchen fires.
MySQL transactional ledger. MySQL stores branch topologies, versioned menu manifests, open and settled checks, payment tenders, and append-only audit trails using InnoDB row-level locking and composite (branch_id, business_date, status) indexes for rapid shift queries.
WebSocket & Redis event fabric. Once Laravel persists a fired course or KDS bump, it publishes a lightweight room-scoped event into Redis, which broadcasts over WebSockets to floor tablets and kitchen screens so table statuses stay aligned across every device on the floor.
Flow: Waiter Flutter POS (SQLite outbox) → Laravel idempotent sync API → MySQL order & ledger store → Redis pub/sub & queues → WebSocket KDS screens & inventory workers
Technology Stack
| Category | Technology |
|---|---|
| Terminal & KDS client | Flutter and Dart powering handheld waiter tablets, fixed cashier counters, and wall-mounted kitchen displays |
| Local offline store | Embedded SQLite on POS devices buffering active table states, menu snapshots, and queued check mutations |
| Application API | Laravel (PHP 8.4) exposing idempotent order sync endpoints, shift reconciliation APIs, and back-office tooling |
| Relational database | MySQL storing branch catalogs, modifier trees, ledger transactions, recipe BOMs, and fiscal audit logs |
| Real-time dispatch | WebSockets backed by Redis pub/sub streaming course fires, table merges, and ticket bumps in sub-second loops |
| Queue processing | Redis queues executing ingredient stock deductions, end-of-shift Z-reports, and accounting exports asynchronously |
| Thermal printing | Direct LAN ESC/POS socket driver from Flutter terminals to bar, grill, pastry, and receipt printers |
| Back-office portal | Web console for menu scheduling, tax rule matrices, staff PIN permissions, and cross-branch margin views |
| Observability | Device heartbeat telemetry, sync conflict logs, and printer spool error tracking per venue |
Engineering Trade-offs & Solutions
| Challenge | Solution |
|---|---|
| Two servers adding items to the same table while partially offline risked overwriting each other's updates | Modeled order lines, modifiers, and payments as append-only events with client ULIDs so Laravel merges concurrent additions deterministically. |
| Cloud print queues stalled kitchen output whenever venue internet jittered | Built direct LAN ESC/POS socket printing inside Flutter with automatic peer failover to the main counter tablet if a printer port becomes unreachable. |
| Real-time recipe stock calculations slowed down check settlement transactions | Decoupled settlement from inventory: MySQL commits payment tenders immediately while Redis workers process BOM ingredient deductions off-thread. |
| Changing menu prices mid-shift caused discrepancies on open tables | Bound every open check line item to the menu version snapshot active at order entry so price edits apply cleanly to new orders only. |
| Kitchen displays flooded cooks with course-two mains before starters left the pass | Added hold-and-fire course states in Laravel and KDS bump hooks that highlight queued mains only when the expeditor releases the course. |
| High-frequency floor status polling overloaded PHP-FPM workers during dinner peaks | Replaced client polling with persistent WebSocket channels fed by Redis pub/sub, reserving REST calls for state mutations and reconnect catch-up. |
Security & Auditability
Dual-layer device and staff authentication. Terminals authenticate with revocable hardware certificates and branch-bound API tokens, while servers unlock screens via fast four-digit or NFC staff PINs that stamp every void, discount, and drawer open event with the exact operator identity.
Immutable void and discount trail. Once a line item is fired to the kitchen or printed, it cannot be silently deleted; removing it requires a supervisor-approved void record carrying a mandatory reason code that stays visible on shift audit reports.
Strict branch isolation. Middleware enforces venue scoping on every query and WebSocket channel subscription so managers at one location cannot read sales ledgers or alter floor configurations belonging to another branch.
Performance & Scale
Predictable rush-hour throughput. Partitioning read-heavy menu catalogs into cached Redis manifests and keeping MySQL write transactions narrow ensures dinner-rush check creation remains fast even when multiple branches close shifts simultaneously.
Bounded local storage on handhelds. Closed checks older than the current business day automatically prune from tablet SQLite caches after server acknowledgement, keeping handheld memory footprints lean across multi-month deployments.
Operational Outcomes
- Uninterrupted floor service during connectivity dips: Waitstaff continue opening tables, capturing complex modifiers, and printing bar chits locally without waiting on external internet recovery.
- Coordinated kitchen pacing across stations: Expeditors and line cooks work from synchronized, course-aware digital queues rather than deciphering mixed paper strips.
- Transparent shift accountability: Automated blind cash reconciliation, reason-coded voids, and recipe-linked inventory logs expose shrinkage early across every venue.
- Rapid multi-branch menu rollouts: Central operators publish seasonal price books and allergen updates once in the Laravel back office and roll them cleanly to every terminal between services.