Skip to content

aftabalam999/AI-Interviewer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– AI Interviewer

AI Interviewer Banner Node.js React MongoDB Socket.io

An Intelligent AI-Powered Interview Platform β€” Parse Resume, Generate Questions, Evaluate in Real-time.

Demo Β· Report Bug Β· Request Feature


πŸ“– About the Project

AI Interviewer is a full-stack web application that conducts AI-powered mock interviews for candidates. This platform:

  • Uploads and parses your Resume (PDF)
  • Generates intelligent interview questions based on Job Description and Topics (via RAG pipeline)
  • Asks real-time follow-up questions (through Socket.io streaming)
  • Evaluates every answer with AI and provides a detailed feedback report
  • Shows relevant jobs via the Job Board feature

✨ Key Features

Feature Description
πŸ“„ Resume Parsing PDF upload β†’ Text extraction β†’ Semantic chunking
🧠 RAG Pipeline LangChain + OpenAI Embeddings β†’ Context-aware question generation
πŸ’¬ Real-time Interview Live follow-up questions via Socket.io streaming
πŸ“Š AI Evaluation Score and feedback for each answer using Groq LLM
πŸ“ˆ Dashboard Interview history, scores, and performance analytics
πŸ’Ό Job Board Live job listings from Adzuna API
πŸ” Auth System JWT-based secure authentication
☁️ Cloud Storage Resume files stored on Cloudinary
⚑ Redis Cache For fast job search results and API responses

πŸ› οΈ Tech Stack

Backend

  • Runtime: Node.js + Express.js
  • Database: MongoDB (Mongoose)
  • AI / LLM: Groq SDK, LangChain, OpenAI Embeddings
  • Real-time: Socket.io
  • File Storage: Cloudinary + Multer
  • Cache: Redis (ioredis)
  • Auth: JWT (jsonwebtoken + bcryptjs)
  • Security: Helmet, CORS, express-rate-limit
  • Logging: Winston + Morgan
  • Job Search API: Adzuna

Frontend

  • Framework: React 18 + Vite
  • State Management: Zustand + TanStack React Query
  • Routing: React Router v6
  • UI / Animations: Framer Motion, Lucide React, React Icons
  • Styling: Tailwind CSS
  • Forms: React Hook Form
  • Charts: Recharts
  • Notifications: React Hot Toast
  • Real-time: Socket.io Client
  • Markdown: React Markdown

πŸ“ Project Structure

AI-Interviewer/
β”œβ”€β”€ backend/
β”‚   └── src/
β”‚       β”œβ”€β”€ server.js          # Entry point β€” HTTP + WebSocket server
β”‚       β”œβ”€β”€ app.js             # Express config β€” middleware, routes
β”‚       β”œβ”€β”€ socket.js          # Real-time follow-up Q&A logic
β”‚       β”œβ”€β”€ config/            # DB, Cloudinary, Groq, Logger
β”‚       β”œβ”€β”€ controllers/       # Route handlers
β”‚       β”‚   β”œβ”€β”€ auth.controller.js
β”‚       β”‚   β”œβ”€β”€ resume.controller.js
β”‚       β”‚   β”œβ”€β”€ interview.controller.js
β”‚       β”‚   β”œβ”€β”€ session.controller.js
β”‚       β”‚   └── user.controller.js
β”‚       β”œβ”€β”€ services/          # Business logic & AI integrations
β”‚       β”‚   β”œβ”€β”€ ai.service.js       # LLM orchestration
β”‚       β”‚   β”œβ”€β”€ rag.service.js      # RAG pipeline
β”‚       β”‚   β”œβ”€β”€ chunking.service.js # Semantic document splitting
β”‚       β”‚   └── optimizer.service.js
β”‚       β”œβ”€β”€ models/            # Mongoose schemas
β”‚       β”‚   β”œβ”€β”€ User.model.js
β”‚       β”‚   β”œβ”€β”€ Resume.model.js
β”‚       β”‚   β”œβ”€β”€ Interview.model.js
β”‚       β”‚   └── Session.model.js
β”‚       β”œβ”€β”€ routes/            # API route definitions
β”‚       β”œβ”€β”€ middleware/        # Auth, validation, error handling
β”‚       └── utils/             # Helpers β€” AppError, JWT, normalizer
β”‚
└── frontend/
    └── src/
        β”œβ”€β”€ App.jsx
        β”œβ”€β”€ main.jsx
        β”œβ”€β”€ pages/             # LandingPage, Dashboard, Interview, Jobs, etc.
        β”œβ”€β”€ components/        # Reusable UI components
        β”œβ”€β”€ context/           # React context providers
        β”œβ”€β”€ hooks/             # Custom React hooks
        β”œβ”€β”€ services/          # API call functions (axios)
        β”œβ”€β”€ store/             # Zustand state stores
        └── utils/             # Helper utilities

πŸš€ Getting Started

Prerequisites

The following must be installed before proceeding:


βš™οΈ Installation

1. Clone the Repository

git clone https://github.com/your-username/AI-Interviewer.git
cd AI-Interviewer

2. Backend Setup

cd backend
npm install

Create backend/.env file (by copying .env.example):

cp .env.example .env

Fill in your values in .env (see below πŸ‘‡)

3. Frontend Setup

cd ../frontend
npm install

Create frontend/.env file:

cp .env.example .env

πŸ”‘ Environment Variables

backend/.env

# Server
PORT=5000
NODE_ENV=development

# MongoDB
MONGO_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/ai_interview_db

# JWT
JWT_SECRET=your_super_secret_jwt_key_min_32_chars
JWT_EXPIRE=7d
JWT_REFRESH_SECRET=your_refresh_token_secret_min_32_chars
JWT_REFRESH_EXPIRE=30d

# Groq AI (Free LLM)
GROQ_API_KEY=your_groq_api_key_here

# OpenAI (For Embeddings)
OPENAI_API_KEY=your_openai_api_key_here

# Cloudinary (File Storage)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret

# Frontend URL (CORS)
CLIENT_URL=http://localhost:5173

# Redis
REDIS_ENABLED=true
REDIS_HOST=127.0.0.1
REDIS_PORT=6379

# Adzuna Job Search (Optional)
ADZUNA_APP_ID=your_app_id
ADZUNA_APP_KEY=your_app_key
ADZUNA_COUNTRY=in

frontend/.env

VITE_API_URL=http://localhost:5000

▢️ Run the Application

Backend (Terminal 1):

cd backend
npm run dev

Backend will start at http://localhost:5000.

Frontend (Terminal 2):

cd frontend
npm run dev

Frontend will open at http://localhost:5173.


πŸ”Œ API Endpoints

Method Endpoint Description
POST /api/auth/register Register a new user
POST /api/auth/login Login and get JWT token
POST /api/resumes/upload Upload Resume PDF
GET /api/resumes View all resumes
POST /api/interviews Create a new interview
GET /api/interviews/:id Interview details
POST /api/sessions Start an interview session
POST /api/sessions/:id/answer Submit and evaluate answer
GET /api/sessions/:id/report Final feedback report
GET /api/users/dashboard Dashboard stats

🧠 AI Flow β€” How It Works

Resume PDF Upload
       ↓
Text Extraction (pdf-parse)
       ↓
Semantic Chunking (LangChain TextSplitters)
       ↓
Vector Embeddings (OpenAI)
       ↓
Save to Vector Store
       ↓
Create Interview (Job Role + Topics)
       ↓
Query Optimization (optimizer.service.js)
       ↓
RAG Retrieval β€” fetch relevant resume chunks
       ↓
Question Generation (Groq LLM)
       ↓
Real-time Interview (Socket.io)
       ↓
Answer Evaluation (Groq LLM)
       ↓
Generate Final Report

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/AmazingFeature
  3. Commit your changes: git commit -m 'Add some AmazingFeature'
  4. Push the branch: git push origin feature/AmazingFeature
  5. Open a Pull Request

πŸ“„ License

This project is under the MIT License.


πŸ‘¨β€πŸ’» Author

Aftab Alam β€” AI Project


Made with ❀️ using Groq, React, and MongoDB

⭐ If you find this project helpful, please give it a Star!

About

AI-powered interview platform with RAG-based context awareness, real-time voice interviews, resume analysis, AI job recommendations, email OTP & Google authentication, and an admin dashboard. Built with the MERN stack, Groq (Llama 3.3), and vector search for grounded AI interactions.

Topics

Resources

License

Contributing

Security policy

Stars

4 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages