Back to Portfolio

Collaborative Canvas

Real-time collaborative drawing application with conflict-free editing using Yjs CRDT, advanced state management, and seamless multi-user interactions on an infinite canvas.

Next.js 15TypeScriptYjsRedux ToolkitCanvas APIWebSocketshadcn/uiTailwind CSSy-websocket
View Design Document

Collaboration Demo

Watch multiple users collaborating in real-time without conflicts

Collaboration Engineering

Solving complex distributed system challenges for seamless multi-user experiences

Real-time Collaboration

Challenge:

Enabling multiple users to edit simultaneously without conflicts or data loss

Solution:

Implemented Yjs CRDT for conflict-free collaborative editing with automatic state synchronization

State Management Architecture

Challenge:

Separating collaborative document state from local UI state efficiently

Solution:

Used Yjs for shared document state and Redux for local UI state with clear separation of concerns

Complex Shape Interactions

Challenge:

Handling multi-selection, grouping, and collaborative-aware undo/redo operations

Solution:

Built sophisticated interaction system with proper event handling and state isolation per user

Performance with Collaboration

Challenge:

Maintaining smooth interactions while synchronizing changes across multiple clients

Solution:

Optimized rendering with Canvas API and efficient change propagation using WebSocket

System Architecture

Sophisticated state separation and conflict resolution architecture

Shared Document State (Yjs)

Shape positions, dimensions, colors, and hierarchy stored in conflict-free replicated data types

Local UI State (Redux)

Tool selection, viewport position, drag states, and UI panel states managed locally

Real-time Synchronization

WebSocket provider ensures all clients stay synchronized with automatic reconnection

Performance Optimization

Canvas rendering with efficient partial updates and virtualization for large canvases

Advanced Features

Comprehensive collaboration tools for professional creative workflows

Real-time multi-user editing
Conflict-free collaborative editing (CRDT)
Shape manipulation (move, resize, rotate)
Multi-selection and grouping
Collaborative-aware undo/redo
User presence indicators
Infinite canvas with pan/zoom
Shape hierarchy management
Real-time cursor tracking
Automatic conflict resolution

Technical Achievements

0
Conflicts with CRDT
∞
Canvas size supported
10+
Concurrent users tested