Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

10 Commits

Folders and files

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

Repository files navigation

πŸŽ™οΈ InterviewAI - AI-Powered Smart Interview Platform

React Vite Tailwind CSS Node.js MongoDB Groq AI Razorpay

InterviewAI is a modern, end-to-end mock interview platform that simulates realistic technical and HR interviews with interactive video avatars, speech synthesis, live speech-to-text recognition, and instant multi-metric AI evaluations.


🌟 Highlights & Features

πŸ“„ 1. Smart Resume Parsing & Customization

  • Upload your resume in PDF format.
  • Uses pdfjs-dist and AI extraction to identify your target role, years of experience, key projects, and skills.
  • Tailors interview questions strictly around your actual background and chosen mode (Technical or HR).

πŸ€– 2. Interactive Video Avatars & Voice Simulation

  • Animated Interviewer Avatars: Switch seamlessly between female and male interviewer video personas.
  • Speech Synthesis (TTS): Realistic audio playback of questions synchronized with interviewer video states.
  • Voice Recognition (STT): Speak naturally into your microphone using the Web Speech API with real-time speech-to-text transcription.
  • Manual Microphone Controls: Toggle mic recording anytime or review and edit transcribed responses before submitting.

⏱️ 3. Adaptive 5-Question Progression

  • Progressive difficulty curve designed to test depth of knowledge:
    • Q1 – Q2: Easy (60 seconds)
    • Q3 – Q4: Medium (90 seconds)
    • Q5: Hard (120 seconds)
  • Real-time countdown timer with automatic answer submission when time expires.

πŸ“Š 4. Multi-Metric AI Scoring & Honest Feedback

  • Every answer is evaluated on a 0 to 10 scale across three core competencies:
    • 🎯 Correctness: Accuracy, depth, and relevance to the question.
    • πŸ—£οΈ Communication: Clarity, phrasing, and articulation.
    • ⚑ Confidence: Delivery, poise, and structured thought.
  • Concise, actionable feedback (10–15 words) just like a human interviewer.

πŸ“‘ 5. Analytics Scorecard & PDF Export

  • Dynamic performance breakdown with interactive Recharts area charts and circular score rings.
  • Download an official, formatted PDF Performance Report generated on-the-fly using jspdf and jspdf-autotable.

πŸ’³ 6. Credit System & Razorpay Monetization

  • New users receive 100 Free Credits on signup (each 5-question interview consumes 50 credits).
  • Integrated Razorpay payment gateway with secure server-side HMAC-SHA256 signature verification.
    • Free Tier: 100 Credits (2 Full Interviews)
    • Starter Pack: β‚Ή100 for 150 Credits
    • Pro Pack: β‚Ή500 for 650 Credits (Best Value)

πŸ”’ 7. Secure Authentication

  • Instant one-click Google OAuth powered by Firebase.
  • HTTP-only JWT session cookies with secure same-site policies.

πŸ—οΈ Architecture & Workflow

flowchart TD
    User([Candidate]) -->|Google Sign-In| Auth[Firebase Auth & JWT Session]
    User -->|Upload PDF Resume| Upload[Multer & pdfjs-dist Text Extraction]
    Upload -->|Extracted Profile + Role + Mode| AI_Gen[Groq LLM: openai/gpt-oss-120b]
    AI_Gen -->|Generates 5 Tailored Questions| Session[Interactive Interview Stage]
    
    subgraph Interview Stage
        Session -->|SpeechSynthesis| AudioOut[Interviewer Avatar Video & Voice]
        User -->|Microphone Voice Input| STT[Web Speech API Recognition]
        STT -->|Transcribed Answer + Timer Check| SubmitAnswer[Submit Answer]
    end
    
    SubmitAnswer -->|Evaluate Answer| AI_Eval[AI Metric Evaluation: Confidence, Communication, Correctness]
    AI_Eval -->|Save Feedback & Scores| DB[(MongoDB)]
    
    DB -->|All 5 Answered| Report[Performance Scorecard & Recharts Analytics]
    Report -->|Export Report| PDF[Downloadable PDF jsPDF]
    
    User -->|Recharge Credits| Razorpay[Razorpay Payment Gateway]
    Razorpay -->|HMAC Verification| Credits[Add User Credits]
Loading

πŸ› οΈ Tech Stack

Frontend (/client)

Backend (/server)

  • Runtime & Framework: Node.js (ES Modules) + Express 5
  • Database: MongoDB via Mongoose 9
  • AI Engine: Groq Cloud (openai/gpt-oss-120b)
  • PDF Parsing: pdfjs-dist
  • File Handling: multer
  • Payments: razorpay Node SDK + Node.js crypto
  • Security & Sessions: jsonwebtoken (JWT), cookie-parser, cors, dotenv

πŸ“ Repository Structure

InterviewAI/
β”œβ”€β”€ client/                     # Frontend Vite + React application
β”‚   β”œβ”€β”€ public/                 # Static assets
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ assets/             # Images, icons, and interviewer avatar videos
β”‚   β”‚   β”‚   β”œβ”€β”€ videos/         # male-ai.mp4, female-ai.mp4
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ components/         # Reusable React components
β”‚   β”‚   β”‚   β”œβ”€β”€ AuthModel.jsx   # Google login dialog modal
β”‚   β”‚   β”‚   β”œβ”€β”€ Footer.jsx      # Application footer
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.jsx      # Navigation bar with credits display
β”‚   β”‚   β”‚   β”œβ”€β”€ Step1SetUp.jsx  # Resume upload & interview configuration
β”‚   β”‚   β”‚   β”œβ”€β”€ Step2Interview.jsx # Active video/voice interview room
β”‚   β”‚   β”‚   β”œβ”€β”€ Step3Report.jsx # Scorecard & PDF download view
β”‚   β”‚   β”‚   └── Timer.jsx       # Per-question countdown timer
β”‚   β”‚   β”œβ”€β”€ pages/              # Primary route views
β”‚   β”‚   β”‚   β”œβ”€β”€ Auth.jsx        # Authentication page
β”‚   β”‚   β”‚   β”œβ”€β”€ Home.jsx        # Landing page with feature showcases
β”‚   β”‚   β”‚   β”œβ”€β”€ InterviewHistory.jsx # Past interviews listing
β”‚   β”‚   β”‚   β”œβ”€β”€ InterviewPage.jsx    # Orchestrator for Steps 1, 2, and 3
β”‚   β”‚   β”‚   β”œβ”€β”€ InterviewReport.jsx  # Dedicated report permalink
β”‚   β”‚   β”‚   └── Pricing.jsx          # Credit packages & Razorpay checkout
β”‚   β”‚   β”œβ”€β”€ redux/              # Redux slices and store configuration
β”‚   β”‚   β”œβ”€β”€ utils/              # Firebase initialization
β”‚   β”‚   β”œβ”€β”€ App.jsx             # Route definitions & user session bootstrapper
β”‚   β”‚   β”œβ”€β”€ main.jsx            # React root mount
β”‚   β”‚   └── index.css           # Global Tailwind imports
β”‚   β”œβ”€β”€ .env.example            # Sample client environment variables
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”‚
β”œβ”€β”€ server/                     # Backend Express REST API
β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”œβ”€β”€ connectDb.js        # MongoDB connection handler
β”‚   β”‚   └── token.js            # JWT signing helper
β”‚   β”œβ”€β”€ controllers/
β”‚   β”‚   β”œβ”€β”€ auth.controller.js  # Google login & logout
β”‚   β”‚   β”œβ”€β”€ interview.controller.js # Resume parsing, Q-gen, scoring, reports
β”‚   β”‚   β”œβ”€β”€ payment.controller.js   # Razorpay order create & verify
β”‚   β”‚   └── user.controller.js  # Current user profile endpoint
β”‚   β”œβ”€β”€ middlewares/
β”‚   β”‚   β”œβ”€β”€ isAuth.js           # JWT authentication guard
β”‚   β”‚   └── multer.js           # Disk storage for PDF resumes
β”‚   β”œβ”€β”€ models/
β”‚   β”‚   β”œβ”€β”€ interview.model.js  # Interview schema with embedded questions
β”‚   β”‚   β”œβ”€β”€ payment.model.js    # Order & transaction records
β”‚   β”‚   └── user.model.js       # User account & credit balance
β”‚   β”œβ”€β”€ routes/
β”‚   β”‚   β”œβ”€β”€ auth.route.js       # /api/auth
β”‚   β”‚   β”œβ”€β”€ interview.route.js  # /api/interview
β”‚   β”‚   β”œβ”€β”€ payment.route.js    # /api/payment
β”‚   β”‚   └── user.route.js       # /api/user
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”œβ”€β”€ openRouter.service.js # Groq AI chat completion client
β”‚   β”‚   └── razorpay.service.js   # Razorpay client instance
β”‚   β”œβ”€β”€ index.js                # Express server entry point
β”‚   β”œβ”€β”€ .env.example            # Sample server environment variables
β”‚   └── package.json
β”‚
β”œβ”€β”€ .gitignore
└── README.md

πŸ”Œ API Reference

πŸ” Authentication (/api/auth)

Method Endpoint Description Auth Required
POST /api/auth/google Sign in or register via Google credential, returns user and sets cookie No
GET /api/auth/logout Clear session authentication cookie No

πŸ‘€ User (/api/user)

Method Endpoint Description Auth Required
GET /api/user/current-user Fetch currently logged-in user profile & credits Yes

🎯 Interview Operations (/api/interview)

Method Endpoint Description Auth Required
POST /api/interview/resume Upload PDF resume (multipart/form-data) and extract skills/projects Yes
POST /api/interview/generate-questions Generate 5 role-tailored questions (Costs 50 credits) Yes
POST /api/interview/submit-answer Submit answer for evaluation (Scores correctness, confidence, communication) Yes
POST /api/interview/finish Finalize interview and calculate weighted aggregate scores Yes
GET /api/interview/get-interview List all historical interviews for current user Yes
GET /api/interview/report/:id Fetch detailed report breakdown for a specific interview ID Yes

πŸ’³ Payments (/api/payment)

Method Endpoint Description Auth Required
POST /api/payment/create-order Create a Razorpay payment order for selected credit pack Yes
POST /api/payment/verify-payment Verify HMAC-SHA256 signature and credit the user account Yes

πŸš€ Getting Started

Prerequisites

Make sure you have installed:


1. Clone Repository

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

2. Configure Backend (server)

Navigate to the server directory:

cd server
npm install

Create a .env file based on .env.example:

cp .env.example .env

Fill in your server credentials:

PORT=6000
MONGODB_URL=mongodb+srv://<username>:<password>@cluster0.mongodb.net/interviewai
JWT_SECRET=your_super_secret_jwt_key
GROQ_API_KEY=gsk_your_groq_api_key_here
RAZORPAY_KEY_ID=rzp_test_your_key_id
RAZORPAY_KEY_SECRET=your_razorpay_secret

Start the backend server:

npm run dev
# Server will listen on http://localhost:6000

3. Configure Frontend (client)

Open a new terminal and navigate to the client directory:

cd client
npm install

Create a .env file based on .env.example:

cp .env.example .env

Fill in your frontend credentials:

VITE_FIREBASE_APIKEY=your_firebase_web_api_key
VITE_RAZORPAY_KEY_ID=rzp_test_your_key_id

Note on Backend URL: If running locally, check client/src/App.jsx and ensure ServerUrl points to http://localhost:6000 (or your active deployed backend URL).

Start the Vite development server:

npm run dev
# Application will run on http://localhost:5173

βš™οΈ Environment Variables Summary

Server Environment (server/.env)

Variable Description
PORT Port number the backend server runs on (Default: 6000)
MONGODB_URL MongoDB connection URI string
JWT_SECRET Secret key used to sign and verify JWT authentication tokens
GROQ_API_KEY Groq API key for LLM question generation & answer grading
RAZORPAY_KEY_ID Razorpay Key ID for processing payments
RAZORPAY_KEY_SECRET Razorpay Key Secret for cryptographic payment verification

Client Environment (client/.env)

Variable Description
VITE_FIREBASE_APIKEY Firebase API Key for Google OAuth authentication
VITE_RAZORPAY_KEY_ID Razorpay Public Key ID passed to the checkout modal

πŸ›‘οΈ License

This project is licensed under the ISC License. Feel free to fork, adapt, and build upon it!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages