A modern, real-time team collaboration platform built with the MERN stack, featuring instant messaging, project management, and seamless team coordination.
Live Demo: collabflow-web.vercel.app
- Features
- Tech Stack
- Architecture
- Getting Started
- Screenshots
- Key Highlights
- Project Structure
- API Documentation
- JWT-based secure authentication
- Role-based access control (Owner, Admin, Member, Viewer)
- Password encryption with bcrypt
- Protected routes and API endpoints
- Session management with automatic token refresh
- Instant messaging with Socket.io WebSockets
- Channel-based communication (Public, Private, Direct Messages)
- Read receipts with timestamps
- Unread message counts with real-time updates
- Typing indicators showing who's typing
- Message editing & deletion with optimistic updates
- @mentions for user notifications
- Mobile-optimized chat interface with sticky headers
- Create and manage multiple workspaces
- Invite team members via email
- Role-based permissions (Owner → Admin → Member → Viewer)
- Member management with role updates
- Workspace settings and customization
- Create and organize projects within workspaces
- Assign team members to projects
- Project-specific permissions
- Task tracking and management
- Project settings and configuration
- Create, assign, and track tasks
- Task priorities (Low, Medium, High, Urgent)
- Task status tracking (To Do, In Progress, In Review, Done)
- Due dates and deadlines
- Task assignment to team members
- Real-time task updates
- Responsive design - Mobile, tablet, and desktop optimized
- Dark/Light mode with system preference detection
- Shadcn UI components for consistent design
- Smooth animations and transitions
- Loading states and skeleton screens
- Toast notifications for user feedback
- Mobile-first approach with hamburger navigation
- Live connection status indicator
- Automatic reconnection on network issues
- Real-time presence detection
- Instant updates across all connected clients
- Optimistic UI updates for better UX
- Framework: Next.js 15 (App Router, React Server Components)
- Language: TypeScript 5.0
- Styling: Tailwind CSS v4
- UI Components: Shadcn UI
- State Management: Zustand
- Real-time: Socket.io Client
- Form Validation: Zod
- HTTP Client: Fetch API with custom wrapper
- Deployment: Vercel
- Runtime: Node.js with Express.js
- Language: TypeScript
- Database: MongoDB with Mongoose ODM
- Authentication: JWT (jsonwebtoken)
- Real-time: Socket.io Server
- Security: Helmet, CORS, bcryptjs
- Rate Limiting: express-rate-limit
- Deployment: Render / Railway
- Version Control: Git & GitHub
- Package Manager: npm
- Code Quality: ESLint, Prettier
- Environment: dotenv for configuration
- Build Tool: Next.js Turbopack
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Client │◄───────►│ Server │◄───────►│ Database │
│ (Next.js) │ HTTP │ (Express) │ ODM │ (MongoDB) │
│ │ REST │ │ Mongoose│ │
└─────────────┘ └─────────────┘ └─────────────┘
│ │
│ WebSocket │
└───────────────────────┘
(Socket.io)
- Monorepo structure for frontend and backend
- RESTful API for CRUD operations
- WebSocket for real-time features
- JWT tokens stored in memory (not localStorage for security)
- Optimistic updates for instant UI feedback
- Server-side validation with Zod schemas
- Role-based middleware for authorization
- Node.js 18+ and npm
- MongoDB (local or Atlas)
- Git
- Clone the repository
git clone https://github.com/mddanishh18/CollabFlow.git
cd CollabFlow- Backend Setup
cd backend
npm install
# Create .env file
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secret
# Start backend server
npm run devBackend runs on http://localhost:5000
- Frontend Setup
cd frontend
npm install
# Create .env.local file
echo "NEXT_PUBLIC_API_URL=http://localhost:5000" > .env.local
echo "NEXT_PUBLIC_SOCKET_URL=http://localhost:5000" >> .env.local
# Start frontend dev server
npm run devFrontend runs on http://localhost:3000
Backend (.env)
NODE_ENV=development
PORT=5000
MONGODB_URI=mongodb://localhost:27017/collabflow
JWT_SECRET=your_super_secret_key_change_this
JWT_EXPIRES_IN=7d
CLIENT_URL=http://localhost:3000Frontend (.env.local)
NEXT_PUBLIC_API_URL=http://localhost:5000
NEXT_PUBLIC_SOCKET_URL=http://localhost:5000✅ Full-Stack Development
- Built complete MERN stack application from scratch
- Implemented both frontend and backend with TypeScript
- Designed and implemented RESTful APIs
- Created responsive, mobile-first UI
✅ Real-Time Systems
- Implemented WebSocket communication with Socket.io
- Built real-time chat with typing indicators and read receipts
- Handled connection management and reconnection logic
- Optimized for low latency and high concurrency
✅ Database Design
- Designed MongoDB schemas with Mongoose
- Implemented relationships (users, workspaces, projects, tasks, messages)
- Optimized queries with indexing
- Handled data validation and constraints
✅ Authentication & Security
- Implemented JWT-based authentication
- Built role-based access control (RBAC)
- Secured API endpoints with middleware
- Applied security best practices (Helmet, CORS, rate limiting)
✅ State Management
- Managed complex application state with Zustand
- Implemented optimistic UI updates
- Handled real-time state synchronization
- Built custom hooks for reusable logic
✅ Modern Frontend Practices
- Used Next.js 15 App Router and React Server Components
- Implemented TypeScript for type safety
- Built reusable component library with Shadcn UI
- Optimized for performance and SEO
✅ Mobile Responsiveness
- Mobile-first design approach
- Fixed complex mobile keyboard issues (iOS/Android)
- Implemented touch-friendly interactions
- Optimized for various screen sizes
✅ DevOps & Deployment
- Deployed frontend on Vercel with CI/CD
- Deployed backend on Render/Railway
- Configured environment variables
- Implemented production-ready error handling
Challenge 1: Mobile Chat Keyboard Issues
- Problem: Keyboard caused viewport shifting and scroll jumping on mobile
- Solution: Implemented
interactive-widget=resizes-contentmeta tag, sticky headers, and conditional refocus logic - Impact: Seamless mobile chat experience across iOS and Android
Challenge 2: Real-Time Read Receipts
- Problem: Needed to track who read each message in group chats
- Solution: Built Socket.io event system with optimistic updates and database persistence
- Impact: WhatsApp-like read receipt functionality
Challenge 3: Role-Based Permissions
- Problem: Complex permission hierarchy across workspaces and projects
- Solution: Implemented middleware-based RBAC with cascading permissions
- Impact: Secure, scalable authorization system
CollabFlow/
├── backend/
│ ├── src/
│ │ ├── config/ # Database & environment config
│ │ ├── controllers/ # Business logic (auth, workspace, chat, etc.)
│ │ ├── middleware/ # Auth, error handling, validation
│ │ ├── models/ # Mongoose schemas (User, Workspace, Message, etc.)
│ │ ├── routes/ # Express routes
│ │ ├── sockets/ # Socket.io event handlers
│ │ ├── utils/ # Helper functions (JWT, logger, etc.)
│ │ ├── app.ts # Express app configuration
│ │ └── server.ts # Server entry point
│ ├── package.json
│ └── tsconfig.json
│
└── frontend/
├── src/
│ ├── app/ # Next.js App Router pages
│ │ ├── (auth)/ # Auth pages (login, register)
│ │ ├── (dashboard)/ # Protected dashboard pages
│ │ └── layout.tsx # Root layout
│ ├── components/ # React components
│ │ ├── auth/ # Auth forms
│ │ ├── chat/ # Chat components
│ │ ├── project/ # Project management
│ │ ├── task/ # Task components
│ │ ├── workspace/ # Workspace components
│ │ └── ui/ # Shadcn UI components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities & API client
│ ├── store/ # Zustand stores
│ └── types/ # TypeScript types
├── package.json
└── tsconfig.json
POST /api/auth/register- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user
GET /api/workspaces- Get user's workspacesPOST /api/workspaces- Create workspaceGET /api/workspaces/:id- Get workspace detailsPUT /api/workspaces/:id- Update workspaceDELETE /api/workspaces/:id- Delete workspacePOST /api/workspaces/:id/members- Add memberDELETE /api/workspaces/:id/members/:userId- Remove member
GET /api/projects- Get workspace projectsPOST /api/projects- Create projectGET /api/projects/:id- Get project detailsPUT /api/projects/:id- Update projectDELETE /api/projects/:id- Delete project
GET /api/tasks- Get project tasksPOST /api/tasks- Create taskPUT /api/tasks/:id- Update taskDELETE /api/tasks/:id- Delete task
GET /api/chat/channels/:workspaceId- Get workspace channelsPOST /api/chat/channels- Create channelGET /api/chat/messages/:channelId- Get channel messagesPOST /api/chat/messages- Send messagePUT /api/chat/messages/:id- Edit messageDELETE /api/chat/messages/:id- Delete message
connection- Client connectsjoin_channel- Join chat channelleave_channel- Leave chat channelsend_message- Send chat messagetyping_start- User starts typingtyping_stop- User stops typingmessage_read- Mark message as read
This project is licensed under the MIT License.
Danish
- GitHub: @mddanishh18
- Next.js - React framework
- Shadcn UI - UI component library
- Socket.io - Real-time engine
- MongoDB - Database
- Vercel - Frontend hosting
⭐ If you found this project helpful, please consider giving it a star!