‹ All projects
BuiltLive demoReal-time collaboration

Live collaborative editor (CRDT)

Google-Docs-style real-time editing with no server: a CRDT keeps every copy in agreement, even after offline edits. Syncs live between browser tabs.

The problem

Real-time collaboration usually needs a central server to order edits. Offline edits then conflict. A CRDT removes the server from correctness: any copy can merge any edit, in any order.

How it works

  1. 01Keystroke
  2. 02Diff → operations
  3. 03Unique ids (Lamport)
  4. 04Broadcast
  5. 05Merge (RGA)
  6. 06Same text everywhere

What was hard

  • The RGA merge rule places concurrent inserts the same way on every copy; deletes are tombstones, so late edits still find their place.
  • Operations that arrive before what they depend on wait in a buffer; duplicates are ignored — so the network can reorder or repeat anything.
  • Cursors are anchored to character ids, so your caret does not jump when someone types before it; emoji are never split in half.

The result

Property tests run 60 random sessions of three copies editing offline with shuffled, duplicated delivery — every one converges. Open the page in two tabs and they edit together live.

Built with

JavaScriptRGA CRDTBroadcastChannelReactnode:test