Theophilus John
See it running on the home page

04/05#phli-0004/052026Sole engineer

Philoi: Editing without locks

Real-time collaborative editor where concurrent edits converge without a lock.

clients converging
10
cold document open
~350 ms
permission layers
3

How it works, in 4 steps

  1. Three replicas edit one paragraph at once. Type, and you are the third.
  2. Every keystroke is a CRDT operation: no lock, and no server deciding who wins.
  3. The network delays and reorders delivery; every replica still ends up identical.
  4. The same holds at 10 clients, three dropping off and rejoining; a cold open takes ~350 ms.

Notes

Philoi is a collaborative document editor. Several people edit the same document at once, see each other’s cursors, and leave comments anchored to the text — plus sharing with roles, version history, search, folders and export.

Concurrent edits converge without locking and without a server deciding who wins. Edits are CRDTs, so two people typing in the same paragraph both end up with the same document and nobody’s keystrokes are discarded. A test rig starts the sync server with its shipping config, connects 10 headless clients to one document, drives randomized concurrent edits, takes three of them offline to keep editing and brings them back, then asserts that every client holds byte-identical state.

Permissions are enforced at three layers, because hiding the UI is not enforcement: the REST handlers check the caller’s role, the WebSocket handshake checks a short-lived, document-scoped token, and a viewer’s or commenter’s connection is read-only, so its edits reach neither the other clients nor Postgres.

Measured on a production build, a document opens cold in ~350 ms and warm in ~330 ms. Documents soft-warn at ~1 MB and are refused at ~10 MB.

Next.js 15 and TipTap on the front, Yjs and Hocuspocus for sync, Postgres via Prisma, NextAuth with Argon2id, and Cloudflare R2 for storage. Running on a DigitalOcean droplet behind Caddy at philoi.net.

Built with

  • Next.js 15
  • Yjs
  • Hocuspocus
  • Postgres
  • Cloudflare R2
Top00
Enargeia01
Dianome02
Homonoia03
Philoi04
Basis05
About06
Contact07
Fly the night/fly/
Fly freely/fly/#free
Enargeia — the full casepage
Dianome — the full casepage
Homonoia — the full casepage
Philoi — the full casepage
Basis — the full casepage
Enargeia liveenargeia.dev
Enargeia sourcegithub
Dianome livedianome.dev
Dianome sourcegithub
Dianome writeupdianome.dev/writeup
Homonoia livehomonoia.dev
Homonoia sourcegithub
Philoi livephiloi.net
Philoi sourcegithub
Basis sourcegithub
Copy email addresstheophilusjohn@gmail.com
Open the résumépdf
GitHub profilegithub
LinkedInlinkedin
Reduce motionoff
High contrastoff
Single-key shortcutson
Source of this sitegithub