ForkSpace is a realtime collaborative workspace for interview-style problem solving.
It is built for:
- peer DSA practice
- mock interviews
- mentor-led sessions
Instead of splitting the session across a call, a notes doc, a compiler, and a separate review tool, ForkSpace keeps the shared brief, code editor, runs, hidden tests, AI review, and session reporting in one room.
It is intentionally narrow: one problem, one shared solution, one focused workflow.
Recent product and workflow improvements reflected in this repo:
- Refined the landing, workspace, analysis, and report surfaces so the main workflow reads more clearly
- Added a daily challenge flow with LeetCode POTD and Codeforces daily picks plus leaderboard support
- Expanded Codeforces support with browsable catalog filters plus room-side URL import helpers
- Improved hidden test generation so room test sets refresh cleanly and useful failures can be promoted into sample tests
- Added stronger session intelligence and standalone solution analysis flows with shareable links, challenge links, and score-card sharing
- Improved execution feedback, sample comparison, and room-side report visibility
- Added cleaner fallback handling when AI quota or provider availability is limited
- Kept guest-first entry intact while improving signed-in history and report persistence
- Shared room-based coding with Socket.IO
- Live participant list and presence
- Driver / Navigator role support
- Session modes:
Peer Practice,Mock Interview,Mentoring - Remote cursor positions, usernames, colors, and selection highlights
- Shared run results so both users can debug the same execution outcome
- Theme and avatar personalization without changing the core room workflow
- Shared problem brief, prompt, constraints, notes, and sample I/O
- Daily challenge flow for LeetCode POTD and Codeforces daily practice
- Codeforces-first workflow with browsable catalog and room problem selection
- URL import helpers for supported problem pages, with manual editing kept available
- Manual statement/sample copy flow for reliable external problem setup
- Edge-case checklist for interview-style validation
- Recent run history stored in the room session
- Timer support for timed practice blocks
- Run C++, Python, and JavaScript solutions
- Judge0-backed code execution for normal runs/submissions
- Hidden test generation from the current problem statement
- Verified tests and stress tests shown separately
- Promote a hidden test into the visible sample suite when it is worth debugging in the room
- Output diffing for expected vs actual sample output
- Clear labels for pass, fail, timeout, crash, and stress-only results
- AI hints in the editor
- AI solution review with complexity, bug-risk, style, and optimization feedback
- Standalone analysis page with shareable analysis links
- Daily challenge submissions with leaderboard ranking when the analysed problem matches the current daily
- Head-to-head challenge links so one analysis result can be sent to someone else to beat
- Session intelligence reports with strengths, gaps, next steps, and session score
- Shareable session cards and report pages for recap, screenshots, or follow-up
- Shareable report pages and a signed-in report history screen
- Continue as guest for fast entry
- Sign up / sign in with JWT auth
- Avatar selection and profile persistence
- Saved room and run history for authenticated users
- Saved report history for authenticated users
- JSON-file persistence for room state and fallback intelligence logs
- MongoDB-backed persistence when configured
Client (React + CodeMirror)
|
| WebSocket (Socket.IO)
v
Express + Socket Server
|
|-- Room/session persistence
| (JSON files + MongoDB when available)
|
|-- Auth/history
| (JWT + MongoDB)
|
|-- AI analysis/hints
| (Groq / Gemini / Mistral with fallbacks)
|
|-- Codeforces catalog
|
|-- Daily challenges + challenge links
|
|-- Hidden tests
| (LLM-assisted planning + Piston execution)
|
`-- Judge0 API
(standard code execution)
server/server.jsis the main backend for auth, sockets, execution, analysis, reports, Codeforces import/catalog, and hidden testsapi/contains serverless-friendly analysis endpoints used for deployed share links and fallback analysis fetches- Room state is persisted locally under
server/data/ - Redis pub/sub is supported for horizontal Socket.IO scaling when
REDIS_URLis set - MongoDB is optional for local boot, but needed for full auth/history/report persistence
| Layer | Technology |
|---|---|
| Frontend | React 18, Vite, Tailwind CSS |
| Editor | CodeMirror |
| Realtime | Socket.IO |
| Backend | Node.js, Express |
| Auth | JWT, bcryptjs, MongoDB / Mongoose |
| AI | Groq, Gemini, Mistral |
| Execution | Judge0, Piston |
| Optional scaling | Redis adapter for Socket.IO |
- Node.js 18+
- npm
- MongoDB if you want authentication, report history, and saved user data
- A Judge0 API key for standard code execution
- At least one AI provider key if you want AI hints/review/report assistance
npm installRoot .env
VITE_SERVER_URL=http://localhost:5000server/.env
PORT=5000
CLIENT_URL=http://localhost:5173
APP_NAME=ForkSpace
APP_URL=http://localhost:5173
JUDGE0_API_URL=https://judge0-ce.p.rapidapi.com
JUDGE0_API_KEY=your_judge0_key_here
GROQ_API_KEY=your_groq_key_here
GEMINI_API_KEY=your_gemini_key_here
MISTRAL_API_KEY=your_mistral_key_here
JWT_SECRET=replace_this_with_a_real_secret
MONGODB_URI=mongodb://localhost:27017/forkspace
# Optional
REDIS_URL=redis://localhost:6379npm run dev:servernpm run dev:clienthttp://localhost:5173
npm run build
npm run start- Open the home page and continue as guest or sign in.
- Create a room or join an existing room ID.
- Pick a session mode:
Peer Practice,Mock Interview, orMentoring. - Add the problem manually, browse Codeforces, use a supported problem URL import helper, or start from the daily challenge flow.
- Choose the room language and solve together in the shared editor.
- Use
RunandSubmitto compare output against visible sample tests. - Use
Generate Teststo create verified and stress-style hidden tests, then promote useful failures into the sample suite when needed. - Use
Analyzefor solution review, daily challenge scoring, and optional challenge-link creation, then useReportfor the room/session summary. - Copy a share link for analysis, report, challenge, or session card pages if you want to send the result elsewhere.
ForkSpace/
|-- api/
|-- src/
| |-- components/
| | |-- Workspace/
| | |-- codeforces/
| | |-- common/
| | |-- sessionIntelligence/
| | `-- sidebar/
| |-- lib/
| |-- pages/
| `-- socket.js
|-- server/
| |-- data/
| |-- hidden-tests/
| |-- models/
| |-- services/
| |-- ai-server.js
| `-- server.js
|-- public/
`-- README.md
ForkSpace is intentionally not:
- a multi-file IDE
- a LeetCode-native platform clone
- a video-call platform
- a generic compiler playground
It is optimized for collaborative problem-solving sessions around one solution at a time.
- Realtime shared rooms
- Multi-language collaboration and execution
- Live cursors and shared run awareness
- Codeforces catalog workflow
- Supported problem URL import helpers
- Hidden tests and stress runs
- AI hints and solution review
- Standalone solution analysis pages
- Session intelligence reports and share links
- Shareable session cards
- Signed-in report history
- Room persistence across restart
- Deeper room history UX
- More structured mentoring/session note flows
MIT - see LICENSE.