Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Prepify 🎯

Live App Stack

An AI-powered interview preparation SaaS that simulates structured interviews, evaluates candidate responses with LLMs, and generates comprehensive diagnostic feedback reports.


📌 Table of Contents


💡 Overview & Problem Statement

  • The Problem: Job seekers and developers lack low-stress, interactive environments to practice technical and behavioral interviews. Traditional mock interviews are difficult to schedule, lack standardized scoring, and rarely provide immediate, actionable feedback.
  • The Solution: Prepify automates interview evaluation by combining full-stack MERN architecture with large language models. Users complete guided interview sessions and receive structured reports identifying conceptual gaps, communication clarity, and targeted areas for improvement.

🏗️ System Architecture

┌────────────────────────────────────────────────────────┐
│                   React + Vite Client                  │
│       (Tailwind CSS, Axios Interceptors)               │
└───────────────────────────┬────────────────────────────┘
                            │
                            │ HTTPS / RESTful API
                            ▼
┌────────────────────────────────────────────────────────┐
│                 Node.js / Express Server               │
│  ┌───────────────────┐        ┌─────────────────────┐  │
│  │  JWT Auth & CORS  │        │ Custom Rate Limiter │  │
│  └─────────┬─────────┘        └──────────┬──────────┘  │
│            │                             │             │
│            ▼                             ▼             │
│  ┌───────────────────┐        ┌─────────────────────┐  │
│  │ Interview Engine  │───────>│  LLM Report Service │  │
│  └─────────┬─────────┘        └──────────┬──────────┘  │
└────────────┼─────────────────────────────┼─────────────┘
             │                             │
             ▼                             ▼
   ┌──────────────────┐          ┌───────────────────┐
   │ MongoDB Database │          │ LLM / AI Provider │
   │ (Mongoose Models)│          │   (OpenAI API)    │
   └──────────────────┘          └───────────────────┘

✨ Key Features

  • AI-Driven Performance Reports: Transforms raw interview transcripts and user responses into categorized feedback highlighting strengths, technical depth, and specific blind spots using structured LLM prompts.

  • Session & Interview Lifecycle Management: Create, pause, retrieve, and review historical interview sessions backed by persistent MongoDB schemas.

  • Stateless Authentication & Resource Isolation: Implements secure JWT/cookie authentication to protect user records, ensuring session reports are private and strictly bound to owner accounts.

  • Defensive Rate Limiting: Enforces strict throughput throttling around expensive AI evaluation endpoints to prevent abuse, race conditions, and uncontrolled API cost overruns.

  • Responsive, Accessible Interface: Designed with Vite, React, Tailwind CSS, and Shadcn UI components with dynamic feedback using Lucide icons and React Toastify.

🛠️ Tech Stack

Layer Technologies
Frontend React 18, Vite, Tailwind CSS, Shadcn UI, Lucide React, Axios, React Toastify
Backend Node.js, Express.js, REST Architecture
Database MongoDB, Mongoose ODM
AI Integration Large Language Model (LLM) Inference APIs (OpenAI / External AI Gateway)
Security & Utilities JSON Web Tokens (JWT), HTTP-Only Cookies, Express Rate Limit, CORS
Deployment Vercel (Frontend), Render (Backend), MongoDB Atlas

🧠 Engineering Highlights & Design Decisions

  • Cost & Abuse Protection (Rate Limiting):

    • Challenge: Unrestricted access to LLM inference endpoints can lead to denial-of-wallet (DoW) attacks, API abuse, and unnecessary computation costs.
    • Solution: Implemented middleware-level rate limiting on /api/reports/generate to restrict report-generation frequency per user/IP while keeping previously generated reports accessible without triggering new LLM requests.
  • Structured LLM Output Validation:

    • Challenge: Non-deterministic LLM responses can produce malformed or inconsistent JSON, potentially breaking frontend rendering and corrupting persisted data.
    • Solution: Added defensive schema validation for AI-generated report payloads before persisting them to MongoDB, ensuring only structurally valid reports reach the database and client.
  • Decoupled Client–Server State Management:

    • Challenge: Multi-step interview workflows require reliable handling of asynchronous API operations without blocking or disrupting the user interface.
    • Solution: Separated API communication into modular Axios service layers and managed UI state locally at the component level, enabling predictable state transitions and responsive feedback during background report generation.

    🔌 API Overview

Method Endpoint Description Auth Required
POST /api/auth/register Register a new user No
POST /api/auth/login Authenticate user & issue token No
GET /api/interviews List all historical sessions for the active user Yes
POST /api/interviews Initialize a new interview session Yes
POST /api/reports/generate Generate AI report for a completed session (Rate Limited) Yes
GET /api/reports/:id Fetch detailed report by ID Yes

🚀 Getting Started

Prerequisites

Make sure the following are installed:

  • Node.js: >= 18.x
  • npm: >= 9.x
  • MongoDB: Local MongoDB instance or MongoDB Atlas

1. Clone the Repository

git clone https://github.com/abhay-0907/Prepify
cd prepify

Backend Setup:

cd backend
npm install
cp .env.example .env
# Add your environment variables in .env

npm run dev Backend runs on http://localhost:3000 by default.

2. Frontend Setup:

cd ../frontend
npm install
cp .env.example .env
# Set VITE_API_URL in .env
npm run dev
Frontend runs on http://localhost:5173.

⚙️ Environment Variables

Backend (/backend/.env)

PORT=3000
MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/prepify?retryWrites=true&w=majority

JWT_SECRET=your_jwt_secret_key

OPENAI_API_KEY=your_openai_api_key

FRONTEND_URL=http://localhost:5173

Frontend (/frontend/.env)

Releases

Packages

Contributors

Languages