AI Code Collab is a cutting-edge, real-time collaborative coding environment that brings teams together to code simultaneously. Built with modern web technologies, it features seamless multi-language support, secure authentication, and a stunning dark/light mode experience. Perfect for pair programming, coding interviews, hackathons, and team development.
- Live Code Syncing: Multiple developers can edit code simultaneously with instant updates
- Session Management: Generate unique session IDs for instant collaboration
- Multi-User Presence: Real-time user list showing all connected collaborators
- Seamless Sharing: Copy session IDs to clipboard for easy team joining
- JavaScript/TypeScript with autocompletion
- HTML/CSS with proper syntax highlighting
- PHP, Java, C++ for backend and systems programming
- CodeMirror 6 powered editor with rich language extensions
- JWT-based login and registration system
- bcrypt password hashing for security
- Token-based session management
- Persistent user sessions with localStorage
- Dark/Light Mode toggle with smooth transitions
- Responsive Design optimized for all devices
- TailwindCSS powered modern styling
- React Toastify for beautiful notifications
- Debounced code updates to reduce network load
- Socket.io for efficient real-time communication
- Next.js 14 with App Router for blazing fast performance
- Code splitting and dynamic imports
- Node.js 18+
- MongoDB (local or cloud)
- Git
# Clone the repository
git clone https://github.com/Jamal-09/code-collab.git
cd code-collabcd code-collab-backend
npm installecho "MONGO_URI=your-mongo-uri-here" > .env
echo "JWT_SECRET=your-super-secret-jwt-key-here" >> .env
echo "PORT=5000" >> .envnpm run devcd ../code-collab-frontend
npm installecho "NEXT_PUBLIC_API_URL=http://localhost:5000" > .env.localnpm run dev- Code Collab: https://code-collab-lake.vercel.app/
- Authentication
- Register: Create a new account with username and password
- Login: Access existing account with credentials
- Auto-login: Tokens persist across browser sessions
- Collaboration Workflow
- Generate or enter session ID
- Join session with your username
- Start coding - changes sync instantly!
- Share session ID with teammates
- Switch languages as needed
- Language Support
- JavaScript/TypeScript: Full syntax highlighting + autocompletion
- HTML/CSS: Tag completion and styling support
- Backend Languages: PHP, Java, C++ with proper syntax
- Real-time Sync: Language changes propagate to all users
- Features
- Session Sharing: One-click copy to clipboard
- User Presence: Live list of connected collaborators
- Theme Toggle: Dark/Light mode for optimal coding
- Responsive: Works on desktop, tablet, mobile
textcode-collab/
โโโ code-collab-frontend/ # Next.js React App
โ โโโ app/
โ โ โโโ components/
โ โ โ โโโ CodeEditor.jsx # Main collaborative editor
โ โ โโโ globals.css # Tailwind + theme styles
โ โ โโโ page.jsx # Auth + main layout
โ โโโ public/ # Screenshots & assets
โ โโโ package.json
โโโ code-collab-backend/ # Express + Socket.io API
โ โโโ index.js # Main server + Socket.io
โ โโโ package.json
โ โโโ .env # Environment variables
โโโ README.md # You're reading it! ๐- Terminal 1 - Backend
cd code-collab-backend && npm run dev- Terminal 2 - Frontend
cd code-collab-frontend && npm run dev- Backend (.env):
MONGO_URI=mongodb://localhost:27017/code-collab
JWT_SECRET=your-super-secret-key-min-32-chars
PORT=5000- Frontend (.env.local):
NEXT_PUBLIC_API_URL=http://localhost:5000-
Testing Multi-User
-
Open two browser tabs/windows
-
Login with different accounts in each
-
Generate session ID in first tab
-
Join same session ID in second tab
-
Watch real-time code sync! โจ
- Frontend (Vercel)
- Push to GitHub
- Connect to Vercel
- Set NEXT_PUBLIC_API_URL in Vercel environment
- Deploy! ๐
- Backend (Render/Heroku)
- Push backend to GitHub
- Connect to Render
- Set environment variables (MONGO_URI, JWT_SECRET)
- Update frontend API URL to point to deployed backend
- Pair Programming: Remote developers coding together
- Coding Interviews: Live coding sessions with interviewers
- Hackathons: Team coding competitions
- Education: Classroom collaborative coding
- Code Reviews: Live code walkthroughs
- Open Source: Community contribution sessions
- JWT Tokens: Secure stateless authentication
- bcrypt Hashing: Strong password encryption
- Input Validation: Sanitized user inputs
- CORS Protection: Restricted origins
- Rate Limiting: Prevent abuse (can be added)