Backend server for Collabraw, a real-time collaborative whiteboard application. This server manages WebSocket connections, synchronizes drawing events between connected users, and powers real-time collaboration using Socket.io.
This repository contains only the backend. For the client application, see the Frontend Repository linked below.
- ⚡ Real-time communication with Socket.io
- 👥 Multi-user collaboration
- 🏠 Automatic room creation and management
- 📝 Name-based user identification
- 👥 Maximum of 5 users per room
- 📡 Low-latency event broadcasting
- ✏️ Real-time synchronization of drawing operations
- 🔤 Real-time text synchronization
- 🔲 Shape creation and updates
- 🧹 Eraser synchronization
- 🔄 User join and leave handling
- 📈 Lightweight and scalable architecture
- A user opens the application and enters their name.
- The frontend establishes a Socket.io connection with the backend.
- The backend creates a collaboration room or joins the user to an existing one.
- Each room supports up to 5 active users at a time.
- Every drawing action, shape update, text edit, erase operation, undo, and redo event is instantly broadcast to all connected users in the same room.
- When a user joins or leaves, the room state is updated in real time so every participant stays synchronized.
Room Limit: Each collaboration room allows a maximum of 5 participants. Additional users must wait until space becomes available.
- Node.js
- Express.js
- TypeScript
- Socket.io
- Nodemon
- ts-node
git clone https://github.com/AzadTom/Collabraw-Backend.git
cd Collabraw-Backendnpm installor
pnpm installCreate a .env file in the project root.
PORT=5000
CLIENT_URL=http://localhost:5173Update CLIENT_URL if your frontend runs on a different origin.
npm run devThe server will start at:
http://localhost:5000
Collabraw-Backend
│
├── src/
│ ├── config/
│ ├── controllers/
│ ├── routes/
│ ├── sockets/
│ ├── types/
│ ├── utils/
│ └── index.ts
├── .env
├── package.json
└── README.md
Update the folder structure if your project differs.
- Join Room
- Leave Room
- Draw
- Update Shape
- Delete Shape
- Add Text
- Cursor Move
- Undo
- Redo
- User Joined
- User Left
- Canvas Updated
- Cursor Updated
- Room Synced
- Persistent whiteboard storage
- Authentication & Authorization
- Room invitations
- Cursor names & avatars
- Redis adapter for horizontal scaling
- Rate limiting
- Presence indicators
- Whiteboard version history
- API documentation
- Docker support
Contributions are welcome!
- Fork the repository.
- Create a feature branch.
git checkout -b feature/my-feature- Commit your changes.
git commit -m "Add my feature"- Push your branch.
git push origin feature/my-feature- Open a Pull Request.
This backend powers the Collabraw frontend application.
Frontend Repository: 👉 https://github.com/AzadTom/Collabraw
Frontend live link: 👉 https://white-board-front-end.vercel.app/
If you found this project helpful, consider giving it a ⭐ on GitHub. It helps others discover the project and supports future development.
