A real-time collaborative whiteboard application that enables multiple users to draw, sketch, and brainstorm together in real-time. Perfect for remote teams, online teaching, or creative collaboration.
- Real-time Collaboration: Draw simultaneously with multiple users
- Live Cursor Tracking: See where other users are working with labeled cursors
- Drawing Tools: Freehand drawing, erasing, and shape manipulation
- Board Management: Create, share, and manage multiple whiteboards
- User Authentication: Secure JWT-based authentication system
- Presence Indicators: Know who's currently active on your board
- Instant Sync: All changes propagate in real-time across all connected clients
- Node.js & Express.js - Server framework
- Socket.IO - Real-time bidirectional communication
- MongoDB & Mongoose - Data persistence
- JWT - Secure authentication
- CORS - Cross-origin resource sharing
- React - UI library with Hooks & Context API
- TailwindCSS - Utility-first CSS framework
- Socket.IO Client - Real-time updates
- Axios - HTTP client
- React Router - Navigation
letsdoodletogether/
βββ backend/ # Express + Socket.IO server
β βββ config/ # Database configuration
β βββ controllers/ # Request handlers
β βββ middleware/ # Authentication middleware
β βββ models/ # MongoDB schemas
β βββ routes/ # API routes
β βββ services/ # Business logic
β βββ index.js # Server entry point
β
βββ frontend/ # React application
βββ src/
β βββ components/ # Reusable UI components
β βββ store/ # Context providers
β βββ pages/ # Page components
β βββ utils/ # Helper functions
βββ public/ # Static assets
- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- npm or yarn
- Navigate to backend directory:
cd backend- Install dependencies:
npm install- Create
.envfile:
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_secret_key
PORT=5000- Start the server:
npm run dev
# or
node index.jsServer will run on http://localhost:5000
- Navigate to frontend directory:
cd frontend- Install dependencies:
npm install- Create
.envfile:
VITE_BACKEND_URL=http://localhost:5000- Start the development server:
npm run devFrontend will run on http://localhost:5173 (Vite default)
POST /api/user/signup- Register new userPOST /api/user/signin- Login userGET /api/user/me- Get current user (protected)
POST /api/board/create- Create new boardGET /api/board/load/:id- Load board dataPUT /api/board/update/:id- Update boardPUT /api/board/share/:id- Share board with usersPUT /api/board/unshare/:id- Revoke board accessDELETE /api/board/delete/:id- Delete board
board:join- Join a board roomboard:leave- Leave a board roompresence:join- User joins boardpresence:leave- User leaves board
cursor- Broadcast cursor positionelement:start- Begin new drawing elementelement:points- Stream drawing pointselement:update- Update element propertieselement:commit- Finalize and persist elementelement:erase- Delete element
For Vercel:
// vercel.json
{
"version": 2,
"builds": [
{
"src": "index.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "index.js"
}
]
}Update the backend URL in your .env:
VITE_BACKEND_URL=https://your-backend-url.vercel.appThen deploy:
npm run build
# Deploy the dist/ folder| Variable | Description | Example |
|---|---|---|
| MONGO_URI | MongoDB connection string | mongodb+srv://user:pass@cluster.mongodb.net/db |
| JWT_SECRET | Secret for JWT signing | your_super_secret_key |
| PORT | Server port | 5000 |
| Variable | Description | Example |
|---|---|---|
| VITE_BACKEND_URL | Backend API URL | http://localhost:5000 |
- Sign Up / Sign In: Create an account or log in
- Create Board: Click "New Board" to create a whiteboard
- Share Board: Invite collaborators via board settings
- Start Drawing: Use the toolbar to select drawing tools
- Real-time Collaboration: Watch as others draw in real-time!
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ for seamless remote collaboration
Happy Doodling Together! π¨β¨