How sachin1395/distributed-collaborative-editor works
SyncDraft is a browser-based collaborative document editor. Users enter through the React app, authenticate with Supabase, manage documents, then edit a selected document in TipTap; Yjs maintains shared state and Hocuspocus distributes collaboration sessions, with Redis supporting scaling. The frontend also offers a public demo, invitations/presence, document export, and version-history UI; README notes long-term snapshots are planned. The backend exposes Prometheus metrics. Relationships involving unsampled internals are included only where the README documents them; source excerpts show app routing, document access, editor persistence, and metrics wiring.
Main entry points: App.js App routes · editor.jsx Document editor · supabase_client.js Supabase client · custom_server.js Hocuspocus sessions
Components 19
Frontend experience
- App routes
syncraft/src/App.js - Landing page
syncraft/src/components/LandingPage.jsx - Authentication UI
syncraft/src/components/login.jsx - Document library
syncraft/src/components/documents.jsx - Public demo
syncraft/src/components/demo_editor.jsx
Editing and collaboration
- Document editor
syncraft/src/components/editor.jsx - Editor controls
syncraft/src/@/components/tiptap-ui/code-block-button/use-code-block.js - Editor utilities
syncraft/src/@/lib/tiptap-utils.js - Invitations and presence
syncraft/src/components/InviteCollaborator.jsx - Version history UI
syncraft/src/components/VersionHistoryModal.jsx - Yjs shared state
Realtime backend
- Hocuspocus sessions
server/custom_server.js - Redis scaling
Operations and integrations
- Supabase client
syncraft/src/components/supabase_client.js - Supabase auth and metadata
- Metrics endpoint
server/custom_server.js - Metric registry
server/metrics.js
Other components
- Writer
- Metrics scraper
Connections 22
- Writer → App routes: opens
- App routes → Landing page: routes to
syncraft/src/App.js - App routes → Authentication UI: routes to
syncraft/src/App.js - App routes → Document library: routes to
syncraft/src/App.js - App routes → Document editor: routes to
syncraft/src/App.js - App routes → Public demo: routes to
syncraft/src/App.js - App routes → Supabase client: checks session
syncraft/src/App.js - Authentication UI → Supabase client: authenticates via
syncraft/src/components/login.jsx - Document library → Supabase client: manages metadata
syncraft/src/components/documents.jsx - Supabase client → Supabase auth and metadata: connects to
syncraft/src/components/supabase_client.js - Document editor → Supabase client: loads and saves
syncraft/src/components/editor.jsx - Document editor → Editor controls: uses controls
- Editor controls → Editor utilities: calls helpers
syncraft/src/@/components/tiptap-ui/code-block-button/use-code-block.js - Document editor → Yjs shared state: edits shared state
syncraft/src/components/editor.jsx - Document editor → Hocuspocus sessions: syncs over WebSocket
- Hocuspocus sessions → Redis scaling: scales through
- Document editor → Invitations and presence: offers invitations
syncraft/src/components/editor.jsx - Document editor → Version history UI: opens history
syncraft/src/components/editor.jsx - Version history UI → Yjs shared state: snapshot support planned
- Hocuspocus sessions → Metric registry: updates gauge
server/custom_server.js - Metrics endpoint → Metric registry: serves metrics
server/custom_server.js - Metrics scraper → Metrics endpoint: scrapes