The platform uses WebSocket to push cluster state changes to the browser in real time. When a ClusterPersona is created, updated, or deleted, the UI refreshes automatically without a page reload.Documentation Index
Fetch the complete documentation index at: https://dorguai.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
How it works
Event flow
- The Kubernetes informer detects a change to a ClusterPersona resource
- The watcher sends an event to the WebSocket hub via a Go channel
- The hub broadcasts the event to all connected browser clients
- The React frontend invalidates the relevant React Query cache
- React Query refetches fresh data from the REST API
- The UI re-renders with the updated state
Event types
| Event | Trigger |
|---|---|
cluster.added | New ClusterPersona created |
cluster.updated | Existing ClusterPersona modified |
cluster.deleted | ClusterPersona removed |
Connection management
The frontend WebSocket hook manages the connection lifecycle:| Behavior | Detail |
|---|---|
| Auto-connect | Connects on app mount |
| Auto-reconnect | Retries after 5 seconds on disconnect |
| Cleanup | Closes connection on app unmount |
| Ping/pong | Server pings every 54 seconds, client responds |
| Pong timeout | 60 seconds before connection is considered dead |
Cache invalidation
On receiving a WebSocket event, the frontend invalidates:| Event | Invalidated query keys |
|---|---|
cluster.added | ['clusters'] (list) |
cluster.updated | ['clusters'] (list) + ['cluster', name] (detail) |
cluster.deleted | ['clusters'] (list) |
The WebSocket connection is for event notification only — it does not carry the full cluster data. The frontend always fetches fresh data from the REST API after receiving an event.
WebSocket API
WebSocket protocol specification
REST API
REST API that serves the data