PrepRole AI is a full-stack, AI-powered interview preparation platform that helps candidates prepare for a specific job using their resume, profile, and target job description.
The platform analyzes how well a candidate matches a role and generates personalized technical questions, behavioral questions, skill-gap analysis, preparation recommendations, and an ATS-friendly tailored resume using Google Gemini.
Application: YOUR_LIVE_URL
Preparing for an interview often means switching between job descriptions, resumes, interview-question websites, and generic AI tools.
PrepRole AI brings that process into one application.
A user provides:
- Target job title
- Company name (optional)
- Job description
- Personal/profile information
- Existing PDF resume
PrepRole AI then uses this information to create a personalized interview preparation report based on the specific candidate and role.
PrepRole AI combines the candidate's resume, profile, and target job description to generate a structured interview preparation report using Google Gemini.
The application generates a 0–100 match score representing how closely the candidate's current profile aligns with the target position.
Role-specific technical questions are generated along with:
- What the interviewer is evaluating
- Important concepts to cover
- Suggested answers
The application generates behavioral questions based on the candidate's background and the responsibilities of the target role.
PrepRole AI identifies skills or areas where additional preparation may be required and categorizes gaps by severity.
Based on the analysis, the application creates an actionable preparation roadmap to help the candidate focus on the most important areas before the interview.
Users can upload an existing PDF resume.
The backend extracts the resume content and uses it as additional context when generating the interview report.
PrepRole AI can generate an ATS-friendly PDF resume tailored to the selected job while keeping the candidate's existing experience and background as the source material.
Authenticated users can save and manage previous interview reports.
Users can:
- View previous reports
- Revisit interview preparation
- Navigate paginated history
- Delete reports
The dashboard provides an overview of the user's preparation activity, including:
- Total interviews
- Average match score
- Best match score
The application includes:
- User registration
- Login
- Logout
- Protected routes
- Session revocation
- Account deletion
- React 19
- Vite
- React Router
- Axios
- Sass
- Lucide React
- Lenis
- Node.js
- Express 5
- MongoDB
- Mongoose
- Google Gemini (
@google/genai) - JWT
- bcryptjs
- Zod
- Multer
- pdf-parse
- Puppeteer
- Helmet
- express-rate-limit
┌─────────────────────┐
│ React UI │
│ + Vite │
└──────────┬──────────┘
│
│ HTTP / REST
▼
┌─────────────────────┐
│ Express Backend │
│ │
│ Auth • Validation │
│ API • Rate Limits │
└──────┬────────┬─────┘
│ │
┌─────────┘ └─────────┐
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ MongoDB │ │ Google Gemini │
│ │ │ │
│ Users │ │ Interview │
│ Reports │ │ Analysis │
│ Sessions │ │ Resume Content │
└─────────────────┘ └─────────────────┘
.
├── backend/
│ ├── scripts/
│ │ └── syncIndexes.js
│ │
│ ├── src/
│ │ ├── config/
│ │ ├── controllers/
│ │ ├── middlewares/
│ │ ├── models/
│ │ ├── routes/
│ │ ├── schemas/
│ │ ├── services/
│ │ └── utils/
│ │
│ ├── test/
│ ├── .env.example
│ ├── package.json
│ └── server.js
│
├── frontend/
│ ├── public/
│ │
│ ├── src/
│ │ ├── components/
│ │ ├── context/
│ │ ├── features/
│ │ ├── hooks/
│ │ ├── layouts/
│ │ ├── services/
│ │ └── styles/
│ │
│ ├── .env.example
│ ├── package.json
│ └── vite.config.js
│
└── .gitignore
Users register or sign in to access the interview preparation dashboard.
The user provides information about the position they are preparing for, including the job title and job description.
The user's existing PDF resume is uploaded and its text is extracted by the backend.
PrepRole AI combines the:
Resume
+
Candidate Profile
+
Job Description
↓
Candidate / Role Context
The relevant context is sent to Google Gemini to generate structured interview preparation data.
AI-generated output is validated against application schemas before being accepted and stored.
The user receives a personalized report containing:
Interview Report
├── Match Score
├── Technical Questions
├── Behavioral Questions
├── Skill Gaps
└── Preparation Plan
The saved interview context can also be used to generate an ATS-friendly resume for the target role.
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
Application liveness check |
GET |
/ready |
Application readiness check |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/auth/register |
Create an account |
POST |
/api/auth/login |
Authenticate a user |
POST |
/api/auth/logout |
Log out and revoke the session |
GET |
/api/auth/get-me |
Get the authenticated user |
DELETE |
/api/auth/account |
Delete the authenticated account |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/interview |
Generate an interview report |
GET |
/api/interview |
Get paginated interview history |
GET |
/api/interview/stats |
Get dashboard statistics |
GET |
/api/interview/report/:interviewId |
Get an interview report |
DELETE |
/api/interview/report/:interviewId |
Delete an interview report |
POST |
/api/interview/resume/pdf/:interviewReportId |
Generate a tailored resume PDF |
Authentication is handled using an HTTP-only cookie.
Even though the application can be deployed, it can also be run locally for development.
Make sure you have:
- Node.js
- npm
- MongoDB
- Google Gemini API key
Clone or download the repository and open the project directory:
cd GenAI_ProjectNavigate to the backend:
cd backendInstall dependencies:
npm installCreate a .env file using .env.example as a reference:
NODE_ENV=development
PORT=3000
MONGO_URI=your_mongodb_connection_string
GOOGLE_API_KEY=your_google_gemini_api_key
GEMINI_MODEL=gemini-3.5-flash-lite
JWT_SECRET=your_strong_random_secret
CLIENT_URL=http://localhost:5173
COOKIE_SAME_SITE=laxGenerate a secure JWT secret with:
node -e "console.log(require('node:crypto').randomBytes(48).toString('base64url'))"Start the backend:
npm run devThe backend runs on:
http://localhost:3000
by default.
Open another terminal and navigate to:
cd frontendInstall dependencies:
npm installCreate a .env file using .env.example as a reference.
When an explicit backend URL is required:
VITE_API_URL=http://localhost:3000Start the frontend:
npm run devVite normally starts the application at:
http://localhost:5173
After deployment, the frontend should communicate with the deployed backend rather than localhost.
For example:
VITE_API_URL=YOUR_API_URLThe backend should allow requests from the deployed frontend:
NODE_ENV=production
MONGO_URI=your_production_mongodb_connection
GOOGLE_API_KEY=your_google_gemini_api_key
GEMINI_MODEL=gemini-3.5-flash-lite
JWT_SECRET=your_secure_production_secret
CLIENT_URL=YOUR_LIVE_URLActual production values should be configured through the deployment platform's environment-variable settings.
Never commit production secrets to the repository.
Interview generation accepts a PDF resume using multipart form data.
The frontend currently enforces:
- PDF format
- Non-empty files
- Maximum file size of 3 MB
The backend performs additional validation before extracting and processing resume content.
| Variable | Description |
|---|---|
NODE_ENV |
Application environment |
PORT |
Backend server port |
MONGO_URI |
MongoDB connection string |
GOOGLE_API_KEY |
Google Gemini API key |
GEMINI_MODEL |
Gemini model used for AI generation |
JWT_SECRET |
Secret used for authentication tokens |
CLIENT_URL |
Allowed frontend origin |
CLIENT_URLS |
Optional comma-separated list of allowed origins |
COOKIE_SAME_SITE |
SameSite configuration for authentication cookies |
| Variable | Description |
|---|---|
VITE_API_URL |
Backend API base URL |
Development server:
npm run devProduction server:
npm startTests:
npm testCheck MongoDB indexes:
npm run db:indexes:checkSynchronize MongoDB indexes:
npm run db:indexesDevelopment server:
npm run devProduction build:
npm run buildPreview production build:
npm run previewLint:
npm run lintTests:
npm testWatch mode:
npm run test:watchRun backend tests:
cd backend
npm testRun frontend tests:
cd frontend
npm testThe project includes tests covering areas such as:
- Authentication
- Request validation
- API errors
- HTTP security
- Rate limiting
- Database indexes
- Interview data security
- Resume PDF generation
- Pagination
- Session handling
- Server lifecycle behavior
- Routing helpers
Security is handled across multiple layers of the application.
- Password hashing with bcrypt
- JWT-based authentication
- HTTP-only authentication cookies
- Session revocation
- Per-user resource ownership checks
- Helmet security headers
- CORS restrictions
- Origin validation
- API rate limiting
- Additional rate limiting for expensive operations
- Zod request validation
Resume files are validated before their contents are processed.
User-provided content and resume text are treated as untrusted input when constructing AI requests.
AI-generated responses are validated against structured schemas before they are accepted or stored.
Sensitive values such as the following should never be committed:
.env
MONGO_URI
GOOGLE_API_KEY
JWT_SECRET
Store production credentials using your deployment provider's environment-variable or secret-management system.
The application consists of two independently deployable parts:
Frontend
│
│ HTTPS
▼
Backend API
│
├──────────► MongoDB
│
└──────────► Google Gemini API
Create the production build with:
cd frontend
npm run buildThe generated frontend can be hosted using a modern static/frontend hosting provider.
Run the production server with:
cd backend
NODE_ENV=production npm startThe backend can be hosted on a Node.js-compatible hosting platform.
Verify that:
- Production environment variables are configured
- MongoDB is accessible from the backend
- Gemini API credentials are configured
- Frontend points to the production API
- Backend allows the production frontend origin
- HTTPS is enabled
- Authentication cookies work across the deployed origins
- MongoDB indexes are synchronized
- Rate limiting is configured appropriately
Potential future additions include:
- AI mock interviews
- Voice-based interview practice
- Real-time answer evaluation
- AI feedback on interview responses
- Resume scoring
- Multiple resume versions
- Saved target jobs
- Interview progress tracking
- Advanced dashboard analytics
- Company-specific interview preparation
- Exportable preparation reports
This project is licensed under the ISC License.
PrepRole AI provides AI-generated interview preparation assistance. Generated questions, answers, match scores, skill-gap assessments, and resume suggestions should be treated as preparation guidance rather than guarantees of interview or hiring outcomes.
Prep smarter. Understand your gaps. Walk into your next interview prepared.