Skip to content

Navigation Menu

Sign in
Sign up

Latest commit

History

63 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

LevelUp.io β€” Intelligent Interview Preparation Platform

React Express PostgreSQL Socket.IO Claude AI License

Enterprise-grade technical interview platform powered by AI.
Real-time collaborative coding, AI-scored mock interviews, and 250+ curated problems β€” all in one place.

🌐 Live Demo

Features Β· Quick Start Β· API Reference Β· Architecture Β· Dataset


Table of Contents


Features

  • AI Mock Interviews β€” Conversational AI interviewer powered by Claude evaluates answers and returns scored feedback with grades, strengths, and improvement suggestions
  • Invite-Only Live Rooms β€” Interviewers create private sessions and invite candidates by username; only invited users can see and join their session
  • Real-Time Collaboration β€” Shared Monaco editor powered by Yjs/CRDT with live cursors, language switching, and instant in-browser code execution
  • 250+ Curated Problems β€” NeetCode 250 synced from LeetCode with difficulty filters, tag search, and pagination
  • Performance Analytics β€” Visual charts tracking AI interview scores over time by topic and grade
  • User Profile Management β€” Dedicated profile page where users can view their account info, change their password, and permanently delete their account
  • Role-Based Access Control β€” Distinct permission flows for Candidates, Interviewers, and Admins
  • Secure Authentication β€” JWT + httpOnly cookies, email verification, and password reset via email link

Tech Stack

Frontend

Technology Purpose
React 19 + Vite UI framework and build tooling
React Router v7 Client-side routing
Tailwind CSS v4 Utility-first styling with custom design tokens
Monaco Editor Code editor (same engine as VS Code)
Yjs + y-websocket CRDT-based real-time collaborative editing
Socket.IO Client Live room events (join, chat, code sync, problem selection)
Axios HTTP client with JWT interceptors
React Hook Form Form state management

Backend

Technology Purpose
Express 5 HTTP server and REST API
Prisma 7 + PostgreSQL ORM and relational database
Socket.IO WebSocket server for live rooms
y-websocket Yjs WebSocket provider for collaborative editing
Anthropic SDK (Claude) AI interview evaluation and feedback
bcrypt + JWT Password hashing and stateless authentication
Zod Request validation schemas
Redis (ioredis) Caching layer for problems and pending registrations
Nodemailer + Brevo Transactional email (verification, password reset)
Jest + Supertest Unit and integration testing

Project Structure

ai-interview-platform/
β”œβ”€β”€ backend/
β”‚ β”œβ”€β”€ config/
β”‚ β”‚ β”œβ”€β”€ config.js # Environment variables
β”‚ β”‚ β”œβ”€β”€ database.js # Prisma client
β”‚ β”‚ └── redis.js # Redis connection
β”‚ β”œβ”€β”€ controllers/
β”‚ β”‚ β”œβ”€β”€ authController.js # Register, login, password, profile
β”‚ β”‚ β”œβ”€β”€ sessionController.js
β”‚ β”‚ β”œβ”€β”€ problemController.js
β”‚ β”‚ β”œβ”€β”€ aiController.js
β”‚ β”‚ └── performanceController.js
β”‚ β”œβ”€β”€ middleware/
β”‚ β”‚ β”œβ”€β”€ auth.js # JWT verify + role-based access
β”‚ β”‚ β”œβ”€β”€ validate.js # Zod request validation
β”‚ β”‚ β”œβ”€β”€ errorHandler.js
β”‚ β”‚ β”œβ”€β”€ asyncHandler.js
β”‚ β”‚ └── rateLimit.js
β”‚ β”œβ”€β”€ prisma/
β”‚ β”‚ β”œβ”€β”€ schema.prisma # Database models
β”‚ β”‚ └── migrations/
β”‚ β”œβ”€β”€ routes/
β”‚ β”‚ β”œβ”€β”€ index.js
β”‚ β”‚ β”œβ”€β”€ authRoutes.js
β”‚ β”‚ β”œβ”€β”€ sessionRoutes.js
β”‚ β”‚ β”œβ”€β”€ problemRoutes.js
β”‚ β”‚ β”œβ”€β”€ aiRoutes.js
β”‚ β”‚ └── performanceRoutes.js
β”‚ β”œβ”€β”€ services/
β”‚ β”‚ β”œβ”€β”€ aiService.js # Claude API integration
β”‚ β”‚ β”œβ”€β”€ emailService.js # Verification + reset emails
β”‚ β”‚ └── cacheService.js # Redis helpers
β”‚ β”œβ”€β”€ sockets/
β”‚ β”‚ └── roomHandler.js # Socket.IO room event listeners
β”‚ β”œβ”€β”€ utils/
β”‚ β”‚ β”œβ”€β”€ jwt.js
β”‚ β”‚ β”œβ”€β”€ validators.js # Zod schemas
β”‚ β”‚ └── apiResponse.js # Standardized response format
β”‚ └── index.js # Server entry point
β”‚
└── frontend/
 └── src/
 β”œβ”€β”€ api/
 β”‚ └── axios.js # Axios instance with auth interceptors
 β”œβ”€β”€ components/
 β”‚ β”œβ”€β”€ ProtectedRoute.jsx
 β”‚ β”œβ”€β”€ SessionCard.jsx
 β”‚ β”œβ”€β”€ SessionList.jsx
 β”‚ └── PerformanceChart.jsx
 β”œβ”€β”€ context/
 β”‚ └── AuthContext.jsx # Global auth state
 └── pages/
 β”œβ”€β”€ Home.jsx
 β”œβ”€β”€ Login.jsx
 β”œβ”€β”€ Registar.jsx
 β”œβ”€β”€ VerifyEmail.jsx
 β”œβ”€β”€ ForgotPassword.jsx
 β”œβ”€β”€ ResetPassword.jsx
 β”œβ”€β”€ Dashboard.jsx
 β”œβ”€β”€ Profile.jsx
 └── LiveInterviewRoom.jsx

Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL
  • Redis
  • An Anthropic API key
  • A Brevo (Sendinblue) account for transactional email

1. Clone the repository

git clone https://github.com/your-username/levelup-io.git
cd levelup-io/ai-interview-platform

2. Install dependencies

# Backend
cd backend && npm install
# Frontend
cd ../frontend && npm install

3. Configure environment variables

Create a .env file inside the backend/ directory (see Environment Variables below).

4. Run database migrations

cd backend
npx prisma migrate deploy
npx prisma generate

5. Start all servers

Open three terminal tabs:

# Terminal 1 β€” REST API + Socket.IO (port 3000)
cd backend && npm run dev
# Terminal 2 β€” Yjs WebSocket server for collaborative editing (port 3001)
cd backend && npx y-websocket-server
# Terminal 3 β€” Vite frontend dev server (port 5173)
cd frontend && npm run dev

Open http://localhost:5173


Environment Variables

Create backend/.env with the following keys:

# Database
DATABASE_URL=postgresql://user:password@localhost:5432/levelup
# Server
PORT=3000
NODE_ENV=development
# Auth
JWT_SECRET=your_long_random_secret_here
JWT_EXPIRES_IN=7d
COOKIE_MAX_AGE=604800000
# Anthropic (Claude AI)
ANTHROPIC_API_KEY=sk-ant-...
# Redis
REDIS_URL=redis://localhost:6379
# Email (Brevo / Sendinblue)
BREVO_API_KEY=your_brevo_api_key
EMAIL_FROM=no-reply@yourdomain.com
# Frontend origin (for CORS + email links)
FRONTEND_URL=http://localhost:5173

Never commit your .env file. It is already listed in .gitignore.


API Reference

All endpoints are prefixed with /api/v1. Authenticated routes require a valid JWT either via Authorization: Bearer <token> header or the token httpOnly cookie set at login.

Auth

Method Endpoint Auth Description
POST /auth/register β€” Register β€” sends email verification link
GET /auth/verify-email?token= β€” Verify email and activate account
POST /auth/resend-verification β€” Resend verification email
POST /auth/login β€” Login, returns JWT + sets httpOnly cookie
POST /auth/logout β€” Clear auth cookie
GET /auth/me βœ“ Get current authenticated user
POST /auth/forgot-password β€” Send password reset link to email
POST /auth/reset-password β€” Reset password using token from email
PUT /auth/change-password βœ“ Change password (requires current password)
DELETE /auth/delete-account βœ“ Permanently delete account (requires password)

Sessions

Method Endpoint Role Description
GET /sessions Any List sessions (candidates see invitations only)
GET /sessions/:id Any Get session by ID (access-controlled)
POST /sessions Interviewer / Admin Create session and invite candidate by username
PUT /sessions/:id Interviewer / Admin Update session status
DELETE /sessions/:id Admin Delete session

Problems

Method Endpoint Auth Description
GET /problems β€” List problems (filters: difficulty, search, page, limit)
GET /problems/:id β€” Get problem with test cases and starter code
POST /problems/:id/run βœ“ Run code against test cases (JavaScript sandbox)
POST /problems/sync βœ“ Sync NeetCode 250 from LeetCode into the database

AI Interview

Method Endpoint Auth Description
POST /ai/evaluate βœ“ Submit answer for AI evaluation and scoring
GET /ai/history βœ“ Get past AI evaluation history

Performance

Method Endpoint Auth Description
GET /performance βœ“ Get aggregate performance stats by topic and grade

Socket.IO Events

The live room connects to http://localhost:3000 with a JWT passed in auth.token.

Event Direction Description
join-room Client β†’ Server Join a room (access checked against DB)
room-state Server β†’ Client Full room state sent on successful join
room-error Server β†’ Client Emitted when the user is not invited
user-joined Server β†’ Room Broadcast when a participant joins
user-left Server β†’ Room Broadcast on disconnect
code-change Bidirectional Real-time code sync (fallback to Yjs)
language-change Bidirectional Language switch sync across participants
chat-message Bidirectional Chat messages (last 100 kept in memory)
chat-typing Client β†’ Room Typing indicator broadcast
select-problem Client β†’ Server Interviewer selects a problem for the session
problem-selected Server β†’ Room Broadcasts selected problem to all participants

User Roles

Role Capabilities
CANDIDATE AI mock interviews Β· Problem practice Β· View own invitations Β· Join invited rooms
INTERVIEWER Everything above + Create sessions Β· Invite candidates by username Β· Select problems in room
ADMIN Everything above + Delete sessions Β· View all sessions

Database Schema

User
 id, name, email (unique), username (unique), password, role
 resetToken?, resetTokenExpiry?
 createdAt, updatedAt
 β†’ hostedSessions[], attendedSessions[], evaluations[]
InterviewSession
 id, title, role, level, status, scheduledAt
 interviewerId β†’ User
 candidateId β†’ User
AIEvaluation
 id, userId, question, answer, role, level, topic
 score, grade, strengths[], improvements[], idealAnswer
 createdAt
Problem
 id, title, slug (unique), difficulty
 description, examples (JSON), constraints[], testCases (JSON)
 starterCode (JSON), tags[]

Scripts

Backend

npm run dev # Start with nodemon (hot reload)
npm start # Production start
npm test # Run Jest test suite
npm run test:watch # Jest in watch mode

Frontend

npm run dev # Vite dev server
npm run build # Production build
npm run preview # Preview production build locally
npm run lint # ESLint

License

MIT

About

AI-powered collaborative interview platform built with Node.js, React, PostgreSQL and Claude API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /