CodeCollab

A collaborative coding interview platform with a live editor, video, anti-cheat monitoring, test-case scoring, and an AI scheduling assistant.

Need for Code 4.0

🎓 Thadomal Shahani Engineering College

📌 Bandra, Maharashtra

🚀 36 hours Hackathon Project

What it is

CodeCollab is a web platform for running technical interviews. An interviewer schedules a session, adds coding problems with test cases, and joins a shared room with the candidate. The room has a live code editor, a video call, chat, and live subtitles. The app also flags tab switching, pasted code, and gaze direction, and it scores each problem by the share of test cases that pass. A team of three built it for the Need for Code 4.0 hackathon.

The problem

The hackathon problem statement was to build a collaborative coding interview platform with AI-powered features. A remote interview needs several tools at once: a scheduler, a shared editor, a way to run code against tests, a video channel, and some assurance that the candidate works unaided. CodeCollab combines these in one app so the interviewer stays in a single window.

How it works

CodeCollab is a single SvelteKit app (Svelte 5) with a PostgreSQL database accessed through Prisma. Better Auth handles sign-in with email and password or Google. Each user has a role, Interviewer or Interviewee.

The Prisma schema (prisma/schema.prisma) models the interview:

  • An Interview links one interviewer and one interviewee. It has a start and end time, a status of PENDING or COMPLETED, a roomId, and an overall score.
  • An interview has many Problems. Each problem has a score and many TestCases, each with an input and an expected output.
  • Messages store the chat between the two users, per interview.

Inside an interview room, each feature uses its own channel.

FeatureHow it is built
Shared editorTiptap with Yjs collaboration. A route (/api/tiptap-token) signs a JWT (JSON Web Token) for the room, and Tiptap's hosted provider syncs the document.
Code execution/api/submit sends code and test input to Judge0 through RapidAPI, then polls for the result.
Chat and live updatesServer-sent events (SSE) per room, handled by src/lib/sse-manager.ts. New problems and test cases also arrive this way.
VideoAgora RTC. /api/agora-token issues the access token.
Subtitles and transcriptThe browser streams audio from the call to a Whisper speech-to-text server over a WebSocket.
Gaze monitoringMediaPipe Face Landmarker runs in the browser (video-call.svelte).
AI assistant/api/chat streams a model response that can call tools.

The scoring flow works like this:

  1. The candidate runs a solution. The editor page sends the code to Judge0 once per test case.
  2. The page compares each program output with the expected output and counts passes.
  3. The page sends the counts to the problem's score endpoint, which stores round(passed / total * 100).
  4. The endpoint saves the new score only if it beats the stored one, so the best attempt counts.

What I built

I built the APIs for interviews, problems and test cases, the editor integration, transcript handling and the AI voice assistant. I also improved the code runner that scores submissions. Jay built the landing, auth, profile, dashboard and history pages, plus the editor and chat interface and the live updates. Sundaram built the Prisma and auth setup, the Judge0 integration, video calling, the gaze, tab and copy monitoring, and the test-case scores.

Design decisions

Hosted code execution. The app calls Judge0 instead of running candidate code on its own server. Running untrusted code is risky, and Judge0 provides sandboxing and many language runtimes. The trade-off is a dependency on an external service and a polling loop: /api/submit checks the result about once per second, for up to 30 attempts. The score endpoint also accepts pass counts from the browser, so the server does not recompute results.

Integrity alerts as chat messages. When a candidate switches tabs or pastes into the editor, the browser posts a SYSTEM ALERT message into the room channel. Paste alerts are debounced by two seconds. The interviewer's page watches for those messages. This reuses the existing chat and SSE path, so no new transport is needed. As an inference from the design, the alerts are ordinary messages, so they signal likely cheating but are not tamper-proof.

Gaze tracking in the browser. Face Landmarker runs on the candidate's machine. The code smooths a gaze vector, compares it with thresholds for sideways, upward, and downward looks, and starts a timer (3 seconds) when the candidate looks away. Because inference runs in the browser, video frames are not sent to the app server for this check. The model file loads from Google storage.

An AI assistant that acts through tools. The assistant uses the AI SDK with a 10-step limit. Its tools read and write interview data: list interviews, create or update an interview, list users, read the transcript, generate follow-up questions, and analyze code complexity. The complexity tool matches text patterns in the code, such as loops, so it gives a rough estimate and not a static analysis. The model is google/gemma-3-12b, served by LM Studio through an OpenAI-compatible URL set in LMSTUDIO_API_URL. A local model avoids API cost, but it needs a reachable host. The hackathon write-up records the team's later lesson to avoid local tunnels for AI models and to use a free hosted service instead.

Run it locally

You need Node.js 18 or later and a PostgreSQL database. The app also needs accounts or servers for the external services in the next list.

  1. Clone the repository and install dependencies. The postinstall script runs prisma generate:

    git clone https://github.com/Crew-object-Object/CodeCollab.git
    cd NFC4_-object-Object-
    npm install
    
  2. Create a .env file with these variables, which the source code reads:

    • DATABASE_URL
    • GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET
    • TIPTAP_SECRET
    • LMSTUDIO_API_URL
    • RAPID_API_KEY, RAPID_API_HOST, and JUDGE0_API_URL
    • PUBLIC_AGORA_APP_ID and PUBLIC_AGORA_APP_CERTIFICATE
    • PUBLIC_WHISPER_API_URL
  3. Create the database tables:

    npx prisma migrate dev
    npx prisma generate
    
  4. Start the development server:

    npm run dev
    

Reference

LayerChoiceUse
AppSvelteKit, Svelte 5, TypeScriptUI and API routes
UITailwind CSS 4, shadcn-svelteStyling and components
DataPostgreSQL, PrismaUsers, interviews, problems, test cases, messages
AuthBetter AuthEmail and Google sign-in, roles
EditorTiptap, YjsCollaborative editing with syntax highlighting
ExecutionJudge0 (RapidAPI)Running code against test cases
VideoAgora RTCInterview video call
VisionMediaPipe Tasks VisionGaze monitoring
AIAI SDK, LM StudioAssistant with tool calls

Outcome

CodeCollab was built at Need for Code 4.0, held on 5 August 2025 at Thadomal Shahani Engineering College in Bandra. The hackathon entry lists no placement. The repository was created on 5 August 2025 and has 109 commits through 6 August 2025. The repository homepage links to a Vercel deployment, which responded when last checked.

Liked CodeCollab? Here's my background.

Full-stack TypeScript, shipped to real users.