Building Real-Time Kitchen Displays with WebSocket
When a waiter takes an order on a tablet and the kitchen display updates instantly — that's the magic of real-time communication. Here's how we built it for our Café & Restaurant Management system.
The Problem
Traditional restaurant systems rely on printed tickets or periodic polling. This creates delays, lost orders, and frustrated kitchen staff. We needed:
- Instant order delivery from POS to kitchen stations
- Live status updates visible to waiters and managers
- Station-based routing so each prep area sees only relevant items
- Zero message loss even during network hiccups
Our WebSocket Architecture
We chose WebSocket over Server-Sent Events (SSE) because we needed bidirectional communication — the kitchen needs to send status updates back to the POS.
Server Side (FastAPI + WebSocket)
Our FastAPI backend manages WebSocket connections per tenant:
- Each connected client joins a tenant-specific channel
- Order events are broadcast to all clients in the same tenant
- A Redis pub/sub layer ensures messages reach all server instances in a multi-process deployment
Client Side (React)
The kitchen display is a React application that:
- Maintains a persistent WebSocket connection with automatic reconnection
- Groups incoming orders by station (grill, drinks, desserts)
- Displays preparation timers with color-coded urgency levels
- Plays audio alerts for new orders
Handling Edge Cases
Real-time systems need to handle failure gracefully:
- 1Reconnection — Exponential backoff with jitter when the connection drops
- 2State reconciliation — On reconnect, fetch the latest state from the REST API
- 3Offline queue — If the kitchen marks an item as ready while offline, the status update is queued and sent on reconnection
- 4Heartbeat — Ping/pong every 30 seconds to detect stale connections
Results
After deploying the real-time kitchen display:
- Order-to-screen time: < 200ms (previously 30–60 seconds with polling)
- Lost orders: Zero (previously 2–3 per shift)
- Kitchen efficiency: 25% improvement in average preparation time
Lessons Learned
- Always implement reconnection logic — connections WILL drop
- Use a message broker (Redis) for horizontal scaling
- Test with realistic network conditions (throttled connections, intermittent drops)
- Audio alerts are surprisingly impactful for kitchen adoption
*Want to see our kitchen display system in action? Request a demo and we'll walk you through it.*