A production-ready Kanban board with real-time collaboration, JWT auth, RBAC, Socket.io, bcrypt, and MongoDB Atlas.
Live Demo: https://collabboard-realtime-nwpq.onrender.com
Test Account:
- Email:
admin@gmail.com - Password:
Admin@123
| Layer | Tech |
|---|---|
| Frontend | React 18, Vite, React Router v6 |
| Drag & Drop | @hello-pangea/dnd |
| Real-time | Socket.io (client + server) |
| HTTP client | Axios |
| Backend | Node.js, Express |
| Auth | JWT (jsonwebtoken) + bcryptjs |
| Access Control | Role-based (Admin / Manager / Developer) |
| Database | MongoDB Atlas (Mongoose) |
| Env vars | dotenv |
| Notifications | react-hot-toast |
| Icons | lucide-react |
β
Real-time Collaboration β Socket.io room-based broadcasting for instant card sync across all connected users
β
Role-Based Access Control (RBAC) β 3 roles (Admin/Manager/Developer) with middleware-enforced permissions on 12+ endpoints
β
Optimistic UI + Server Reconciliation β Drag-and-drop with instant client feedback, no blocking on server updates
β
Secure Authentication β JWT (7-day expiry) + bcrypt password hashing (12 salt rounds)
β
MongoDB Relational Data β Mongoose with populated references (User β Project β Board β Card)
β
Production Deployment β Docker containerized, deployed on Render, environment-based configuration
β
Error Handling & UX β Session expiry detection, auto-redirect, toast notifications, form validation
β
Scalable Architecture β Modular folder structure, separated concerns (routes, middleware, models, socket handlers)
collabboard/
βββ server/
β βββ config/
β β βββ db.js # MongoDB Atlas connection
β βββ middleware/
β β βββ auth.js # JWT protect + RBAC authorize
β βββ models/
β β βββ User.js
β β βββ Project.js
β β βββ Board.js
β β βββ Card.js
β βββ routes/
β β βββ auth.routes.js # register, login, /me
β β βββ project.routes.js # CRUD projects + boards
β β βββ card.routes.js # CRUD cards + reorder
β βββ socket/
β β βββ boardSocket.js # All Socket.io event handlers
β βββ .env # β fill in your secrets
β βββ index.js # Entry point
β βββ package.json
β
βββ client/
βββ src/
β βββ context/
β β βββ AuthContext.jsx # Global user + token state
β β βββ SocketContext.jsx # Global socket connection
β βββ hooks/
β β βββ useBoard.js # Cards state + socket sync
β βββ services/
β β βββ api.js # Axios instance + all API calls
β βββ pages/
β β βββ AuthPage.jsx # Login + Register
β β βββ DashboardPage.jsx # All projects
β β βββ ProjectPage.jsx # Single project + boards
β βββ components/
β β βββ Board/
β β β βββ KanbanBoard.jsx # DragDropContext
β β β βββ KanbanColumn.jsx # Droppable column
β β β βββ KanbanCard.jsx # Draggable card
β β βββ Layout/
β β β βββ Navbar.jsx
β β βββ UI/
β β βββ ProtectedRoute.jsx
β βββ App.jsx
β βββ main.jsx
β βββ index.css
βββ .env
βββ package.json
- Node.js 18+
- Docker & Docker Compose (optional)
- MongoDB Atlas account
# Backend + MongoDB (in one command)
docker-compose up
# Frontend (in another terminal)
cd client
npm run devVisit: http://localhost:5173
Step 1: MongoDB Atlas
- Go to https://cloud.mongodb.com β Create free cluster
- Create a database user (username + password)
- Whitelist your IP (or use 0.0.0.0/0 for dev)
- Copy the connection string
Step 2: Server Setup
cd server
npm installCreate server/.env:
PORT=5000
MONGO_URI=mongodb+srv://<user>:<password>@cluster0.mongodb.net/collabboard?retryWrites=true&w=majority
JWT_SECRET=your_super_secret_key_minimum_32_chars
JWT_EXPIRES_IN=7d
CLIENT_URL=http://localhost:5173npm run dev # starts with nodemon on port 5000Step 3: Client Setup
cd client
npm install
npm run dev # starts on port 5173Visit: http://localhost:5173
- Register as Admin to create projects
- Register as Manager to manage cards
- Register as Developer to create and view cards
| Action | Admin | Manager | Developer |
|---|---|---|---|
| Create/delete projects | β | β | β |
| Create boards | β | β | β |
| Create cards | β | β | β |
| Edit any card | β | β | β |
| Delete cards | β | β | β |
| Assign cards | β | β | β |
| Event | Direction | Description |
|---|---|---|
board:join |
client β server | Join a board room |
board:leave |
client β server | Leave a board room |
card:move |
client β server | Card dragged to new column |
card:moved |
server β clients | Broadcast move to others |
card:update |
client β server | Card content updated |
card:updated |
server β clients | Broadcast update to others |
card:created |
client β server | New card created |
card:deleted |
client β server | Card deleted |
cards:reordered |
client β server | Bulk reorder after drag |
user:joined |
server β clients | User joined the board |
user:left |
server β clients | User disconnected |
| Method | Route | Access |
|---|---|---|
| POST | /api/auth/register |
Public |
| POST | /api/auth/login |
Public |
| GET | /api/auth/me |
Protected |
| Method | Route | Access |
|---|---|---|
| GET | /api/projects |
Protected |
| POST | /api/projects |
Admin only |
| GET | /api/projects/:id |
Protected |
| DELETE | /api/projects/:id |
Admin only |
| GET | /api/projects/:id/boards/:boardId/cards |
Protected |
| Method | Route | Access |
|---|---|---|
| POST | /api/cards |
Protected |
| PATCH | /api/cards/:id |
Protected |
| DELETE | /api/cards/:id |
Admin / Manager |
| PATCH | /api/cards/reorder/bulk |
Protected |
- Passwords hashed using bcrypt
- JWT stored securely on client
- Environment variables protected via .env
- Sensitive data excluded via .gitignore
- Add unit & integration tests
- Implement notifications (email / in-app)
- Add file attachments to cards
- Improve mobile responsiveness
Build image:
docker build -t collabboard .Run with environment file:
docker run -p 5000:5000 --env-file .env.production collabboardOr pass variables directly:
docker run -p 5000:5000 \
-e NODE_ENV=production \
-e MONGO_URI=mongodb+srv://user:pass@cluster.mongodb.net/collabboard \
-e JWT_SECRET=your_secret_key \
-e JWT_EXPIRES_IN=7d \
-e CLIENT_URL=https://your-domain.com \
collabboard- Push code to GitHub
- Create new service on Render.com
- Connect your GitHub repository
- Set environment variables:
NODE_ENV=production MONGO_URI=<your_mongodb_uri> JWT_SECRET=<32_char_secret> JWT_EXPIRES_IN=7d CLIENT_URL=<your_render_url> PORT=5000 - Deploy!
The app automatically serves:
- React frontend from
/ - API endpoints from
/api/* - Static files with proper caching
- Nancy
- GitHub: https://github.com/nancysangani