Back to archive
II. Clinical AI & Health Platformssupportingsoloclient anonymised

Collaborative Document Editor (CRDT)

Backend for a real-time collaborative document editor (Hocuspocus/Yjs CRDT + TipTap) inside the healthcare-platform (health) ecosystem. Solo user project: collaborative editing, horizontal scaling via Redis, JWT authorization, custom TipTap schema.

Status
maintained
Period
2025-01-22 → 2025-04-19
AI sessions
Stack
Languages
TypeScript
Frameworks · Infra
HocuspocusYjsTipTapElysiaDrizzle ORMBullMQ
§01

Overview

  • What it is: A collaborative document-editing server (package name tiptap_editor) — several users edit the same document in real time via CRDT (Yjs). Part of the healthcare-platform health ecosystem (likely editing of lab/medical reports; the TipTap schema has SVG nodes for visual templates). Persistence in Postgres, synchronization across instances via Redis.
  • Type / status / role: api (real-time backend) / maintained / solo — all 83 commits authored by Davron Yuldashev (two identities davr@Davrons-MacBook-Pro.local 82 + yul.davron.93 1 — both his).
  • Activity period: 2025-01-22 → 2025-04-19 (~3 months), 83 commits.
§02

Stack

  • Languages: TypeScript (Bun runtime).
  • Real-time/collab: @hocuspocus/server 2.15 + extensions database / redis / webhook / logger, Yjs 13.6 (+ y-protocols, y-websocket, y-webrtc), TipTap 2.11 (core + starter-kit + collaboration), @hocuspocus/transformer (TiptapTransformer).
  • API/infra: Elysia (+ CORS) and Express, REST (rest.ts) + Swagger/OpenAPI, ws (websocket). BullMQ (queue + queue_processors), ioredis. JWT authorization via jose (+ jsonwebtoken) — jwtVerify with JWT_SECRET.
  • Data: PostgreSQL (Drizzle ORM + pg/postgres, db/schema table documents), Redis (Hocuspocus synchronization across nodes + queues).
  • Build: Bun, drizzle-kit migrations.
§03

What was shipped

Solo, 83 commits. From the code:

  • Hocuspocus server (hocuspocus.ts, 11.6 KB) with document persistence in Postgres (load/store via @hocuspocus/extension-database), Redis extension for scaling, webhook/logger extensions.
  • JWT authentication at the Hocuspocus level (jwtVerify, jose) — token verification on connection to a document room.
  • Custom TipTap schema — bespoke nodes CustomDiv, CustomSVG (block-level SVG with xmlns), custom attributes (class/style/id/onclick) — editor extension for domain templates (medical documents with graphics).
  • REST + Swagger (rest.ts, swagger/) — an HTTP surface on top of the collab server.
  • Queues (queue.ts, queue_processors/, BullMQ) — background processing (document export/conversion?).
§04

Technical challenges

Confirmed by code (hocuspocus.ts, package.json).

  • Real-time collaboration on CRDT → Yjs + Hocuspocus: conflict-free merging of edits from multiple users without manual operational transformations. Non-trivial area (CRDT) — a strong engineering signal.
  • Horizontal scaling of the collab server@hocuspocus/extension-redis: Yjs updates synchronized across instances via Redis pub/sub (not a single node). Understanding of distributed real-time.
  • Yjs document persistenceextension-database + Drizzle/Postgres: load/store of the binary Yjs state into the documents table.
  • Room security → JWT verification (jose) on connection — only authorized users can edit a document.
  • Domain extension of the editor → custom TipTap nodes (SVG/div with arbitrary attributes) for medical templates; TiptapTransformer for HTML↔Yjs.
  • Webhook integrationextension-webhook notifies external services of document changes (likely the healthcare-platform backend).
§05

AI-assisted development

  • Sessions found: 0 (no matches for the full key). The period (early 2025) predates the user's active use of CC.
  • What was done with AI: no data.
  • AI-workflow patterns: none.
§06

Achievements & metrics

  • Full real-time collab backend: CRDT + persistence + Redis scaling + JWT + queues.
  • 83 commits solo over ~3 months.
  • Custom editor schema (SVG/div nodes) for medical documents.
  • Integrations: Postgres, Redis, webhooks, Swagger API.
§07

Contributors

git shortlog · all branches

  1. Dave9383
1 contributor83 commits total
Currently

Open to Senior / Staff engineering roles and selective freelance — production AI, platform, and full-stack work.

Get in touch