How sadh114/p2p-editor works
SyncQuest is a peer-to-peer collaborative rich-text editor with a React client and a small signaling server used for peer discovery, not document storage. Users enter a room, edit shared text, and see peer presence; browser peers exchange document updates directly, while IndexedDB supports local refresh recovery. A separate awareness-based synchronization layer adds vector-clock logging, coordinator election, and a replicated hash-chain audit log. The graph follows the sampled App orchestration and hook implementations; README statements support the signaling boundary and unsampled product capabilities.
Main entry points: App.jsx Room app · useYjsRoom.js Room session · Editor.jsx Rich-text editor · useVectorClockLog.js Vector clock log
Components 22
Room client
- Room app
frontend/src/App.jsx - Peer identity
frontend/src/utils/randomIdentity.js - Rich-text editor
frontend/src/components/Editor.jsx
Collaboration sync
- Room session
frontend/src/hooks/useYjsRoom.js - Peer signaling
signaling-server/server.js
Coordination features
- Vector clock log
frontend/src/hooks/useVectorClockLog.js - Clock operations
frontend/src/sync/vectorClock.js - Coordinator election
frontend/src/hooks/useCoordinatorElection.js - Audit log
frontend/src/hooks/useAuditLog.js - Hash-chain logic
frontend/src/sync/hashChain.js
Room interface
- Presence panel
frontend/src/components/PresencePanel.jsx - Connection status
frontend/src/components/ConnectionStatus.jsx - Room sharing
frontend/src/components/RoomBar.jsx - Quest progress
frontend/src/components/QuestProgress.jsx - Join notifications
frontend/src/hooks/useToasts.js - Toast display
frontend/src/components/Toasts.jsx - Debug panel
frontend/src/components/DebugPanel.jsx - Coordinator badge
frontend/src/components/CoordinatorBadge.jsx - Audit log panel
frontend/src/components/AuditLogPanel.jsx
Other components
- Collaborator
- Other browsers
- Browser IndexedDB
Connections 23
- Collaborator → Room app: opens room
README.md - Room app → Peer identity: creates identity
frontend/src/App.jsx - Room app → Room session: starts session
frontend/src/App.jsx - Room app → Rich-text editor: renders editor
frontend/src/App.jsx - Room session → Peer signaling: discovers peers
README.md - Room session → Other browsers: syncs directly
README.md - Room session → Browser IndexedDB: persists locally
frontend/src/hooks/useYjsRoom.js - Rich-text editor → Room session: edits shared document
frontend/src/components/Editor.jsx - Room app → Presence panel: renders peers
frontend/src/App.jsx - Room app → Connection status: renders status
frontend/src/App.jsx - Room app → Room sharing: renders room link
frontend/src/App.jsx - Room app → Quest progress: renders progress
frontend/src/App.jsx - Room app → Join notifications: tracks notifications
frontend/src/App.jsx - Join notifications → Toast display: supplies messages
frontend/src/App.jsx - Room app → Vector clock log: tracks clocks
frontend/src/App.jsx - Vector clock log → Clock operations: uses clock operations
frontend/src/hooks/useVectorClockLog.js - Room app → Debug panel: shows diagnostics
frontend/src/App.jsx - Room app → Coordinator election: runs election
frontend/src/App.jsx - Room app → Coordinator badge: shows coordinator
frontend/src/App.jsx - Room app → Audit log: tracks audit chain
frontend/src/App.jsx - Audit log → Hash-chain logic: creates and verifies
frontend/src/hooks/useAuditLog.js - Room app → Audit log panel: shows audit status
frontend/src/App.jsx - Audit log panel → Hash-chain logic: formats hashes
frontend/src/components/AuditLogPanel.jsx