TeamFlow is a full-stack, production-ready MERN web application engineered for collaborative teams. It features strict Role-Based Access Control (RBAC), real-time WebSocket notifications, dynamic multi-user assignments, and a highly responsive Kanban-style dashboard.
- Ironclad Security (RBAC): Backend APIs are heavily guarded. Admins have full CRUD permissions, while Members are locked into a seamless, read-only experience for viewing assigned data.
- Real-Time WebSockets: Powered by
Socket.io. Whenever an Admin creates a task, every assigned team member instantly receives a live browser notification without refreshing the page. - Collaborative Assignments: A dynamic, scrollable multi-select UI allows Admins to simultaneously assign infinite members to Projects and Tasks. Dashboards render smart overlapping avatar stacks to visually indicate collaboration size.
- Dynamic Kanban Dashboard: Tasks are automatically sorted into "To Do", "In Progress", and "Done" columns.
- Admin Quick Actions: Admins can hover over task cards to instantly "✓ Mark as Done" with a single click, complete with animated Toast success notifications.
TeamFlow is designed as a secure, role-based ecosystem:
- The Database Layer: MongoDB Atlas stores our
User,Project,Task, andNotificationschemas. Tasks and Projects use Mongoose Array References ([{ type: ObjectId }]) to allow an infinite number of team members to be assigned to a single project or task. - The API Layer: The Express backend acts as a strict firewall. Using JSON Web Tokens (JWT) stored in LocalStorage, the
authorize("Admin")middleware ensures that only authenticated Admins can create projects, assign tasks, or change statuses. Members are blocked with403 Forbiddenerrors if they attempt to bypass the UI. - The Real-Time Engine: When an Admin assigns a task to multiple users, the Express controller loops through the assignee array, saves isolated
Notificationdocuments, and immediately firessocket.ioevents to those specific users' connected browser instances. - The Client Layer: The React UI intelligently reads the user's role from the
AuthContext. If a standard Member logs in, React completely hides the "+ New Task" buttons and disables dropdowns, creating a seamless "View-Only" dashboard perfectly tailored to their assignments.
Frontend:
- React 19 + Vite
- Tailwind CSS v4 (Vanilla, utility-first)
- React Router DOM
- Axios & Lucide React (Icons)
- Socket.io-Client
Backend:
- Node.js + Express 5
- MongoDB + Mongoose 9
- JSON Web Tokens (JWT) & HTTP-Only Cookies
- Socket.io (Real-time engine)
This application is decoupled into a /client and /server architecture, making it extremely easy to deploy as two separate microservices.
Since Render offers a fantastic free tier for Node.js web services, it is the perfect alternative to Railway.
- Push this repository to GitHub.
- Log into Render.com and click New > Web Service.
- Connect your GitHub and select this repository.
- Configure the settings:
- Root Directory:
server - Environment:
Node - Build Command:
npm install - Start Command:
node server.js
- Root Directory:
- Go to the Environment Variables section and add:
MONGO_URI=mongodb+srv://<username>:<password>@cluster...(Your MongoDB Atlas URI)JWT_SECRET=any_secure_random_stringCORS_ORIGIN= (Leave blank for now, you will update this after deploying the frontend!)
- Click Create Web Service. Copy your live
onrender.combackend URL!
- Log into Vercel.com and click Add New Project.
- Import this repository.
- In the project configuration, edit the Root Directory to be
client. - The Build Command should auto-detect as
npm run build. The Install Command isnpm install. - Add the following Environment Variable:
VITE_API_URL=https://your-render-backend-url.onrender.com/api
- Click Deploy!
- Crucial Final Step: Copy your live Vercel URL. Go back to your Render Dashboard, click your Web Service, go to the Environment tab, and update the
CORS_ORIGINvariable to exactly match your Vercel URL.
cd server
npm installCreate a .env file in the /server directory:
PORT=5001
MONGO_URI=mongodb://127.0.0.1:27017/team-task-manager
JWT_SECRET=supersecretjwtkey12345
CORS_ORIGIN=http://localhost:5173Start the backend server:
npm run devcd client
npm installStart the frontend server:
npm run devAll routes (except Auth) require a valid JWT cookie.
POST /register- Register a new userPOST /login- Login userGET /me- Get current user profile (Protected)POST /logout- Clear cookies
GET /- Get all projects (Protected)POST /- Create a project (Admin Only)GET /:id- Get project by ID (Protected)PUT /:id- Update project (Admin Only)DELETE /:id- Delete project (Admin Only)
GET /- Get all tasks (Protected)GET /my-tasks- Get tasks assigned to current user array (Protected)GET /project/:projectId- Get tasks by project (Protected)POST /- Create a new task and fire WebSockets (Admin Only)PUT /:id- Update a task (Admin Only)DELETE /:id- Delete a task (Admin Only)PUT /:id/status- Quick-action status update (Admin Only)
GET /- Get all users (Protected)