Built Carrel across a 3-package TypeScript monorepo (@carrel/shared, @carrel/server, @carrel/client) using Yjs CRDTs, Fastify, better-sqlite3 WAL snapshots, and CodeMirror 6.
Key engineering highlights:
- 1-byte binary WebSocket multiplexing ([0x00] Yjs CRDT sync, [0x01] coalesced awareness/80ms lerped remote carets, [0x02] typed JSON control frames)
- Bounded 4-slot async scrypt concurrency limiter + per-IP progressive lockouts + single-use nonce-bound HMAC WebSocket upgrade tickets (preventing brute-force traffic from starving live keystrokes)
- 5000ms host reconnect grace window with deterministic seniority election and 30s seniority restoration
- Verified with Playwright multi-peer E2E specs
Case study & architecture diagrams: https://theayush.pages.dev/projects/carrel
GitHub: https://github.com/theayushagarwal/carrel
Built with