A professional real-time collaborative board application built with the MERN stack (MongoDB, Express, React, Node.js) and Socket.IO for real-time updates.
- Real-time Collaboration: Multiple users can work on boards simultaneously with instant updates
- Interactive Boards: Create boards with customizable lists and cards
- Drag & Drop: Smooth drag-and-drop interface for organizing cards and lists
- Rich Content Tools: Add text blocks, shapes, images, and connectors to boards
- Visual Connectors: Create flowchart-style connectors between elements with auto-adjustment
- Team Management: Share boards with team members and track contributions
- Profile Dashboard: View statistics and manage boards from a centralized dashboard
- WebSocket-based real-time synchronization
- Persistent data storage with MongoDB
- JWT authentication
- RESTful API architecture
- Responsive design with Tailwind CSS
- Modern React with hooks and functional components
- State management with Zustand
- React 18: Modern React with hooks
- Vite: Fast build tool and dev server
- Tailwind CSS: Utility-first CSS framework
- React Beautiful DnD: Drag and drop functionality
- Socket.IO Client: Real-time communication
- Axios: HTTP client
- React Router: Client-side routing
- Zustand: Lightweight state management
- Framer Motion: Smooth animations
- Lucide React: Icon library
- Node.js: JavaScript runtime
- Express: Web framework
- MongoDB: NoSQL database
- Mongoose: MongoDB ODM
- Socket.IO: Real-time bidirectional communication
- JWT: Authentication tokens
- bcryptjs: Password hashing
- Node.js (v16 or higher)
- MongoDB (v4.4 or higher)
- npm or pnpm package manager
git clone <repository-url>
cd build-real-time-boardcd server
npm installCreate a .env file in the server directory:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/collaboration-board
JWT_SECRET=your-super-secret-jwt-key-here-change-this-in-production
CLIENT_URL=http://localhost:5173Important: Change the JWT_SECRET to a strong, random string in production.
cd ../client
npm installCreate a .env file in the client directory:
VITE_API_URL=http://localhost:5000
VITE_SOCKET_URL=http://localhost:5000Make sure MongoDB is running locally or provide a MongoDB Atlas connection string in the server .env file.
# Start MongoDB locally (if using local installation)
mongodcd server
npm run devThe server will run on http://localhost:5000
cd client
npm run devThe client will run on http://localhost:5173
cd client
npm run buildcd server
npm startclient/
├── src/
│ ├── components/ # Reusable React components
│ │ ├── BoardCard.jsx
│ │ ├── BoardList.jsx
│ │ ├── CardItem.jsx
│ │ ├── CreateBoardModal.jsx
│ │ ├── CreateListForm.jsx
│ │ ├── CreateCardForm.jsx
│ │ ├── LearnMoreModel.jsx
│ │ ├── ListColumn.jsx
│ │ ├── Navbar.jsx
│ │ ├── ProtectedRoute.jsx
│ │ ├── sidebar.jsx
│ │ └── ToolsPanel/ # Canvas tool panels
│ │ ├── ConnectTool.jsx
│ │ ├── ImageTool.jsx
│ │ ├── ShapesTool.jsx
│ │ └── TextTool.jsx
│ ├── pages/ # Page components
│ │ ├── Board.jsx # Main board interface
│ │ ├── Dashboard.jsx # User dashboard
│ │ ├── Login.jsx
│ │ ├── Register.jsx
│ │ └── profile.jsx
│ ├── store/ # State management
│ │ ├── boardStore.js
│ │ └── userStore.js
│ ├── utils/
│ │ └── socket.js
│ ├── App.jsx
│ ├── main.jsx
│ └── index.css
├── package.json
└── vite.config.js
server/
├── controllers/ # Request handlers
│ ├── authController.js
│ ├── boardController.js
│ ├── cardController.js
│ ├── connectorController.js
│ ├── listController.js
│ └── userController.js
├── models/ # MongoDB schemas
│ ├── Board.js
│ ├── Card.js
│ ├── Connector.js
│ ├── List.js
│ └── User.js
├── routes/ # API routes
│ ├── auth.js
│ ├── board.js
│ ├── card.js
│ ├── connector.js
│ ├── list.js
│ └── user.js
├── middleware/
│ └── auth.js # JWT verification
├── sockets/
│ └── socketHandler.js # WebSocket event handlers
├── server.js # Main server file
└── package.json
- POST
/api/auth/register - Body:
{ name, email, password }
- POST
/api/auth/login - Body:
{ email, password } - Returns:
{ token, user }
- GET
/api/auth/me - Headers:
Authorization: Bearer <token>
- GET
/api/boards - Headers:
Authorization: Bearer <token>
- GET
/api/boards/:id - Headers:
Authorization: Bearer <token>
- POST
/api/boards - Headers:
Authorization: Bearer <token> - Body:
{ title, description?, color? }
- PUT
/api/boards/:id - Headers:
Authorization: Bearer <token> - Body:
{ title?, description?, color? }
- DELETE
/api/boards/:id - Headers:
Authorization: Bearer <token>
- POST
/api/lists - Headers:
Authorization: Bearer <token> - Body:
{ title, board, position? }
- PUT
/api/lists/:id - Headers:
Authorization: Bearer <token> - Body:
{ title?, position? }
- DELETE
/api/lists/:id - Headers:
Authorization: Bearer <token>
- POST
/api/lists/reorder - Headers:
Authorization: Bearer <token> - Body:
{ lists: [listId1, listId2, ...] }
- POST
/api/cards - Headers:
Authorization: Bearer <token> - Body:
{ title, description?, list, board }
- PUT
/api/cards/:id - Headers:
Authorization: Bearer <token> - Body:
{ title?, description?, dueDate?, labels? }
- DELETE
/api/cards/:id - Headers:
Authorization: Bearer <token>
- POST
/api/cards/:id/move - Headers:
Authorization: Bearer <token> - Body:
{ fromList, toList, position }
- POST
/api/connectors - Headers:
Authorization: Bearer <token> - Body:
{ board, fromElement, toElement, lineStyle?, arrowStyle?, color? }
- GET
/api/connectors/board/:boardId - Headers:
Authorization: Bearer <token>
- PUT
/api/connectors/:id - Headers:
Authorization: Bearer <token>
- DELETE
/api/connectors/:id - Headers:
Authorization: Bearer <token>
- GET
/api/users/stats - Headers:
Authorization: Bearer <token> - Returns:
{ boards, lists, cards }
join-board: Join a board room- Payload:
(boardId, userId)
- Payload:
join-user: Join user room for profile updates- Payload:
(userId)
- Payload:
board:created: New board createdboard:deleted: Board deletedlist:created: New list added to boardlist:deleted: List removed from boardlist:updated: List modifiedcard:created: New card addedcard:updated: Card modifiedcard:moved: Card moved between listscard:deleted: Card removedconnector:created: New connector addedconnector:updated: Connector modifiedconnector:deleted: Connector removed
The application uses Socket.IO for bidirectional real-time communication. When a user makes changes:
- The change is saved to MongoDB
- A WebSocket event is emitted to all users in the board room
- Connected clients receive the update and refresh their UI
Uses react-beautiful-dnd for:
- Dragging cards between lists
- Reordering cards within a list
- Reordering lists on the board
- Text Tool: Add formatted text with custom fonts, sizes, colors, and styles
- Shape Tool: Insert rectangles, circles, hexagons, and triangles
- Image Tool: Upload images or add from URL
- Connect Tool: Create visual connectors between elements for flowcharts
Profile page shows real-time counts of:
- Boards created/owned
- Total lists across all boards
- Total cards across all boards
Updates automatically via WebSocket events and fallback polling.
- Use functional React components with hooks
- Follow ES6+ JavaScript standards
- Use Tailwind CSS utility classes
- Add PropTypes for component props validation
- Handle errors gracefully with try-catch blocks
- Always validate user input on both client and server
- Use JWT tokens stored in localStorage for authentication
- Emit socket events after database operations complete
- Clean up WebSocket listeners in React useEffect cleanup
- Use environment variables for configuration
cd client
npm run lintnpm run lint:fixnpm run format- Ensure MongoDB is running:
mongodor check Atlas connection - Verify
MONGODB_URIin.envis correct - Check network connectivity for Atlas
- Verify
VITE_SOCKET_URLmatches server address - Check CORS settings in server
- Ensure both transports are enabled:
['websocket', 'polling']
- Clear node_modules:
rm -rf node_modules package-lock.json && npm install - Clear Vite cache:
rm -rf .vite - Ensure all peer dependencies are installed
- Check JWT_SECRET is set in server
.env - Verify token is being sent in Authorization header
- Check token expiration (default: 7 days)
- Lazy load routes with React.lazy
- Memoize expensive computations with useMemo
- Debounce frequent operations (search, autosave)
- Optimize images and use appropriate formats
- Add database indexes for frequently queried fields
- Use MongoDB aggregation for complex queries
- Implement rate limiting for API endpoints
- Enable compression middleware
- Change JWT_SECRET to a strong random string
- Use HTTPS for all connections
- Enable CORS only for trusted domains
- Implement rate limiting
- Validate and sanitize all user inputs
- Use environment-specific configurations
- Set secure cookie flags
- Implement proper error handling (don't expose stack traces)
- Keep dependencies updated
- Use helmet.js for security headers
# Server
PORT=5000
MONGODB_URI=<your-production-mongodb-uri>
JWT_SECRET=<strong-random-secret>
CLIENT_URL=<your-production-frontend-url>
NODE_ENV=production
# Client
VITE_API_URL=<your-production-api-url>
VITE_SOCKET_URL=<your-production-socket-url>- Frontend: Vercel, Netlify, AWS S3 + CloudFront
- Backend: Heroku, AWS EC2, DigitalOcean, Railway
- Database: MongoDB Atlas, AWS DocumentDB
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License.
For issues, questions, or contributions, please open an issue on the GitHub repository.
- Initial release with core features
- Real-time collaboration
- Drag and drop boards
- Canvas tools (text, shapes, images, connectors)
- Dynamic user statistics
- Profile management
- WebSocket-based real-time updates
- Persistent connector storage
- Professional UI/UX design
- Card comments and activity feed
- Board templates
- Advanced search and filtering
- Export boards (PDF, PNG, JSON)
- Board access control and permissions
- Email notifications
- Mobile app (React Native)
- Collaborative cursors
- Undo/redo functionality
- Keyboard shortcuts
- Dark mode
- Integration with third-party tools (Slack, GitHub, etc.)
Built with ❤️ using the MERN stack