A production-ready multiplayer whiteboard application supporting 50+ concurrent users with sub-100ms latency using WebSocket and Redis pub/sub.
- ✅ Real-time multi-user drawing with smooth rendering
- ✅ WebSocket-based low-latency synchronization
- ✅ Multi-device support (Web, Android, iOS, Desktop)
- ✅ Multiple stroke tools (Pencil, Brush, Highlighter, Eraser)
- ✅ Real-time cursor tracking with user names/colors
- ✅ Infinite canvas with pan, zoom, and scale
- ✅ Live presence indicators
- ✅ Real-time chat panel
- ✅ Multi-board workspace system
- ✅ Board permissions & roles (Admin, Editor, Viewer)
- ✅ Password-protected boards
- ✅ Replay mode (time-travel slider)
- ✅ WebSocket backend using Node.js + Socket.IO
- ✅ Redis Pub/Sub for horizontal scaling
- ✅ Stroke persistence in MongoDB
- ✅ Operational Transformation for conflict resolution
- ✅ Offline support with automatic sync
- ✅ Rate limiting & abuse protection
- ✅ JWT authentication for WebSockets
- ✅ Audit log system
- ✅ Smooth drawing engine (60 FPS)
- ✅ Undo/Redo functionality
- ✅ Layer management
- ✅ Export options (PNG, SVG, PDF)
- ✅ Real-time zoom & pan
realtime-drawing/
├── backend/ # Node.js + TypeScript backend
│ ├── src/
│ │ ├── config/ # Database, Redis, Socket.IO setup
│ │ ├── models/ # MongoDB models
│ │ ├── services/ # Business logic & OT
│ │ ├── socket/ # Socket.IO handlers
│ │ ├── routes/ # Express routes
│ │ └── middleware/
│ └── package.json
│
└── frontend/ # Flutter frontend
├── lib/
│ ├── core/
│ ├── features/
│ ├── services/
│ └── widgets/
└── pubspec.yaml
- Node.js + TypeScript
- Express.js - HTTP server
- Socket.IO - WebSocket server
- Redis - Pub/sub for scaling
- MongoDB - Data persistence
- JWT - Authentication
- Flutter - Cross-platform UI
- Socket.IO Client - WebSocket client
- Provider - State management
- Hive - Local caching
- Node.js 18+
- MongoDB 6+
- Redis 6+
- Flutter 3.0+
- Navigate to backend:
cd backend- Install dependencies:
npm install- Create
.envfile:
cp .env.example .env-
Update
.envwith your configuration -
Start MongoDB and Redis:
# MongoDB
mongod
# Redis
redis-server- Run backend:
npm run dev- Navigate to frontend:
cd frontend- Install dependencies:
flutter pub get- Run the app:
flutter runSee backend/README.md for detailed API documentation.
The application uses JWT tokens for authentication. Include the token in:
- HTTP requests:
Authorization: Bearer <token> - WebSocket:
auth: { token: '<token>' }
Implements OT algorithm for conflict-free collaborative editing, ensuring all users see consistent state even with concurrent edits.
Redis pub/sub allows multiple Node.js instances to share WebSocket events, enabling horizontal scaling to support 50+ concurrent users.
- Throttled stroke updates (60 FPS max)
- Batched point updates
- Efficient rendering with CustomPainter
- Optimized MongoDB queries with indexes
MIT
This project is built for backend skill enhancement and resume showcasing. It demonstrates:
- Real-time systems architecture
- WebSocket programming
- Database design and optimization
- Security best practices
- Scalable system design