CollabBoard is a full-stack collaborative whiteboard app with room-based realtime drawing.
- Frontend: React + Vite + Zustand + Tailwind CSS + Canvas API
- Backend: Node.js + Express + Socket.io + Mongoose
- Database: MongoDB (with in-memory fallback when Mongo is unavailable)
- Create and join rooms
- Realtime drawing sync (pencil, rectangle, line)
- Eraser and element move interactions
- Live cursor tracking
- Undo / Redo with sync
- Clear canvas
- Save / load canvas state via REST API
- Room and canvas APIs
client/React appserver/Express + Socket.io server
cd client && npm install
cd ../server && npm install- Client: copy
.env.exampleto.env - Server: copy
.env.exampleto.env - Set
MONGO_URIinserver/.env(optional if running in-memory mode)
cd server
npm run devcd client
npm run devOpen http://localhost:5173 in multiple browser tabs to test collaboration.
POST /api/room/createGET /api/room/:roomIdPOST /api/canvas/saveGET /api/canvas/:roomId
Client to server:
JOIN_ROOMDRAWUPDATE_ELEMENTDELETE_ELEMENTCURSOR_MOVECLEAR_CANVASUNDOREDO
Server to client:
USER_JOINEDUSER_LEFTSYNC_DRAWSYNC_UPDATESYNC_DELETESYNC_CURSORSYNC_CLEAR