Skip to content

raimaAsghar/Interview-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Interview-AI

An AI-powered fullstack web application that analyzes your resume, generates personalized interview reports, and creates a professional PDF resume β€” all in one place.

✨ Features

  • πŸ” JWT Authentication β€” Secure register, login & logout with cookie-based tokens
  • 🚫 Token Blacklisting β€” Invalidate tokens on logout for enhanced security
  • πŸ“„ Resume Upload β€” Upload your resume via Multer file handling
  • πŸ€– AI Interview Report β€” AI analyzes your resume and generates a structured interview report
  • πŸ“Š Report Management β€” View, store, and revisit all your past interview reports
  • πŸ“‘ PDF Resume Generation β€” Converts AI-generated content into a downloadable PDF using Puppeteer
  • πŸ›‘οΈ Protected Routes β€” Auth-guarded pages on both frontend and backend
  • βœ… Zod Validation β€” Strict schema validation for all AI responses

πŸ—οΈ Tech Stack

Backend

Technology Purpose
Node.js + Express REST API server
MongoDB Atlas + Mongoose Database & ODM
JWT + Cookies Authentication
Multer Resume file uploads
Zod AI response schema validation
Puppeteer PDF generation
AI Service (Gemini/OpenAI) Interview report generation

Frontend

Technology Purpose
React + Vite UI framework & build tool
React Router Client-side routing & protected routes
SCSS Styling
Axios HTTP requests (service layer)
Context API Global state management
Custom Hooks Reusable logic (useAuth, useInterview)

πŸ“ Project Structure

Interview-AI/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ authController.js       # Register, Login, Logout, GetMe
β”‚   β”‚   └── interviewController.js  # Generate report, Get reports
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ userModel.js            # User schema
β”‚   β”‚   β”œβ”€β”€ blacklistModel.js       # Token blacklist schema
β”‚   β”‚   └── interviewReportModel.js # AI report schema
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   └── interviewRoutes.js
β”‚   β”œβ”€β”€ middleware/
β”‚   β”‚   └── authMiddleware.js       # JWT verification
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── aiService.js            # AI integration logic
β”‚   └── server.js
β”‚
└── Frontend/
    β”œβ”€β”€ src/
    β”‚   β”œβ”€β”€ pages/
    β”‚   β”‚   β”œβ”€β”€ Login.jsx
    β”‚   β”‚   β”œβ”€β”€ Register.jsx
    β”‚   β”‚   └── Home.jsx
    β”‚   β”œβ”€β”€ context/
    β”‚   β”‚   β”œβ”€β”€ AuthContext.jsx
    β”‚   β”‚   └── InterviewContext.jsx
    β”‚   β”œβ”€β”€ hooks/
    β”‚   β”‚   β”œβ”€β”€ useAuth.js
    β”‚   β”‚   └── useInterview.js
    β”‚   β”œβ”€β”€ services/
    β”‚   β”‚   └── api.js              # Axios instance + API calls
    β”‚   └── App.jsx
    └── vite.config.js

🧠 Frontend Architecture (4 Layers)

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        UI Components            β”‚  ← React Pages & Components
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      Custom Hooks               β”‚  ← useAuth, useInterview
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Context / State Management    β”‚  ← AuthContext, InterviewContext
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚      Service Layer              β”‚  ← Axios API calls
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ€– AI Feature Flow

User uploads resume
        ↓
Multer saves file β†’ Backend receives it
        ↓
AI Service processes resume
        ↓
Zod validates AI response schema
        ↓
Report saved to MongoDB
        ↓
Frontend fetches & displays report
        ↓
User downloads PDF (via Puppeteer)

πŸš€ Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB Atlas account
  • AI API key (Google Gemini or OpenAI)

1. Clone the Repository

git clone https://github.com/raimaAsghar/Interview-AI.git
cd Interview-AI

2. Backend Setup

cd Backend
npm install

Create a .env file in the Backend/ directory:

PORT=3000
MONGO_URI=your_mongodb_atlas_connection_string
JWT_SECRET=your_jwt_secret_key
AI_API_KEY=your_ai_api_key
CLIENT_URL=http://localhost:5173

Start the backend server:

npm run dev

3. Frontend Setup

cd Frontend
npm install
npm run dev

The app will be running at http://localhost:5173


πŸ“‘ API Endpoints

Auth Routes β€” /api/auth

Method Endpoint Description Auth Required
POST /register Register a new user ❌
POST /login Login & get token ❌
POST /logout Logout & blacklist token βœ…
GET /me Get current user info βœ…

Interview Routes β€” /api/interview

Method Endpoint Description Auth Required
POST /generate Upload resume & generate AI report βœ…
GET /reports Get all reports for current user βœ…
GET /reports/:id Get a single report by ID βœ…
POST /resume-pdf Generate resume PDF via Puppeteer βœ…

πŸ” Authentication Flow

Register/Login
     ↓
JWT Token β†’ Stored in HttpOnly Cookie
     ↓
Every request β†’ authMiddleware verifies token
     ↓
Logout β†’ Token added to Blacklist collection
     ↓
Blacklisted tokens are rejected on all future requests

πŸ› οΈ Future Improvements

  • Voice-based mock interview mode
  • Interview question practice with AI feedback
  • Dashboard with analytics across reports
  • Email notifications for report completion
  • Support for multiple resume formats (DOCX, LinkedIn import)

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

Raima Asghar


If you found this project helpful, please ⭐ star the repo!

About

πŸ€– AI-powered mock interviews β€” get hired, not stressed

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors