How saurabh-code88/collab-code works
CollabCode is a browser-based collaborative editor with Personal and Interview modes. Users authenticate, create or join a room, then edit and collaborate through a shared session; Personal mode adds AI help, while Interview mode adds a timer, private notes, and feedback. The client’s editor coordinates editing and room features; the server handles room events and APIs, with persistent room state in Redis or memory. The excerpts do not show every server handler, so some backend relationships rely on the README’s architecture and API/event descriptions.
Main entry points: server.js HTTP and socket server · EditorPage.jsx Editor session · api.js HTTP API client · Sidebar.jsx Session sidebar
Components 21
Browser client
- App routing
client/src/App.jsx - Authentication UI
client/src/components/AuthPage.jsx - HTTP API client
client/src/api.js - Room creation and join
client/src/components/Landing.jsx - AI coding assistant
client/src/components/AIChatPanel.jsx
Room collaboration
- Editor session
client/src/components/EditorPage.jsx - Socket connection
client/src/socket.js - File tabs
client/src/components/FileTabs.jsx - Session sidebar
client/src/components/Sidebar.jsx - Room chat
client/src/components/ChatPanel.jsx - Participant list
client/src/components/UserList.jsx - Execution output
client/src/components/OutputPanel.jsx - Editor toolbar
client/src/components/Toolbar.jsx
Interview mode
- Interview controls
client/src/components/InterviewPanel.jsx
Backend services
- HTTP and socket server
server/server.js - JWT and passwords
server/auth.js
Persistence
- Room and user store
server/store.js - Redis persistence
Other components
- Room participant
- Groq AI API
- Judge0 execution
Connections 31
- Room participant → App routing: uses
README.md - App routing → Authentication UI: renders
client/src/App.jsx - App routing → Room creation and join: renders
client/src/App.jsx - App routing → Editor session: renders
client/src/App.jsx - Authentication UI → HTTP API client: requests through
client/src/components/AuthPage.jsx - Room creation and join → HTTP API client: requests through
client/src/components/Landing.jsx - Editor session → Socket connection: uses
client/src/components/EditorPage.jsx - Editor session → File tabs: renders
client/src/components/EditorPage.jsx - Editor session → Session sidebar: renders
client/src/components/EditorPage.jsx - Editor session → Execution output: renders
client/src/components/EditorPage.jsx - Editor session → Editor toolbar: renders
client/src/components/EditorPage.jsx - Session sidebar → Participant list: renders
client/src/components/Sidebar.jsx - Session sidebar → Room chat: renders
client/src/components/Sidebar.jsx - Session sidebar → AI coding assistant: renders
client/src/components/Sidebar.jsx - Session sidebar → Interview controls: renders
client/src/components/Sidebar.jsx - Editor session → HTTP API client: requests through
client/src/components/EditorPage.jsx - AI coding assistant → HTTP API client: requests through
client/src/components/AIChatPanel.jsx - Interview controls → HTTP API client: requests through
client/src/components/InterviewPanel.jsx - HTTP API client → HTTP and socket server: sends HTTP requests
README.md - Socket connection → HTTP and socket server: connects by WebSocket
README.md - HTTP and socket server → JWT and passwords: uses
server/server.js - HTTP and socket server → Room and user store: uses
server/server.js - HTTP and socket server → Groq AI API: requests AI completion
server/server.js - HTTP and socket server → Judge0 execution: submits code
server/server.js - Room and user store → Redis persistence: persists room state
README.md - HTTP and socket server → Room and user store: stores chat and session data
README.md - Interview controls → Socket connection: emits notes and timer events
client/src/components/InterviewPanel.jsx - Room participant → Room creation and join: creates or joins room
client/src/components/Landing.jsx - Editor session → HTTP and socket server: runs code
client/src/components/EditorPage.jsx - AI coding assistant → HTTP and socket server: sends prompt and code
client/src/components/AIChatPanel.jsx - Interview controls → HTTP and socket server: saves feedback
client/src/components/InterviewPanel.jsx