sanyam.
Monaco · AshainterviewerMonaco · RavicandidateOT clientin flight + bufferOT clientin flight + bufferWebSocketDocker · Renderserver documenttransform · rev logroom of 2–4roles · presencePostgressaved rooms · replayack + transformed ops to the otherstransform · concurrent edits convergerev nA · insertB · deleteB′A′same text on every screen2 typists · ~90 ms network · live sitere-broadcast49% lostDuet (OT)0 lost54× fewer bytes per keystroke80.7 vs 4,320200 bots · 50 rooms · ~1,300 edits/s · p95 under 3 ms · 30,000 tests per push
two people typingMonaco, a cursor colour eachops, not the whole fileretain, insert, delete over WebSocketserver transformsagainst its revision logevery edit lands oncewhole-file re-broadcast lost 49%1,300 edits a second, p95 under 3 ms.
All projects

Duet

Live Coding-Interview Room

Most interview pads re-send the whole file on every keystroke, so two people typing at once overwrite each other. Duet sends each edit as an operation and transforms concurrent ones against each other, so every edit lands exactly once, even across a dropped connection.

Result
0 lost keystrokes (re-broadcast: 49%)
1,300 edits/s, p95 under 3 ms
30,000 convergence tests per push
What it does

A live coding-interview room where 2 to 4 people edit one file in the browser, see each other's cursors, and run the code against test cases. The sync engine underneath is my own operational transformation with a central server: no Yjs, ShareDB or Automerge.

What I built
  • Own OT engine: retain, insert and delete operations with apply, compose and transform, a client state machine and a server document, checked by 30,000 randomized convergence tests on every push.
  • Measured on the live deploy against a whole-file re-broadcast baseline: with two people typing over a 90 ms network, re-broadcast lost 49% of keystrokes and Duet lost none, sending 54x fewer bytes per keystroke.
  • Load-tested the Node WebSocket server with 200 bot editors in 50 rooms: about 1,300 edits a second at p95 under 3 ms on a laptop.
How it works
  1. 01React + Monaco Front End (Vercel)
  2. 02Editor ↔ OT Binding
  3. 03WebSocket
  4. 04Node Server (Docker on Render)
  5. 05Server Document (transform + revision log)
  6. 06Rooms of 2 to 4 with Presence
  7. 07Supabase Postgres (saved rooms)
Features
  • 2 to 4 people edit the code and the problem statement together, each seeing the others' cursors in their own colour
  • Interviewer and candidate roles enforced by the server: the interviewer writes the problem, sets the test cases and runs the timer
  • Run JavaScript or Python against the test cases in the browser, and everyone in the room sees the result
  • Reconnect without losing work: the page gets exactly what it missed, and every edit lands once, none lost and none doubled
  • Randomized TP1, compose and multi-client simulation tests, plus a real-browser exit test with up to four tabs typing at once
  • Ships a naive re-broadcast mode beside OT, so the comparison can be rerun on the same transport