Realtime (Reverb or Pusher)
Realtime pushes new orders, status changes, rider positions and chat messages the moment they happen. It is optional: without it every screen refreshes on a timer (every 10 to 60 seconds), so nothing breaks, it’s just slower.
All channels are private: an app only receives updates for orders it is part of.
| Reverb (recommended) | Pusher | |
|---|---|---|
| What it is | A websocket server included with RapidMart, running on your server | A hosted service at pusher.com |
| Cost | Free | Free plan, then paid by connections and messages |
| Needs | A process that keeps running (a VPS or a host that allows it) | Nothing on your server |
Reverb
Section titled “Reverb”-
Pick a public address for the websocket, for example
ws.yourdomain.com(or your main domain on its own path through the proxy below). Phones must be able to reach it, so it can’t belocalhoston a live server. -
Admin → Settings → Realtime → Reverb — self-hosted on your server.
- Public host:
ws.yourdomain.com - Public port:
443 - Scheme:
https / wss - Leave the App ID, key and secret empty: they are generated on save.
- Save realtime settings. This writes the
REVERB_*lines in.env(.env settings). If your config is cached, runphp artisan config:cache.
- Public host:
-
Run the Reverb server under Supervisor, so it restarts by itself:
/etc/supervisor/conf.d/rapidmart-reverb.conf [program:rapidmart-reverb]command=php /var/www/rapidmart/artisan reverb:start --host=127.0.0.1 --port=8080autostart=trueautorestart=trueuser=www-datastopwaitsecs=10Then
sudo supervisorctl reread && sudo supervisorctl update. Restart it (sudo supervisorctl restart rapidmart-reverb) whenever you change the realtime settings. -
Proxy HTTPS to it. With Nginx, a server block for the websocket host (get its certificate with Certbot as for your main domain):
/etc/nginx/sites-available/rapidmart-ws server {listen 443 ssl;server_name ws.yourdomain.com;# ssl_certificate lines added by Certbotlocation / {proxy_http_version 1.1;proxy_set_header Host $http_host;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "Upgrade";proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_read_timeout 60s;proxy_pass http://127.0.0.1:8080;}} -
Run the queue worker with the realtime queue first:
php artisan queue:work --queue=realtime,default(Server setup). Updates are sent from the queue.
The Realtime page then shows Live · Reverb.
Pusher
Section titled “Pusher”- Create a Channels app at pusher.com and open its App Keys.
- Admin → Settings → Realtime → Pusher Channels — hosted service → paste the App ID, key, secret and cluster → Save realtime settings.
- Run the queue worker with
--queue=realtime,default, as above, or turn on Send without the queue worker (below).
The Realtime page then shows Live · Pusher.
Without a queue worker (shared hosting)
Section titled “Without a queue worker (shared hosting)”Updates normally go out through the queue worker. If your hosting can’t keep a worker running all
the time (most shared hosting), turn on Send without the queue worker on the Realtime page
(BROADCAST_SYNC=true in .env). Each page then sends its updates straight after it has answered,
so nobody waits for the realtime server, and updates arrive instantly without a worker.
Leave it off when you run the worker under a process manager: then the worker sends updates and pages answer a little faster. Other queued work (emails, push notifications) still needs a worker or a cron job either way.
The apps
Section titled “The apps”Nothing to set in the apps. They ask your server for the realtime settings when they start
(/api/realtime/config), so changing from Reverb to Pusher, or turning realtime off, needs no new
app build.
It says “Incomplete · apps poll” or stays offline
Section titled “It says “Incomplete · apps poll” or stays offline”- Check that the keys and the public host are filled in and saved.
- Reverb: check the process runs (
sudo supervisorctl status) and thathttps://ws.yourdomain.comreaches it through the proxy. A firewall or a missingUpgradeheader in the proxy is the usual cause. - No updates arrive but it says Live: the queue worker isn’t running, or doesn’t include the
realtimequeue. Fix the worker command, or turn on Send without the queue worker. - On shared hosting that doesn’t allow long-running processes, use Pusher.