From 0ad1cce65351bb1de289bedddbd7c5e16f93fff2 Mon Sep 17 00:00:00 2001 From: Michael Ramos Date: Wed, 11 Mar 2026 23:44:12 -0700 Subject: [PATCH] chore: move demo diagram sections below SQL code block Co-Authored-By: Claude Opus 4.6 --- packages/editor/App.tsx | 74 ++++++++++++++++++++--------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/packages/editor/App.tsx b/packages/editor/App.tsx index 3acc097..f12c5cd 100644 --- a/packages/editor/App.tsx +++ b/packages/editor/App.tsx @@ -60,43 +60,6 @@ const PLAN_CONTENT = `# Implementation Plan: Real-time Collaboration ## Overview Add real-time collaboration features to the editor using **[WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)** and *[operational transforms](https://en.wikipedia.org/wiki/Operational_transformation)*. -### Architecture - -\`\`\`mermaid -flowchart LR - subgraph Client["Client Browser"] - UI[React UI] --> OT[OT Engine] - OT <--> WS[WebSocket Client] - end - - subgraph Server["Backend"] - WSS[WebSocket Server] <--> OTS[OT Transform] - OTS <--> DB[(PostgreSQL)] - end - - WS <--> WSS -\`\`\` - -### Service Dependencies (Graphviz) - -\`\`\`graphviz -digraph CollaborationStack { - rankdir=LR; - node [shape=box, style="rounded"]; - - Browser [label="Client Browser"]; - API [label="WebSocket API"]; - OT [label="OT Engine"]; - Redis [label="Presence Cache"]; - Postgres [label="PostgreSQL"]; - - Browser -> API; - API -> OT; - OT -> Redis; - OT -> Postgres; -} -\`\`\` - ## Phase 1: Infrastructure ### WebSocket Server @@ -152,6 +115,43 @@ CREATE TABLE collaborators ( CREATE INDEX idx_collaborators_document ON collaborators(document_id); \`\`\` +### Architecture + +\`\`\`mermaid +flowchart LR + subgraph Client["Client Browser"] + UI[React UI] --> OT[OT Engine] + OT <--> WS[WebSocket Client] + end + + subgraph Server["Backend"] + WSS[WebSocket Server] <--> OTS[OT Transform] + OTS <--> DB[(PostgreSQL)] + end + + WS <--> WSS +\`\`\` + +### Service Dependencies (Graphviz) + +\`\`\`graphviz +digraph CollaborationStack { + rankdir=LR; + node [shape=box, style="rounded"]; + + Browser [label="Client Browser"]; + API [label="WebSocket API"]; + OT [label="OT Engine"]; + Redis [label="Presence Cache"]; + Postgres [label="PostgreSQL"]; + + Browser -> API; + API -> OT; + OT -> Redis; + OT -> Postgres; +} +\`\`\` + ## Phase 2: Operational Transforms > The key insight is that we need to transform operations against concurrent operations to maintain consistency. -- knotmirror 0.0.1