Skip to content

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 isA websocket server included with RapidMart, running on your serverA hosted service at pusher.com
CostFreeFree plan, then paid by connections and messages
NeedsA process that keeps running (a VPS or a host that allows it)Nothing on your server
  1. 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 be localhost on a live server.

  2. 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, run php artisan config:cache.
  3. 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=8080
    autostart=true
    autorestart=true
    user=www-data
    stopwaitsecs=10

    Then sudo supervisorctl reread && sudo supervisorctl update. Restart it (sudo supervisorctl restart rapidmart-reverb) whenever you change the realtime settings.

  4. 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 Certbot
    location / {
    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;
    }
    }
  5. 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.

  1. Create a Channels app at pusher.com and open its App Keys.
  2. Admin → Settings → Realtime → Pusher Channels — hosted service → paste the App ID, key, secret and cluster → Save realtime settings.
  3. 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.

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.

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 that https://ws.yourdomain.com reaches it through the proxy. A firewall or a missing Upgrade header 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 realtime queue. Fix the worker command, or turn on Send without the queue worker.
  • On shared hosting that doesn’t allow long-running processes, use Pusher.