Part of the GetFood4Less SaaS Ecosystem.

Realtime Order Stream (ActionCable & Redis Pub/Sub)

Live synchronization between customers, stores, and admins, powered by ActionCable and Redis Pub/Sub for real-time order updates.

⚡ Broadcast 💬 Turbo Streams

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

1

Incoming Event

A Store updates an order status, or a Customer places a new order triggering a backend event.

2

Broadcast via ActionCable

The backend publishes the update to a store-isolated channel, using Redis for speed.

3

Stimulus Controller Reacts

The client receives JSON payloads and performs live DOM mutations.

4

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.

Customer (Web/App) Store API / Rails Redis Pub/Sub Store Dashboard Business Admin Panel

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 ActionCable

Waiting for new orders...

👩‍💻 Customer View

Connected via ActionCable

No active orders yet.

Results