How avi-kedare-75/codepair works
CodePair is a browser-based collaborative coding workspace. Users authenticate, create or join rooms, then edit shared files, chat, call collaborators, and run code; the workspace also offers AI chat, inline suggestions, and complexity analysis. The server supplies REST endpoints and Socket.IO events, with MongoDB-backed users and room state and external AI and execution services. The graph follows documented routes and excerpted calls; some feature internals are unsampled, so their detailed connections are omitted.
Main entry points: EditorPage.jsx Collaborative workspace · app.js HTTP API · AppRoutes.jsx App routes · authRoutes.js Authentication routes
Components 29
Web client
- App routes
client/src/routes/AppRoutes.jsx - Sign in and register
client/src/pages/Home/Home.jsx - Auth state
client/src/context/AuthContext.jsx - HTTP client
client/src/services/api.js - Room dashboard
client/src/pages/Room/Dashboard.jsx - Collaborative workspace
client/src/pages/Room/EditorPage.jsx - Code editor
client/src/components/Editor/Editor.jsx - File explorer
client/src/components/Sidebar/Sidebar.jsx - Room chat
client/src/components/Chat/ChatPanel.jsx - Video calling
client/src/hooks/useWebRTC.jsx - AI workspace tools
client/src/components/Editor/AiPanel.jsx - Inline AI widget
client/src/components/Editor/AiInlineWidget.jsx - Complexity badge
client/src/components/Editor/ComplexityBadge.jsx - Socket client
client/src/services/socket.js
Application server
- HTTP API
server/src/app.js - Authentication routes
server/src/routes/authRoutes.js - Room routes
server/src/routes/roomRoutes.js - Collaboration events
server/src/config/socket.js - AI routes
server/src/routes/aiRoutes.js - AI service
server/src/services/aiService.js - Code execution
server/src/services/executeCode.js
Persistence
- User and OTP records
server/src/models/User.js - Room and file records
server/src/models/Room.js - OTP records
server/src/models/Otp.js
External services
- MongoDB
- AI providers
- Isolated execution API
- Email service
Other components
- Developer
Connections 36
- Developer → App routes: opens workspace
README.md - App routes → Sign in and register: routes to
client/src/routes/AppRoutes.jsx - App routes → Room dashboard: routes to
client/src/routes/AppRoutes.jsx - App routes → Collaborative workspace: routes to
client/src/routes/AppRoutes.jsx - Sign in and register → Auth state: uses auth
client/src/pages/Home/Home.jsx - Room dashboard → Auth state: uses auth
client/src/pages/Room/Dashboard.jsx - Auth state → HTTP client: sends requests
client/src/context/AuthContext.jsx - Auth state → HTTP API: auth requests
README.md - Room dashboard → HTTP API: room requests
README.md - Collaborative workspace → Code editor: renders
client/src/pages/Room/EditorPage.jsx - Collaborative workspace → File explorer: renders
client/src/pages/Room/EditorPage.jsx - Collaborative workspace → Room chat: renders
client/src/pages/Room/EditorPage.jsx - Collaborative workspace → Video calling: uses calling
client/src/pages/Room/EditorPage.jsx - Collaborative workspace → AI workspace tools: renders
client/src/pages/Room/EditorPage.jsx - Code editor → Inline AI widget: renders
client/src/components/Editor/Editor.jsx - Collaborative workspace → Complexity badge: renders
client/src/pages/Room/EditorPage.jsx - Collaborative workspace → Socket client: initializes
client/src/pages/Room/EditorPage.jsx - Socket client → Collaboration events: Socket.IO events
README.md - Collaborative workspace → AI routes: requests analysis
client/src/pages/Room/EditorPage.jsx - Collaborative workspace → Isolated execution API: runs code
README.md - HTTP API → Authentication routes: mounts
server/src/app.js - HTTP API → Room routes: mounts
server/src/app.js - HTTP API → AI routes: mounts
server/src/app.js - Authentication routes → User and OTP records: reads and writes
server/src/routes/authRoutes.js - Authentication routes → OTP records: reads and writes
server/src/routes/authRoutes.js - Authentication routes → Email service: sends OTP email
server/src/routes/authRoutes.js - Room routes → Room and file records: reads and writes
server/src/routes/roomRoutes.js - Collaboration events → Room and file records: uses room state
server/src/config/socket.js - Collaboration events → Code execution: dispatches execution
server/src/config/socket.js - Code execution → Isolated execution API: submits code
README.md - AI routes → Room and file records: loads room files
server/src/routes/aiRoutes.js - AI routes → AI service: calls AI tasks
server/src/routes/aiRoutes.js - AI service → AI providers: requests generation
server/src/services/aiService.js - User and OTP records → MongoDB: persists records
README.md - Room and file records → MongoDB: persists room state
README.md - OTP records → MongoDB: persists OTPs
README.md