Live Collaborative CRDT Editor — Real-time sync across all connected clients

Where Documents
Think in Real-Time

A production-grade collaborative editor demonstrating Conflict-Free Replicated Data Types, Lamport vector clocks, and deterministic CRDT replay — the exact algorithms used at Notion, Figma, and Google Docs.

CRDT Update #1,000
Δt ≈ 2ms
Lamport clock 800
Technical Architecture

Every feature, production-grade

Not a toy. Every system demonstrates real distributed computing concepts.

Core Architecture

CRDT-Powered Sync

Built on Yjs — a production-grade CRDT library. Every keystroke is an atomic operation encoded as a Lamport-clocked binary update that auto-merges across any network partition.

Real-Time

Sub-10ms Awareness

WebSocket-based Hocuspocus server broadcasts presence state instantly. See collaborators' cursors, selections and names update in real-time with zero polling.

Deterministic Replay

Atomic Operation Replay

Every snapshot stores the full Yjs update binary. Hit Replay to watch the document reconstruct itself character-by-character — visually proving CRDT convergence.

Git-Style Branching

Document Branching

Fork any document at any point in time. Branch state is encoded as a Yjs binary update and propagated via the Hocuspocus WebSocket — zero data loss guaranteed.

AI Native

Streaming AI Co-Author

FastAPI backend proxies to an LLM with Server-Sent Events (SSE) streaming. Rewrite, summarize, continue, or fix grammar — AI output streams token-by-token into the editor.

Persistence Layer

PostgreSQL + Redis Pub/Sub

FastAPI + SQLAlchemy persists documents and snapshots. Redis Pub/Sub backplane enables horizontal scaling across multiple Hocuspocus nodes.

Stack

Production-grade technology

Next.js 16
React framework
Tiptap v3
Rich text editor
Yjs
CRDT library
Hocuspocus
WS CRDT server
FastAPI
Python backend
PostgreSQL
Primary database
Redis
Pub/Sub backplane
TypeScript
End-to-end types

Open the document editor now

Create a document, type some text, open a second tab — watch CRDTs sync in real-time.

Launch Editor