A real-time Twitter/X dashboard should keep TweetStream API keys server-side, persist recent events, and render filtered enriched payloads in the browser.
Architecture
A production dashboard needs three layers: the TweetStream WebSocket consumer, a small event store, and a UI feed that can filter and replay recent events.
- Open the WebSocket from a server process
- Persist recent events for reconnects and page refreshes
- Push filtered updates to the browser over your own channel
Payload handling
Use TweetStream's content, metadata, and lifecycle messages as the canonical input. Keep raw payloads for debugging, then derive UI fields such as author, token mentions, OCR text, delete state, pin state, and price context.