Architecture

How Comnestor Realtime moves an event from your backend to the browser.

The pipeline stays legible at every stage: request intake, persistence, queueing, signing, and websocket fan-out.

Step flow

Seven steps, one readable system.

01

Request arrives at the API endpoint

Your backend sends POST /api/events with the app key, channel name, event type, and JSON payload.

02

Validation and authentication

Laravel validates every field, resolves the app by key, and can reject invalid or rate-limited traffic immediately.

03

Event is logged

The payload is persisted for auditing, debugging, replay workflows, and operational analysis.

04

Metadata reaches Redis

Publish the event metadata to Redis so the system can observe and react in real time.

05

Background delivery is queued

A queue job handles the expensive delivery path so the API can respond with 202 Accepted quickly.

06

The worker signs and forwards to Reverb

The outgoing request is HMAC-signed and sent to the internal Reverb event endpoint with the payload attached.

07

Clients receive the event

Reverb matches the app and channel, then pushes the event to subscribed WebSocket clients instantly.

Map

The complete architecture flow.

This layout keeps the async handoff visible, which matters when diagnosing slow delivery or queue bottlenecks.

Backend Service
    │
    ├─→ POST /api/events
    │
    ▼
Laravel API (Validation)
    │
    ├─→ Event saved to DB
    ├─→ Publish to Redis pub/sub
    ├─→ Dispatch queue job
    │
    ▼ (Async)
Queue Worker
    │
    ├─→ HMAC sign request
    ├─→ POST to Reverb /apps/{id}/events
    │
    ▼
Reverb WebSocket Server
    │
    ├─→ Match clients (app_key + channel)
    ├─→ Broadcast via WebSocket
    │
    ▼
Frontend Clients
    │
    └─→ Receive event in real-time

Concepts

Four ideas that shape the whole platform.

App credentials

Each app has a distinct id, public key, and private secret. Only the backend ever uses the secret.

Channels

Channels define who should listen so subscriptions can stay focused and low-noise.

Event names

Use semantic event names such as order.created or message.sent so consumers remain clear and predictable.

Payloads

Every event carries JSON data, making the integration language-agnostic and easy to inspect.

Build from understanding

Ready to create the first app?

Once the flow is clear, the integration is straightforward: create the app, copy the key, and send the first event.