Skip to content
All work

SYNQ Workspace (Flux Whiteboard)

Web

A collaborative whiteboard that syncs drawing across clients at 60 fps.

Visit the site Source

flux-whiteboard.vercel.app
SYNQ landing page on a light grid: the word SYNQ in large serif type, Notebook and Whiteboard options, and an Enter workspace button

A real-time collaborative workspace with its own drawing engine. Local strokes render independently while state syncs across clients through a CRDT, which keeps sync lag out of the drawing loop.

Problem

Multiplayer whiteboards stutter and lag during fast drawing or when several people draw at once. Merging simultaneous edits while holding a high frame rate is a hard systems problem.

Approach

Yjs resolves shared state as a CRDT and WebRTC data channels sync peers directly. Firebase cursor updates are throttled, and local rendering is decoupled from remote state so drawing feels native on web and mobile.

React, TypeScript, Yjs, WebRTC, Firebase, Zustand

What I built

  • A drawing engine of its own: local strokes render independently of remote state.
  • Shared state held in a Yjs document, a CRDT, so simultaneous edits merge.
  • Peers synced directly over WebRTC data channels.
  • Firebase for cursor updates, throttled.
  • A tuned canvas render loop, with mobile touch events handled synchronously.

Architecture

Drawing renders locally; shared state syncs through Yjs over WebRTC; cursors go through Firebase.
Read the diagram as text
  1. Pointer and touch input to Local render loop
  2. Pointer and touch input to Yjs document (CRDT)
  3. Yjs document (CRDT) and WebRTC data channels, both ways
  4. WebRTC data channels and Peer clients, both ways
  5. Pointer and touch input to Throttled cursor updates
  6. Throttled cursor updates to Firebase
  7. Firebase to Peer clients

How a request flows

One stroke: it appears locally at once and reaches a peer through the CRDT.
Read the diagram as text
  1. You to Local render loop: draw a stroke
  2. Local render loop to You: stroke appears at once
  3. You to Yjs document: add the stroke to shared state
  4. Yjs document to WebRTC data channel: send the update
  5. WebRTC data channel to Peer: deliver the update
  6. Peer: merge it (CRDT)

Decisions and trade-offs

  • Yjs as the shared state

    WhyIt resolves simultaneous edits as a CRDT, so peers converge.

    CostIt needed a real understanding of operational transformation and CRDTs.

  • Render locally, decoupled from remote state

    WhySync lag stays out of the drawing loop, so drawing feels native on web and mobile.

    CostThe canvas render loop had to be tuned and touch events handled synchronously.

  • WebRTC data channels between peers, Firebase for cursors

    WhyPeers sync directly, and Firebase cursor updates are throttled.

    CostCursor positions travel on a second path from the drawing state.

What was hard

Collaborative editing needed a real understanding of operational transformation and CRDTs. Tuning the canvas render loop and handling mobile touch events synchronously changed how I approach frontend performance.

Screenshots

flux-whiteboard.vercel.app
SYNQ landing page on a light grid: the word SYNQ in large serif type, Notebook and Whiteboard options, and an Enter workspace button
SYNQ landing page on a phone: the word SYNQ above the tagline Thoughts, uncontained and the Notebook and Whiteboard options
Smart Helmet AppNext project