Skip to content

Repository files navigation

ForkSpace Logo

ForkSpace

One shared room for DSA practice, mock interviews, and mentoring.

MIT License Node.js React Socket.IO

Quick Start | Latest Updates | Features | Architecture | License


What is ForkSpace?

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.


Latest Updates

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

Features

Realtime collaboration

  • 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

Interview 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

Execution and testing

  • 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

Analysis and reports

  • 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

Auth and persistence

  • 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

Architecture

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)

Notes

  • server/server.js is the main backend for auth, sockets, execution, analysis, reports, Codeforces import/catalog, and hidden tests
  • api/ 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_URL is set
  • MongoDB is optional for local boot, but needed for full auth/history/report persistence

Tech Stack

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

Quick Start

Prerequisites

  • 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

1. Install dependencies

npm install

2. Configure environment

Root .env

VITE_SERVER_URL=http://localhost:5000

server/.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:6379

3. Start the backend

npm run dev:server

4. Start the frontend

npm run dev:client

5. Open the app

http://localhost:5173

Optional production start

npm run build
npm run start

How To Use It

  1. Open the home page and continue as guest or sign in.
  2. Create a room or join an existing room ID.
  3. Pick a session mode: Peer Practice, Mock Interview, or Mentoring.
  4. Add the problem manually, browse Codeforces, use a supported problem URL import helper, or start from the daily challenge flow.
  5. Choose the room language and solve together in the shared editor.
  6. Use Run and Submit to compare output against visible sample tests.
  7. Use Generate Tests to create verified and stress-style hidden tests, then promote useful failures into the sample suite when needed.
  8. Use Analyze for solution review, daily challenge scoring, and optional challenge-link creation, then use Report for the room/session summary.
  9. Copy a share link for analysis, report, challenge, or session card pages if you want to send the result elsewhere.

Project Structure

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

Known Boundaries

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.


Roadmap Snapshot

  • 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

License

MIT - see LICENSE.

About

ForkSpace is a real-time collaborative DSA practice platform for peer sessions, mock interviews, and mentoring, combining a shared editor, code execution, hidden tests, AI analysis, and session reports in one workspace.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages