realtime-state

Stream backend events into a client-side Zustand store via WebSocket.

Updated May 8, 2025
One-click install
npx skills add https://github.com/ez404-36/vroomly --skill realtime-state
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: realtime-state
Source: https://github.com/ez404-36/vroomly/tree/main/.agents/skills/realtime-state
Command: npx skills add https://github.com/ez404-36/vroomly --skill realtime-state

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keeps UI in sync with backend events by routing real-time updates through a predictable Zustand store and WebSocket gateway, eliminating manual polling and stale data.

Core Features & Use Cases

  • Real-time event ingestion: backend emits full entity payloads and the gateway broadcasts them to frontends per project.
  • Stable client stores: useShallow and useMemo patterns keep references stable while reflecting live changes.
  • End-to-end workflow: per-project load, live updates, and cleanup ensure the UI remains current across sessions.

Quick Start

Connect the frontend to the WebSocket gateway for a given project and observe live state updates in the Zustand stores.

Frequently Asked Questions about realtime-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I sync real-time UI updates with a Zustand store and WebSocket?

Real-time UI updates are synced by streaming backend events through a WebSocket gateway into a client-side Zustand store. This eliminates manual polling by routing full-entity payloads directly to project-specific store maps, ensuring instant state reflection.

Why does my Zustand store re-render the whole UI on every WebSocket event?

Excessive re-rendering occurs when store references change unnecessarily. Apply useShallow and useMemo patterns to maintain stable references while reflecting live changes, ensuring only the specific components dependent on the updated state re-render.

What's the best way to broadcast full entity payloads to frontend state?

Broadcasting full entity payloads is handled by a standardized WebSocket gateway that forwards events to frontends per project. Store actions then route these payloads to update the correct project maps within the client-side state.

Can I use this event-driven state management for admin panel dashboards?

Event-driven state management is designed for dashboards and admin panels where live task and schedule updates reflect instantly. It handles per-project loading, live updates, and cleanup to keep the UI current across sessions.

Do I need manual polling to keep frontend state current with backend events?

Manual polling is not needed because this approach routes real-time updates through a predictable Zustand store and WebSocket gateway. This eliminates stale data by streaming full-entity payloads directly from the backend to the frontend.