CodeX is a real-time collaborative code editor with AI-assisted reviews, live chat, team presence, and WebRTC calling. Teams can edit code together, run JavaScript snippets, and get instant feedback in shared project rooms.
Live link - https://codex-psi-murex.vercel.app/
<iframe width="800" height="450" src="https://www.youtube.com/embed/gB7qztH9BIg" title="CodeX Demo Video" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen ></iframe>
CodeX/
βββ Backend/ # Node.js + Express server
β βββ server.js
β βββ src/
β βββ app.js
β βββ config/
β β βββ config.js
β βββ controllers/
β β βββ auth.controllers.js
β β βββ message.controllers.js
β β βββ project.controllers.js
β βββ db/
β β βββ db.js
β βββ middlewares/
β β βββ authMiddleware.js
β βββ models/
β β βββ message.model.js
β β βββ project.model.js
β β βββ team.model.js
β βββ routes/
β β βββ auth.routes.js
β β βββ message.routes.js
β β βββ project.routes.js
β β βββ webrtc.routes.js
β βββ services/
β β βββ ai.service.js
β β βββ auth.service.js
β β βββ call.service.js
β β βββ message.service.js
β β βββ project.service.js
β βββ tests/
β βββ auth.test.js
β βββ project.test.js
βββ Frontend/ # React + Vite application
β βββ index.html
β βββ vite.config.js
β βββ src/
β βββ App.jsx
β βββ main.jsx
β βββ index.css
β βββ api/
β β βββ config.jsx
β β βββ project.api.js
β βββ components/
β β βββ CallingPage.jsx
β β βββ ErrorBoundary.jsx
β β βββ HUD.jsx
β β βββ layout/
β β β βββ Layout.jsx
β β β βββ Navigation.jsx
β β β βββ Sidebar.jsx
β β βββ page/
β β β βββ ActiveMember.jsx
β β β βββ ActiveMemberPage.jsx
β β β βββ Help.jsx
β β β βββ Meeting.jsx
β β β βββ Notification.jsx
β β β βββ Settings.jsx
β β βββ ui/
β β βββ Button.jsx
β β βββ ResizableContainer.jsx
β βββ context/
β β βββ ThemeContext.jsx
β βββ lib/
β β βββ notify.js
β β βββ sounds.js
β βββ routes/
β β βββ Routes.jsx
β βββ services/
β β βββ dashboardService.jsx
β βββ store/
β β βββ hooks.js
β β βββ socketMiddleware.js
β β βββ store.js
β β βββ slices/
β β βββ authSlice.js
β β βββ callSlice.js
β β βββ projectSlice.js
β β βββ socketSlice.js
β βββ tests/
β β βββ Login.test.jsx
β β βββ setup.js
β βββ views/
β β βββ Dashboard.jsx
β β βββ Landing.jsx
β β βββ NotFound.jsx
β β βββ auth/
β β β βββ Login.jsx
β β β βββ Register.jsx
β β βββ create-project/
β β β βββ CreateProject.jsx
β β βββ home/
β β βββ project/
β β βββ Project.jsx
β β βββ components/
β β βββ ChatSection.jsx
β β βββ CodeEditor.jsx
β β βββ OutputPanel.jsx
β β βββ ReviewPanel.jsx
β βββ webrtc/
β βββ callManager.js
β βββ media.js
β βββ peer.js
βββ public/
β βββ code.png
β βββ codeXDemo.mp4
β βββ dashboard.png
β βββ demo.png
β βββ logo.png
β βββ logout.png
β βββ og-image.png
βββ tests/
β βββ playwright.config.js
β βββ e2e/
β β βββ flow.spec.js
β βββ load/
β βββ simulation.js
βββ package.json
βββ Readme.md
- Node.js
- Express.js
- MongoDB + Mongoose
- Socket.io
- Google Generative AI (Gemini)
- JWT authentication
- WebRTC signaling + STUN/TURN discovery
- Helmet, CORS, Morgan
- React 19 + Vite
- Tailwind CSS
- Redux Toolkit + Redux Persist
- React Router DOM
- Monaco Editor
- Socket.io Client
- Framer Motion
- React Hook Form + Yup
- Recharts
- WebRTC (peer connections, media devices)
- Jest + Supertest (Backend)
- Vitest + Testing Library (Frontend)
- Playwright (E2E)
- Live code sync across project rooms
- Instant updates using Socket.io
- Team presence with active user lists
- Google Gemini AI analysis
- Best-practice suggestions and feedback
- Review panel with markdown output
- Run JavaScript snippets in a sandboxed VM
- Output panel for stdout and errors
- Team-to-team or 1:1 calls
- ICE server discovery via
/api/webrtc/turn - Live call status and notifications
- Live chat with history
- Typing indicators
- Notifications and activity tracking
User β /api/auth/login β JWT β /api/projects/create β Project Created
Editor changes β Socket.io (code-change) β Synced to project room
Chat message β Socket.io (chat-message) β Stored in MongoDB
Get Review β /api/projects/:id/review or socket event β Gemini β Review Panel
Run Code β /api/projects/:id/execute β Node VM β Output Panel
Start Call β Socket.io signaling β /api/webrtc/turn β Peer connection
- POST
/register- Team registration - POST
/login- Login - GET
/verify- Verify token - POST
/logout- Logout - GET
/team/:teamName/members- Team members - PUT
/team/:teamName/member/:username/activity- Update member activity - GET
/team/:teamName/messages- Team messages
- POST
/create- Create project - GET
/get-all- List projects - GET
/:id- Get project - PUT
/:id- Update project (code) - POST
/:id/execute- Execute JavaScript code - POST
/:id/review- AI review
- GET
/project/:projectId- Project chat history - GET
/project/:projectId/unread- Unread count
- GET
/turn- ICE server configuration
join-project,leave-projectchat-history,chat-messagetyping-start,typing-stopcode-changeget-review,code-reviewuser-online,user-offline,team-presence,active-userscall:initiate,call:accept,call:reject,call:end,call:ice-candidate
/- Landing/login- Login/register- Register/dashboard- Dashboard/projects- Project list/create-project- Create project/project/:id- Project workspace/meeting- Meeting lobby/meeting/:projectId- Project meeting/active-members- Active members/settings- Settings/help- Help/notifications- Notifications/not-found- 404 page
{
name: String (required),
teamName: String (required),
code: String (default: ""),
review: String (default: ""),
timestamps: true
}{
projectId: ObjectId (Project),
teamName: String,
username: String,
message: String,
type: "user" | "system" | "notification",
metadata: { edited, editedAt, replyTo },
timestamps: true
}{
teamName: String (unique),
password: String (hashed),
members: [{ username, isAdmin, lastLogin, joinedAt, isActive }],
createdAt: Date,
updatedAt: Date
}- Node.js (v18 or higher)
- MongoDB database
- Google Gemini API key
cd Backend
npm install
npm startcd Frontend
npm install
npm run devCreate a .env file in Backend/:
PORT=8000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
GOOGLE_API_KEY=your_gemini_api_key
FRONTEND_URLS=http://localhost:5173,https://your-frontend-domain.com
STUN_URLS=stun:stun.l.google.com:19302
TURN_URLS=turn:your-turn-host:3478?transport=udp,turn:your-turn-host:3478?transport=tcp
TURN_USERNAME=your_turn_username
TURN_CREDENTIAL=your_turn_credentialCreate a .env file in Frontend/:
VITE_BACKEND_URL=http://localhost:8000- User navigates to
/create-project - Enters project name
- Backend creates MongoDB document
- User is redirected to project workspace
- Multiple users join the same project
- Each user connects via Socket.io
- Code changes are broadcasted to all users
- Chat messages are synchronized in real-time
- Developer clicks "Get Review"
- Current code is sent to Gemini AI service
- AI analyzes code and provides feedback
- Review is displayed in markdown
- Backend:
cd Backend && npm test - Frontend:
cd Frontend && npm run test - E2E:
npx playwright test(from repo root)
- Deploy to Render, Railway, Heroku, or AWS
- Set production environment variables
- Ensure MongoDB connection is accessible
- Build with
npm run build - Deploy to Vercel, Netlify, or any static hosting
- Point
VITE_BACKEND_URLto production API
- JWT-based authentication
- CORS allow-list configuration
- Input validation in controllers
- Secure API key storage in environment variables
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Frontend: React.js, Next.js, Redux, Tailwind CSS, Bootstrap, Framer Motion, Recharts
Backend: Node.js, Express.js, MongoDB, MySQL, JWT, Socket.io, Redis
DevOps: Docker, Git, Postman, Vercel, Render, Cloudinary
- MERN Full Stack Development
- Core Java
- Data Structures & Algorithms
**Happy Coding with CodeX! **




