Collaborative Document Editor

A local-first editor with a hand-rolled sync engine — built to find out what real-time collaboration actually costs. It is live, and you can open it.

SPECIFICATION BRIEFEXTRACTED
ARCHITECTURE
CRDT-based conflict resolution · Hand-written push/pull sync engine · Restore-as-diff version control
CONSTRAINT
Offline-first operation with deterministic state convergence upon reconnection
TRADEOFF
CRDT data-structure convergence over OT model complexity · Restore-as-diff over snapshot overwrite simplicity
STACK & SCOPE
Vitest · CIOffline-capable synchronization engine · State convergence testing · Owner/Editor/Viewer role model
STATE
LIVE
MODEL
CRDT
OFFLINE
YES
ROLES
3

Open it — it is running, and it works with the network off.

The problem

Two people editing one document is easy until one of them goes offline, keeps typing, and comes back. Everything interesting about collaborative editing is in that reconnection.

I wanted to understand it rather than install it, so the sync engine is mine.

The decisions

Conflict resolution runs on a rather than a transform-based model, which is what makes offline editing a property of the data structure instead of a feature I have to defend.

I wrote a , with a Vitest suite that asserts convergence rather than asserting that the UI looks right.

Version history restores as a diff rather than as a snapshot, so recovering an old version is an edit the other collaborators receive normally — not a write that silently discards whatever they did in the meantime.

The outcome

Deterministic merges, offline editing, restore-as-diff, and Owner / Editor / Viewer roles. Deployed with CI. It is the project on this site you can actually use, which is why it is here rather than in the list below.