A powerful full-stack real-time collaborative coding platform powered by Node.js, Express, Socket.IO, and React with Monaco Editor. Supports role-based access control for seamless, scalable, and intuitive team coding sessions.
- ⚡ Real-time collaborative coding using WebSockets
- 👥 Role-based access control:
- 🛡️ Admin: Edit + Comment + Manage participants
- ✍️ Editor: Edit only
- 💬 Commenter: Comment only
- 🧠 Monaco Editor for powerful developer experience
- 🔗 RESTful API endpoints for session and user management
- 🛠️ Modular and clean architecture (backend + frontend)
- 🧩 In-memory session storage (MongoDB upgrade-ready)
- 🎯 Lightweight and production-ready
ai-code-collab/
├── server/
│ ├── config/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── sockets/
│ ├── utils/
│ ├── index.js
│ └── package.json
├── client/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ ├── services/
│ │ ├── App.jsx
│ │ ├── index.jsx
│ │ └── styles.css
│ └── package.json
└── package.json (root)
-
Clone the repository
git clone https://github.com/your-username/OJT-Sem-2-AI-Code-Collaborator-.git cd OJT-Sem-2-AI-Code-Collaborator- -
Install root dependencies
npm install
-
Install backend dependencies
cd backend npm install cd ..
-
Install frontend dependencies
cd frontend npm install cd ..
Now run the entire application using:
npm run devThis will simultaneously start:
- 🖥️ Frontend on
http://localhost:3000 - ⚙️ Backend server on
http://localhost:5000
Powered by
concurrentlyto handle both in parallel.
POST /api/users– Register userGET /api/users– List all users
POST /api/sessions– Create sessionGET /api/sessions– List all sessionsGET /api/sessions/:id– Fetch specific session
| Event | Direction | Payload | Description |
|---|---|---|---|
join-session |
Client → Server | { sessionId, user } |
Join a specific session |
code-change |
Client → Server | { code } |
Send code update |
receive-code |
Server → Client | { code } |
Receive and render updated code |
send-comment |
Client → Server | { comment } |
Post a comment |
receive-comment |
Server → Client | { comment } |
Receive and display comment |
user-joined |
Server → Client | { user } |
Notify others when someone joins |
- Users register with a username and select a role
- Join or create a session
- Backend handles user and session management
- Socket.IO enables live collaboration
- Monaco Editor handles real-time code updates
- Role-based rules apply to code and comments
Frontend
- React.js
- React Router
- Socket.IO Client
- Axios
Backend
- Node.js
- Express.js
- Socket.IO
- UUID
- CORS
- 🔐 JWT Authentication
- 💾 MongoDB for persistent sessions
- 🎬 Session History + Playback
- 🌙 Theme toggling (Dark/Light)
- 🛑 Admin Moderation Tools
- 📂 File/Folder System
| Name | Contribution |
|---|---|
| Soham | Figma Design & Documentation, Backend – Role-Based Access Control, Minor Bug Fixes |
| Prince | Frontend – Editor Routing & Page Management |
| Devesh | Backend – Real-time Code Collaboration, Chat System, Input/Output Logic |
| Sachin | Frontend – Dashboard, Homepage, CSS, Login and Signup Pages |
| Himkar | Backend – Authentication System, JWT Integration, Google Auth, Session Timeout, Minor Bug Fixes |
-
Fork this repo
-
Create a new branch:
git checkout -b feature/your-feature
-
Commit your changes:
git commit -m "Add your feature" -
Push and open a PR:
git push origin feature/your-feature
Made by Team Code Crux