Second-Screen Broadcast Synchronization and Live Web Polling Framework
Develop a high-throughput synchronized second-screen polling, voting, and interactive web companion architecture.
Use this template when building synchronized second-screen web applications for live television shows, esports tournaments, or interactive broadcast events. It standardizes timecode synchronization, traffic shock absorption, and live content state updates.
Role: Lead Frontend Real-Time Systems Engineer with deep expertise in WebSocket mesh networks and broadcast synchronization.
Context
- Broadcast Entity: {{broadcast_network}}
- Real-Time Communication Engine: {{websocket_gateway_engine}}
- Client UI Framework: {{frontend_ui_library}}
- Master Timecode Source: {{sync_timecode_source}}
- Peak Transaction Burst: {{expected_burst_transactions}}
- Content Moderation Architecture: {{moderation_pipeline}}
Task
Produce a resilient second-screen broadcast synchronization and live polling framework for {{broadcast_network}} that maintains sub-second interactive sync with {{sync_timecode_source}} while processing {{expected_burst_transactions}} on {{frontend_ui_library}}.
Method
- Establish time-drift compensation algorithms pairing client system clocks with {{sync_timecode_source}} over NTP/WebRTC data channels.
- Architect a bi-directional event bus through {{websocket_gateway_engine}} to fan out broadcast trivia, live polls, and viewer reactions.
- Formulate client-side write-behind queuing and optimistic UI updates to sustain {{expected_burst_transactions}} without UI freezing.
- Design server-side traffic shedding and delta-compression protocols to preserve message throughput during viral voting spikes.
- Integrate interactive payload filtering with {{moderation_pipeline}} before public stream aggregation.
- Structure a seamless fallback mechanism to Server-Sent Events (SSE) and HTTP/3 long-polling if WebSocket connections degrade.
- Detail state-reconciliation logic for viewers joining mid-broadcast or recovering from brief network disconnects.
Constraints
- MUST maintain client UI interactivity at a minimum of 60 FPS on mobile browsers during peak inbound message bursts.
- MUST NOT broadcast unmoderated freeform user submissions that bypass {{moderation_pipeline}}.
- MUST synchronize interactive cues within 250ms of {{sync_timecode_source}} across 95% of active web clients.
- Network reconnection routines must utilize randomized exponential backoff to prevent thundering herd crashes.
Output format
- Synchronization Protocol Spec: Drift calculation mathematical model and clock-alignment handshake.
- High-Throughput Event Lifecycle: Ingestion, buffering, aggregation, and broadcast topology (max 300 words).
- Reconnection and State Recovery Matrix: Table defining disconnect durations, cache strategies, and reconciliation actions.
- Moderation and Rate Limiting Architecture: Structural rules for inbound vote and comment throttling.
Self-review
- Verifies that optimistic UI updates on {{frontend_ui_library}} accurately reconcile with delayed server confirmations.
- Confirms {{websocket_gateway_engine}} failover does not drop active user vote tallies.
- Validates timecode parsing integrity when broadcast video latency varies across regional distributions.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.