How sp201004/collabcanvas works
CollabCanvas takes users from room selection or a shared room link into a drawing canvas, then synchronizes drawing, cursor, presence, and shared history through Socket.IO. Room state is held by the server and persisted to files; the browser also saves locally. The README documents the product capabilities, while source excerpts directly confirm key routing, event-handler, room-manager, and persistence calls. Some client wiring and feature implementations were not excerpted, so those relationships are documented rather than source-verified.
Main entry points: canvas-page.tsx Canvas page · routes.ts Socket event handlers · drawing-canvas.tsx Drawing canvas · room-header.tsx Room controls
Components 20
Client experience
- App routing
client/src/App.tsx - Room entry
client/src/pages/landing-page.tsx - Canvas page
client/src/pages/canvas-page.tsx - Room controls
client/src/components/room-header.tsx
Drawing workspace
- Drawing canvas
client/src/components/drawing-canvas.tsx - Tool selection
client/src/components/tool-panel.tsx - Tool settings
client/src/components/tool-settings-bar.tsx - Color picker
client/src/components/ColorPicker/AdvancedColorPicker.tsx - Browser persistence
client/src/lib/persistence.ts
Collaboration
- Socket handling
client/src/hooks/use-socket.ts - Socket client
client/src/lib/socket.ts - Cursor tracking
client/src/components/cursor-overlay.tsx - User presence
client/src/components/user-presence.tsx - Connection status
client/src/components/connection-status.tsx - Performance metrics
client/src/components/performance-metrics.tsx
Server state
- Socket event handlers
server/routes.ts - Room state and history
server/rooms.ts - Room file storage
server/persistence.ts - Shared data schema
shared/schema.ts
Other components
- Participants
Connections 22
- Participants → Room entry: choose room
README.md - Participants → Canvas page: draw together
README.md - App routing → Room entry: routes to
client/src/App.tsx - App routing → Canvas page: routes to
client/src/App.tsx - Room entry → Canvas page: joins room
README.md - Canvas page → Drawing canvas: presents
README.md - Drawing canvas → Tool selection: uses tools
README.md - Drawing canvas → Tool settings: uses settings
README.md - Tool settings → Color picker: offers color input
README.md - Drawing canvas → Browser persistence: saves canvas
README.md - Canvas page → Room controls: shows controls
README.md - Canvas page → Socket handling: syncs room
README.md - Socket handling → Socket client: uses connection
README.md - Socket handling → Socket event handlers: exchanges events
README.md - Socket event handlers → Room state and history: updates room
server/routes.ts - Room state and history → Room file storage: loads and saves
server/rooms.ts - Socket event handlers → Cursor tracking: broadcasts cursors
README.md - Socket event handlers → User presence: broadcasts presence
README.md - Room controls → Connection status: shows status
client/src/components/room-header.tsx - Room controls → Performance metrics: shows metrics
client/src/components/room-header.tsx - Socket event handlers → Shared data schema: uses shared types
server/routes.ts - Room state and history → Shared data schema: uses shared types
server/rooms.ts