StreamFusion — Two Transports, Because Sync and Signalling Are Different Problems
Peer-to-peer data channels for playback ticks, one WebSocket for everything the room has to agree on centrally.
The problem
Watch-party apps fail quickly when playback drift accumulates across devices, leading to broken group experiences and fragmented session state.
The solution
Built a room-based sync architecture using WebRTC data channels and WebSocket signaling, with reconciliation logic for playback state, queue coordination, and chat delivery.
Outcomes
- WebRTC data channels carry latency-sensitive sync events peer-to-peer, so a tick never has to round-trip through the server.
- A `ws` signal server shares a single Express port via `noServer: true`, rather than opening a second listener.
- `RoomManager` indexes rooms three ways — by id, by short join code and by peer — so membership is a map read in every direction.
+3 more in the write-up
Inside the write-up
- What a watch party actually has to solve
- Two transports, on purpose
- Rooms are three maps
- Client state is Zustand, and that is the point
- The honest gaps