Skip to content

IshaanPathak25/InterVista

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

45 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

InterVista - AI-Powered Mock Interview Platform

A comprehensive full-stack application for practicing interviews with AI-powered feedback, built with Next.js 14, Express.js, TypeScript, and Firebase Firestore.

πŸš€ Features

Frontend

  • ✨ Modern, responsive UI with Tailwind CSS + shadcn/ui
  • 🎨 Smooth animations using Framer Motion
  • πŸ” Complete authentication flow (sign-in, sign-up, reset password)
  • πŸ“Š Interactive dashboard with session management
  • πŸ“ Text-based interview interface with question-by-question flow
  • πŸ“ˆ AI-generated detailed evaluation with per-question feedback
  • 🎯 Animated landing page

Backend

  • πŸ”’ JWT-based authentication with bcrypt password hashing (httpOnly cookies)
  • πŸ—„οΈ Firebase Firestore database (all collections)
  • πŸ“ Audio file upload support (multer) with magic byte validation
  • πŸ€– Real AI evaluation with Groq (Llama 3)
  • πŸŽ™οΈ Voice features with OpenAI (Whisper + TTS)
  • πŸ”„ RESTful API with typed responses
  • πŸ›‘οΈ Security with Helmet and CORS

πŸ“‹ Prerequisites

  • Node.js v20+
  • npm or yarn
  • Firebase project with Firestore enabled
  • Groq API key and OpenAI API key

πŸ› οΈ Installation

1. Clone the repository

git clone <repository-url>
cd InterVista

2. Backend Setup

cd backend
npm install

Create .env file from the example:

cp .env.example .env

Edit .env with your configuration:

PORT=4000
NODE_ENV=development
FIREBASE_PROJECT_ID=your-project-id
FIREBASE_CLIENT_EMAIL=your-client-email@your-project-id.iam.gserviceaccount.com
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nYOUR_KEY_HERE\n-----END PRIVATE KEY-----\n"
JWT_SECRET=your-super-secret-jwt-key-at-least-64-characters
JWT_EXPIRES_IN=7d
CORS_ORIGINS=http://localhost:3000
GROQ_API_KEY=gsk_your_groq_api_key
OPENAI_API_KEY=sk-your-openai-api_key
SMTP_USER=your-email@example.com
SMTP_PASS=your-smtp-password

Firebase Setup:

  1. Create a Firebase project at https://console.firebase.google.com
  2. Enable Firestore Database
  3. Go to Project Settings β†’ Service Accounts β†’ Generate new private key
  4. Copy the project_id, client_email, and private_key values into .env

3. Frontend Setup

cd web
npm install

Create .env.local:

NEXT_PUBLIC_API_URL=http://localhost:4000

πŸš€ Running the Application

Start Backend

cd backend
npm run dev

Backend runs on http://localhost:4000

Start Frontend

cd web
npm run dev

Frontend runs on http://localhost:3000

πŸ“ Project Structure

InterVista/
β”œβ”€β”€ backend/                 # Express.js + TypeScript backend
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/         # Environment validation
β”‚   β”‚   β”œβ”€β”€ controllers/    # Auth, Session, Answer controllers
β”‚   β”‚   β”œβ”€β”€ db/             # Firestore initialization
β”‚   β”‚   β”œβ”€β”€ lib/            # AI (Anthropic Claude) integration
β”‚   β”‚   β”œβ”€β”€ middleware/     # JWT auth middleware
β”‚   β”‚   β”œβ”€β”€ routes/         # API route wiring
β”‚   β”‚   β”œβ”€β”€ types/          # TypeScript interfaces
β”‚   β”‚   └── server.ts       # Express app entry point
β”‚   └── uploads/            # Audio file storage
β”‚
└── web/                     # Next.js 14 (App Router)
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ app/            # App router pages
    β”‚   β”œβ”€β”€ components/     # React components (shadcn/ui)
    β”‚   β”œβ”€β”€ contexts/       # Auth context
    β”‚   └── lib/            # API client & utilities
    └── public/             # Static assets

πŸ” Authentication Flow

  1. User signs up β†’ password hashed with bcrypt (12 rounds)
  2. JWT token generated with a JTI and stored securely in an httpOnly cookie
  3. Session is maintained via the cookie, which is sent with all Credentials: "include" requests
  4. Sign out revokes the JWT using a Firestore blocklist
  5. On 401 response β†’ cookie cleared, redirect to sign-in
  6. GET /api/auth/me validates token and returns user on page load

πŸ€– AI Integration

InterVista uses Groq (Llama 3.3) and OpenAI for:

  • Question Generation: Groq generates 5 role-specific interview questions based on company, role, target difficulty and persona constraints
  • Answer Evaluation: Groq evaluates all answers asynchronously (202 Accepted pattern) and returns:
    • Overall score (0-100)
    • Recommendation (Strong Hire / Hire / Consider / No Hire)
    • Skills assessment (Communication, Technical Knowledge, Problem Solving, Confidence)
    • Per-question feedback with strengths and areas for improvement
  • Transcription: OpenAI Whisper transcribes candidate audio responses
  • Text-to-Speech: OpenAI TTS brings the interviewer personas to life

πŸ“ API Endpoints

Authentication

Method Endpoint Description Auth
POST /api/auth/signup Register new user No
POST /api/auth/signin Sign in user No
GET /api/auth/me Get current user Yes
POST /api/auth/reset-password Request password reset OTP No
POST /api/auth/verify-reset Verify OTP and reset password No

Sessions

Method Endpoint Description Auth
POST /api/sessions Create session + AI questions Yes
GET /api/sessions List user's sessions Yes
GET /api/sessions/:id Get session details Yes
GET /api/sessions/:id/questions Get session questions Yes

Answers

Method Endpoint Description Auth
POST /api/answers Submit answer (multipart) Yes
GET /api/answers/evaluation/:sessionId Get/generate AI evaluation (async 202) Yes
POST /api/answers/evaluation/:sessionId/retry Retry failed evaluation Yes
POST /api/auth/signout Sign out and revoke token Yes

All responses follow: { data: payload } on success, { error: string } on failure.

πŸ”§ Environment Variables

Backend

Variable Description Required
PORT Server port (default: 4000) No
NODE_ENV Environment No
FIREBASE_PROJECT_ID Firebase project ID Yes
FIREBASE_CLIENT_EMAIL Firebase service account email Yes
FIREBASE_PRIVATE_KEY Firebase service account private key Yes
JWT_SECRET JWT signing secret Yes
JWT_EXPIRES_IN Token expiration (default: 7d) No
CORS_ORIGINS Allowed origins (default: localhost:3000) No
GROQ_API_KEY Groq API key for Llama 3 Yes
OPENAI_API_KEY OpenAI API key for TTS/Whisper Yes
SMTP_USER SMTP username No
SMTP_PASS SMTP password No

Frontend

Variable Description Required
NEXT_PUBLIC_API_URL Backend API URL Yes

πŸ“¦ Tech Stack

Layer Technology
Frontend Next.js 14 (App Router), React 18, TypeScript
Styling Tailwind CSS v3, shadcn/ui, Framer Motion
Backend Express.js, TypeScript, Node.js v20+
Database Firebase Firestore
Auth JWT in httpOnly Cookies, bcrypt
AI (LLM) Groq (llama-3.3-70b-versatile)
AI (Audio) OpenAI (whisper-1, tts-1)
File Upload Multer

Made with ❀️ by the InterVista Team

About

AI-powered mock interview platform with real-time feedback, voice/text interview support, secure authentication, and modern full-stack architecture built using Next.js, Express, TypeScript, and Firebase.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages