Skip to content

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

27 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Interview AI

Your AI-Powered Interview Preparation Companion

Node.js React MongoDB Gemini Express Vite

Live Demo

πŸ”— Live Demo: https://interview-ai-zeta-beryl.vercel.app/

Interview AI analyzes job descriptions against your resume or self-description using Google Gemini 2.5 Flash to generate a personalized interview preparation strategy β€” complete with tailored questions, skill-gap analysis, a day-by-day study plan, and an AI-generated, ATS-friendly resume PDF.

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


✨ Features

Feature Description
πŸ€– AI Interview Reports Upload your resume (PDF) or write a quick self-description, paste a job description, and get a comprehensive interview preparation report powered by Gemini 2.5 Flash.
πŸ“Š Match Score Get a 0–100 compatibility score showing how well your profile aligns with the target role.
πŸ’‘ Technical & Behavioral Q&A Receive curated interview questions with the interviewer's intent behind each question and a detailed suggested answer strategy.
πŸ” Skill Gap Analysis Identify missing skills rated by severity (low / medium / high) so you know exactly where to focus.
πŸ“… Day-by-Day Preparation Plan A structured, multi-day study roadmap with daily focus areas and actionable tasks.
πŸ“„ AI-Generated Resume PDF Generate a tailored, ATS-friendly resume PDF customized for the specific job description β€” downloadable in one click.
πŸ” Secure Authentication Full JWT-based auth flow with registration, login, logout, and token blacklisting for secure sessions.
πŸ“ Report History All generated reports are saved to your account β€” revisit any past interview plan anytime.

πŸ›  Tech Stack

Frontend

Technology Purpose
React 19 UI library with hooks & context for state management
React Router 7 Client-side routing with protected routes
Vite 8 Lightning-fast dev server and build tool
SCSS (Sass) Modular, feature-scoped styling

Backend

Technology Purpose
Express 5 HTTP server and REST API framework
MongoDB + Mongoose 9 NoSQL database with schema validation
Google GenAI SDK Gemini 2.5 Flash for AI-powered content generation
Zod Runtime schema validation with JSON schema conversion
JWT + bcryptjs Authentication and password hashing
Multer Multipart file upload handling (resume PDFs)
pdf-parse Extract text content from uploaded PDF resumes
Puppeteer Server-side HTML β†’ PDF rendering for resume generation

πŸš€ Quick Start

Prerequisites

  • Node.js v18 or higher
  • npm v9 or higher
  • MongoDB Atlas account (or a local MongoDB instance)
  • Google AI API Key β€” Get one here

1. Clone the repository

git clone https://github.com/<your-username>/interview-ai.git
cd interview-ai

2. Setup the Backend

cd Backend
npm install

Create a .env file in the Backend/ directory (use .env.example as reference):

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

# JWT secret key (generate a strong random string)
JWT_SECRET=your_jwt_secret_here

# Google Gemini API key
GOOGLE_GENAI_API_KEY=your_google_genai_api_key_here

Start the backend dev server:

npm run dev

The API server starts on http://localhost:3000.

3. Setup the Frontend

cd Frontend
npm install
npm run dev

The frontend dev server starts on http://localhost:5173.

4. Open the app

Navigate to http://localhost:5173 in your browser β€” you're all set! πŸŽ‰


πŸ“ Project Structure

interview-ai/
β”œβ”€β”€ Backend/
β”‚   β”œβ”€β”€ server.js                          # Entry point β€” loads env, connects DB, starts Express
β”‚   β”œβ”€β”€ .env.example                       # Template for environment variables
β”‚   β”œβ”€β”€ package.json
β”‚   └── src/
β”‚       β”œβ”€β”€ app.js                         # Express app setup (CORS, routes, middleware)
β”‚       β”œβ”€β”€ config/
β”‚       β”‚   └── database.js                # MongoDB connection via Mongoose
β”‚       β”œβ”€β”€ controllers/
β”‚       β”‚   β”œβ”€β”€ auth.controller.js         # Register, login, logout, get-me handlers
β”‚       β”‚   └── interview.controller.js    # Generate report, get reports, resume PDF
β”‚       β”œβ”€β”€ middlewares/
β”‚       β”‚   β”œβ”€β”€ auth.middleware.js          # JWT verification & token blacklist check
β”‚       β”‚   └── file.middleware.js          # Multer config for file uploads
β”‚       β”œβ”€β”€ models/
β”‚       β”‚   β”œβ”€β”€ user.model.js              # User schema (username, email, password)
β”‚       β”‚   β”œβ”€β”€ blacklist.model.js          # Blacklisted JWT tokens
β”‚       β”‚   └── interviewReport.model.js   # Full interview report schema
β”‚       β”œβ”€β”€ routes/
β”‚       β”‚   β”œβ”€β”€ auth.routes.js             # /api/auth/* endpoints
β”‚       β”‚   └── interview.routes.js        # /api/interview/* endpoints
β”‚       └── services/
β”‚           └── ai.service.js              # Gemini AI integration & PDF generation
β”‚
β”œβ”€β”€ Frontend/
β”‚   β”œβ”€β”€ index.html                         # HTML entry point
β”‚   β”œβ”€β”€ vite.config.js                     # Vite configuration
β”‚   β”œβ”€β”€ package.json
β”‚   └── src/
β”‚       β”œβ”€β”€ main.jsx                       # React DOM root
β”‚       β”œβ”€β”€ App.jsx                        # App shell with providers
β”‚       β”œβ”€β”€ app.routes.jsx                 # Route definitions (public + protected)
β”‚       β”œβ”€β”€ style.scss                     # Global SCSS styles
β”‚       β”œβ”€β”€ index.css                      # Base CSS reset / tokens
β”‚       └── features/
β”‚           β”œβ”€β”€ auth/
β”‚           β”‚   β”œβ”€β”€ auth.context.jsx       # Auth context provider
β”‚           β”‚   β”œβ”€β”€ auth.form.scss         # Auth form styles
β”‚           β”‚   β”œβ”€β”€ components/
β”‚           β”‚   β”‚   └── Protected.jsx      # Route guard component
β”‚           β”‚   β”œβ”€β”€ hooks/
β”‚           β”‚   β”‚   └── useAuth.js         # Auth hook (login, register, logout)
β”‚           β”‚   β”œβ”€β”€ pages/
β”‚           β”‚   β”‚   β”œβ”€β”€ Login.jsx          # Login page
β”‚           β”‚   β”‚   └── Register.jsx       # Registration page
β”‚           β”‚   └── services/
β”‚           β”‚       └── auth.api.js        # Auth API calls
β”‚           └── interview/
β”‚               β”œβ”€β”€ interview.context.jsx  # Interview context provider
β”‚               β”œβ”€β”€ hooks/
β”‚               β”‚   └── useInterview.js    # Interview hook (CRUD + PDF download)
β”‚               β”œβ”€β”€ pages/
β”‚               β”‚   β”œβ”€β”€ Home.jsx           # Dashboard β€” create report + history
β”‚               β”‚   └── interview.jsx      # Report detail β€” Q&A, roadmap, scores
β”‚               β”œβ”€β”€ services/
β”‚               β”‚   └── interview.api.js   # Interview API calls
β”‚               └── style/
β”‚                   β”œβ”€β”€ home.scss          # Home page styles
β”‚                   └── interview.scss     # Interview detail page styles
β”‚
β”œβ”€β”€ .gitignore
└── README.md

πŸ“‘ API Reference

Authentication

Method Endpoint Access Description
POST /api/auth/register Public Register a new user
POST /api/auth/login Public Login with email & password
GET /api/auth/logout Public Logout & blacklist token
GET /api/auth/get-me Private Get current user profile

POST /api/auth/register

{
  "username": "john_doe",
  "email": "john@example.com",
  "password": "securePassword123"
}

POST /api/auth/login

{
  "email": "john@example.com",
  "password": "securePassword123"
}

Interview Reports

Method Endpoint Access Description
POST /api/interview/ Private Generate a new interview report
GET /api/interview/ Private Get all reports for current user
GET /api/interview/report/:interviewId Private Get a specific report by ID
POST /api/interview/resume/pdf/:interviewReportId Private Generate & download a tailored resume PDF

POST /api/interview/ β€” Generate Interview Report

Send as multipart/form-data:

Field Type Required Description
jobDescription string βœ… Full job description text
selfDescription string Optional Brief self-description of your experience
resume file Optional Resume PDF file upload

Note: Either resume or selfDescription (or both) must be provided.

Response:

{
  "message": "Interview report generated successfully.",
  "interviewReport": {
    "_id": "...",
    "title": "Senior Frontend Engineer",
    "matchScore": 78,
    "technicalQuestions": [
      {
        "question": "Explain React's reconciliation algorithm.",
        "intention": "Assess deep understanding of React internals.",
        "answer": "Discuss the virtual DOM diffing process..."
      }
    ],
    "behavioralQuestions": [...],
    "skillGaps": [
      { "skill": "TypeScript", "severity": "medium" }
    ],
    "preparationPlan": [
      {
        "day": 1,
        "focus": "React Fundamentals",
        "tasks": ["Review hooks lifecycle", "Build a custom hook"]
      }
    ]
  }
}

πŸ— Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     β”‚  HTTP   β”‚            Backend              β”‚
β”‚   React Frontend    │◄───────►│  Express 5 REST API             β”‚
β”‚   (Vite + React 19) β”‚  :5173  β”‚  Port :3000                     β”‚
β”‚                     β”‚         β”‚                                 β”‚
β”‚  β€’ Auth Pages       β”‚         β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β€’ Home Dashboard   β”‚         β”‚  β”‚  Auth      β”‚ β”‚  Interview  β”‚  β”‚
β”‚  β€’ Interview Report β”‚         β”‚  β”‚  Routes    β”‚ β”‚  Routes     β”‚  β”‚
β”‚  β€’ Protected Routes β”‚         β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                     β”‚         β”‚        β”‚              β”‚         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”‚
                                β”‚  β”‚     Controllers           β”‚  β”‚
                                β”‚  β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                β”‚        β”‚              β”‚         β”‚
                                β”‚  β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”‚
                                β”‚  β”‚  MongoDB   β”‚ β”‚ AI Service β”‚  β”‚
                                β”‚  β”‚  (Mongoose)β”‚ β”‚ (Gemini)   β”‚  β”‚
                                β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                β”‚                      β”‚         β”‚
                                β”‚               β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”‚
                                β”‚               β”‚ Puppeteer   β”‚  β”‚
                                β”‚               β”‚ (PDF Gen)   β”‚  β”‚
                                β”‚               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
                                β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”’ Environment Variables

Variable Required Description
MONGO_URI βœ… MongoDB connection string
JWT_SECRET βœ… Secret key for signing JWT tokens
GOOGLE_GENAI_API_KEY βœ… Google AI / Gemini API key
FRONTEND_URL Optional Frontend origin for CORS (defaults to http://localhost:5173)

🀝 Contributing

Contributions are welcome! Here's how you can help:

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

πŸ“„ License

This project is licensed under the ISC License.


Built with ❀️ using Google Gemini AI

Star ⭐ this repo if you found it helpful!

About

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages