Overview
Realtime Order Stream is the live backbone of GetFood4Less. Sub-100 ms ActionCable broadcasts keep dashboards, Turbo Streams, and automated email updates in sync so every acceptance, prep time, or refund feels instant.
What I Built
Under the hood of a fully realtime ecosystem
A scalable WebSocket layer powered by ActionCable +
Redis, handling high-throughput broadcasting with ease.
Realtime channels for orders, notifications, and status updates each isolated per Store ID for maximum performance.
Stimulus controllers orchestrating live DOM updates using Turbo Streams, ensuring everything updates without reloading.
Role-aware subscriptions so Stores, Customers, and Admins only receive the messages intended for them.
Resilient reconnection logic featuring exponential backoff to guarantee smooth recovery from WebSocket interruptions.
Turbo Streams delivering instant partial updates, enabling DOM patching, animations, and UI synchronization across clients with zero reloads.
How It Works
The lifecycle of a realtime event across the platform
Incoming Event
A Store updates an order status, or a Customer places a new order triggering a backend event.
Broadcast via ActionCable
The backend publishes the update to a store-isolated channel, using Redis for speed.
Stimulus Controller Reacts
The client receives JSON payloads and performs live DOM mutations.
UI Syncs Instantly
Turbo Streams patch partials, animating updates without reloading the page.
Architecture
The realtime architecture follows a clean separation of concerns between models, channels, and frontend event consumers.
Flow: Customers and Stores exchange events through ActionCable.
Redis orchestrates message fan-out for all connected dashboards.
Demo
Realtime Order Flow Simulation
A side-by-side look at how ActionCable updates both Store and Customer views instantly.
🍔 Northern Burgers — Store Dashboard
Connected via ActionCableWaiting for new orders...
👩💻 Customer View
Connected via ActionCableNo active orders yet.
📩 Email Received
Subject: Your order is being prepared!
Hi there 👋
Your order #845 was accepted by Northern Burgers.
Estimated prep time: 25 minutes.
Results
-
⚡
Average update latency: < 100ms end-to-end.
-
🚀
Zero downtime: Redis handles spikes of 500+ concurrent orders.
-
💬
Instant user feedback: Orders update live on dashboards and customer browsers.
-
📩
Automated communication: Store actions trigger email + push notifications instantly.
-
🧩
Reusable infrastructure: The same WebSocket engine powers chat, availability, scheduling, and admin tools.