CodeX is a collaborative code workspace built for teams that need shared editing, live communication, and AI-powered feedback. It pairs a React + Vite frontend with an Express backend, MongoDB storage, Socket.IO collaboration, and Google Gemini code review integration.
Teams can create projects, join shared rooms, collaborate on code in real time, send messages inside project rooms, execute JavaScript code on the server, and request AI review for project code.
The app includes authenticated dashboards, project rooms, live presence tracking, and WebRTC signaling support for audio/video call workflows.
- The repository contains screenshot and demo assets in
public/. - A hosted live deployment URL is not confirmed in source files.
- The existing README referenced a YouTube demo and deployment link that are not verifiable from the codebase.
Live link - https://codex-psi-murex.vercel.app/
Direct link: https://youtu.be/gB7qztH9BIg?si=hfeuMXsqUXkxoAHT
| Technology | Purpose |
|---|---|
| React 19 | UI framework |
| Vite | Build tooling |
| Tailwind CSS | Styling |
| Redux Toolkit | State management |
| React Router DOM | Client-side routing |
| @monaco-editor/react | Code editor UI |
| Socket.IO Client | Realtime collaboration |
| Framer Motion | Animations |
| React Hook Form | Form handling |
| Yup | Validation |
| axios | HTTP client |
| Sonner | Notifications |
| Recharts | Dashboard visuals |
| Technology | Purpose |
|---|---|
| Node.js | Server runtime |
| Express.js | HTTP API framework |
| Mongoose | MongoDB object modeling |
| Socket.IO | Realtime socket server |
| JSON Web Tokens | Authentication |
| Helmet | Security headers |
| Morgan | HTTP request logging |
| @google/generative-ai | Gemini AI code review |
| node:vm | Sandboxed JS execution |
| Technology | Purpose |
|---|---|
| MongoDB | Primary data store |
| Mongoose | Schema enforcement |
| Tool | Purpose |
|---|---|
| Vite | Frontend development |
| nodemon | Backend reload |
| ESLint | Linting |
| Prettier | Formatting |
| Jest | Backend tests |
| Vitest | Frontend tests |
| Playwright | E2E testing |
| cross-env | Cross-platform env scripts |
CodeX/
βββ Backend/
β βββ package.json
β βββ 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/
β βββ package.json
β βββ 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
| Field | Type | Notes |
|---|---|---|
| name | String | Required |
| teamName | String | Required, lowercase |
| code | String | Project source text |
| review | String | AI review output |
| Field | Type | Notes |
|---|---|---|
| projectId | ObjectId | References Project |
| teamName | String | Required |
| username | String | Required |
| message | String | Required |
| type | String | user, system, or notification |
| metadata | Object | Optional edit/reply tracking |
| Field | Type | Notes |
|---|---|---|
| teamName | String | Required, unique, lowercase |
| password | String | Hashed |
| members | Array | Member objects with activity state |
| Method | Endpoint | Description |
|---|---|---|
| POST | /register |
Register a new team and admin user |
| POST | /login |
Login and receive JWT |
| GET | /verify |
Verify current token |
| POST | /logout |
Logout and mark member inactive |
| GET | /team/:teamName/members |
Get team member list |
| PUT | /team/:teamName/member/:username/activity |
Update member active status |
| GET | /team/:teamName/messages |
Fetch team messages |
| Method | Endpoint | Description |
|---|---|---|
| POST | /create |
Create a new project |
| GET | /get-all |
List all team projects |
| GET | /:id |
Get project details |
| PUT | /:id |
Update project code |
| POST | /:id/execute |
Execute JavaScript code |
| POST | /:id/review |
Run AI review for project code |
| Method | Endpoint | Description |
|---|---|---|
| GET | /project/:projectId |
Fetch project chat messages |
| GET | /project/:projectId/unread |
Get unread message count |
| Method | Endpoint | Description |
|---|---|---|
| GET | /turn |
Fetch STUN/TURN ICE server config |
| Page | Route | Description |
|---|---|---|
| Landing | / |
Public landing page |
| Login | /login |
Team login form |
| Register | /register |
Team signup form |
| Dashboard | /dashboard, /projects, /team, /activity |
Main authenticated workspace |
| Create Project | /create-project |
New project creation page |
| Project Room | /project/:id |
Project collaboration and editor room |
| Meeting | /meeting, /meeting/:projectId |
Call / meeting interface |
| Active Members | /active-members |
Team presence view |
| Settings | /settings |
User settings page |
| Help | /help |
Help and documentation page |
| Notifications | /notifications |
Team notification feed |
| Not Found | /not-found |
404 fallback page |
- Auth strategy: JWT bearer tokens
- Token storage:
localStorageundercodex_token - Protected frontend routes:
PrivateRouteinFrontend/src/routes/Routes.jsx - Backend protection:
verifyTokenmiddleware inBackend/src/middlewares/authMiddleware.js - Team-scoped checks:
checkTeamAccessmiddleware for team-specific auth routes - Admin flag:
isAdminincluded in JWT payload
| Service | Purpose | Library |
|---|---|---|
| Google Gemini | AI code review generation | @google/generative-ai |
| Socket.IO | Realtime collaboration and signaling | socket.io, socket.io-client |
| Monaco Editor | Code editor UX | @monaco-editor/react |
| STUN/TURN | WebRTC NAT traversal | Browser RTC + backend config |
| axios | HTTP API requests | axios |
- Demo and screenshot assets exist under
public/(demo.png,dashboard.png,code.png,logout.png,codeXDemo.mp4). - The old README referenced a live deployment URL and YouTube embed; those are not verifiable from repository source files and are noted as not found in code.
- The root
package.jsoncontains only runtime dependencies forjsonwebtokenandsocket.io-client.
{
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:8000Node VM sandboxed code execution: Present
Uses node:vm and runs user code inside a VM context with timeout in project.service.js (line 3), project.service.js (line 37), project.service.js (line 65), project.service.js (line 68), project.service.js (line 70).
STUN/TURN config for WebRTC: Present
Backend exposes ICE config in webrtc.routes.js (line 13), reads env in config.js (line 20), config.js (line 23).
Frontend uses STUN/TURN and RTCPeerConnection in peer.js (line 17), peer.js (line 20), peer.js (line 65), and fetches backend TURN config at peer.js (line 95).
Playwright + Jest + Vitest: Present
Playwright config/spec in playwright.config.js (line 1), flow.spec.js (line 1).
Jest in backend test setup/deps: package.json (line 12), package.json (line 42).
Vitest in frontend scripts/deps: package.json (line 12), package.json (line 51), setup file setup.js (line 3).
Monaco Editor: Present
Dependency in package.json (line 16).
Editor component usage and mount/commands in CodeEditor.jsx (line 2), CodeEditor.jsx (line 182), CodeEditor.jsx (line 575).
- 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
**Happy Coding with CodeX! **





