Skip to content

Latest commit

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

🧠 HireSync

Production-Ready Full Stack Gen AI Job Preparation Web App

Node.jsExpressReactMongoDBGeminiLicense: MIT

HireSync is a production-ready, AI-powered job preparation platform built with the MERN Stack and Google Gemini API. Users upload their resume and a job description to receive a personalized interview report — complete with AI-generated technical & behavioral questions, skill gap analysis, and an ATS-optimized resume PDF.

FeaturesArchitectureAPI EndpointsSetupTech Stack


🖥️ App Preview

HireSync Home Page


✨ Features

FeatureDescription
🔐 JWT AuthenticationSecure login/register with token blacklisting on logout
📧 OTP Email VerificationBrevo (Sendinblue) SMTP-based email OTP before account activation
📄 Resume Upload & ParsingMulter handles PDF uploads; Gemini AI parses resume content
🤖 AI Interview ReportGemini generates technical & behavioral questions based on resume + JD
📊 Skill Gap AnalysisAI compares user profile against job description to surface missing skills
🧾 ATS Resume PDFPuppeteer converts AI-generated HTML resume into downloadable PDF
🗂️ Report ManagementView, retrieve, and delete past interview reports
🧩 4-Layer FrontendUI → Service (Axios) → State (Context API) → Hooks

🏗 Project Architecture

HireSync Architecture


Folder Structure

HireSync/
│
├── backend/ # Node.js + Express server
│ ├── src/
│ │ ├── app.js # Express app entry point
│ │ │
│ │ ├── config/
│ │ │ ├── database.config.js # MongoDB connection via Mongoose
│ │ │ └── email.config.js # Brevo SMTP configuration
│ │ │
│ │ ├── controllers/
│ │ │ ├── auth.controllers.js # Register, Login, Logout, OTP logic
│ │ │ └── generateInterviewReport.controllers.js # AI report + PDF generation
│ │ │
│ │ ├── middlewares/
│ │ │ ├── auth.middleware.js # JWT verification middleware
│ │ │ └── file.middleware.js # Multer PDF/DOCX upload middleware
│ │ │
│ │ ├── models/
│ │ │ ├── user.models.js # User schema & model
│ │ │ ├── otp.models.js # OTP schema (time-limited, single-use)
│ │ │ ├── blacklist.models.js # JWT token blacklist on logout
│ │ │ └── InterviewReport.models.js # Interview report schema (Zod-validated)
│ │ │
│ │ ├── routes/
│ │ │ ├── auth.routes.js # /api/auth/* endpoints
│ │ │ └── interview.routes.js # /api/interview/* endpoints
│ │ │
│ │ ├── services/
│ │ │ ├── ai.services.js # Google Gemini API integration
│ │ │ └── email.services.js # Brevo email delivery (OTP + welcome)
│ │ │
│ │ └── utils/
│ │ └── utils.js # Shared utility functions
│ │
│ └── .env.example
│
└── frontend/ # React.js + Vite client
├── public/
│ └── assets/
│ └── auth-illustration.png
│
├── src/
│ ├── App.jsx # Root component & route definitions
│ ├── main.jsx # Vite entry point
│ ├── style.scss # Global styles
│ │
│ ├── components/
│ │ └── LoadingState.jsx # Shared loading spinner component
│ │
│ ├── features/
│ │ ├── auth/ # Authentication feature
│ │ │ ├── auth.context.jsx # Auth global state (Context API)
│ │ │ ├── auth.form.scss # Shared auth form styles
│ │ │ ├── components/
│ │ │ │ ├── Button.jsx # Reusable button component
│ │ │ │ └── Protected.jsx # Protected route wrapper
│ │ │ ├── hooks/
│ │ │ │ └── useAuth.js # Auth hook (login, register, logout)
│ │ │ ├── pages/
│ │ │ │ ├── Login.jsx
│ │ │ │ └── Register.jsx
│ │ │ └── services/
│ │ │ └── auth.api.js # Axios calls for auth endpoints
│ │ │
│ │ └── interview/ # Interview & app pages feature
│ │ ├── interview.context.jsx # Interview global state (Context API)
│ │ ├── hooks/
│ │ │ └── useInterview.js # Interview data fetching hook
│ │ ├── pages/
│ │ │ ├── Landing.jsx # Public landing page
│ │ │ ├── Home.jsx # Dashboard (post-login)
│ │ │ ├── Interview.jsx # Report generation & display
│ │ │ ├── Help.jsx # FAQ / Help center
│ │ │ ├── Policy.jsx # Privacy policy
│ │ │ └── Terms.jsx # Terms of service
│ │ ├── services/
│ │ │ └── interview.api.js # Axios calls for interview endpoints
│ │ └── styles/
│ │ ├── Landing.scss
│ │ ├── Home.scss
│ │ ├── Interview.scss
│ │ ├── Help.scss
│ │ ├── Policy.scss
│ │ └── Terms.scss
│ │
│ ├── style/
│ │ └── Button.scss
│ │
│ └── utils/
│ └── parseResume.js # Client-side resume parsing utility
│
└── .env.example

📡 API Endpoints

Auth Routes — /api/auth

MethodEndpointDescriptionAuth Required
POST/registerRegister a new user
POST/verify-emailVerify email via OTP
POST/resend-otpResend OTP to email
POST/check-availabilityCheck username/email availability
POST/loginLogin and receive JWT access token
POST/logoutLogout and blacklist token
GET/userGet authenticated user details

Interview Routes — /api/interview

MethodEndpointDescriptionAuth Required
POST/Upload resume + JD → Generate AI interview report
GET/reportsGet all interview reports for logged-in user
GET/report/:interviewIdGet a specific interview report by ID
POST/resume/pdf/:interviewReportIdGenerate ATS-optimized resume PDF
DELETE/report/:interviewIdDelete an interview report

Request & Response Examples

📮 POST /api/auth/register

Request Body:

{
"username": "johndoe",
"email": "john@example.com",
"password": "SecurePass@123"
}

Response 201:

{
"success": true,
"message": "User registered. Please verify your email via OTP."
}

Register page:

Register Page

OTP email received in inbox:

After registration, a 6-digit OTP is sent to the user's email via Brevo SMTP for verification.

OTP Email

Welcome email after verification:

Once OTP is verified, a welcome email is automatically triggered.

Welcome Email


🔓 POST /api/auth/login

Request Body:

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

Response 200:

{
"success": true,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": "64f1a2b3c4d5e6f7a8b9c0d1",
"username": "johndoe",
"email": "john@example.com"
}
}

Login page:

Login Page


✅ POST /api/auth/verify-email

Request Body:

{
"email": "john@example.com",
"otp": "482910"
}

Response 200:

{
"success": true,
"message": "Email verified. Account is now active."
}

OTP verification page:

OTP Verification Page


🤖 POST /api/interview — Generate Interview Report

Request:multipart/form-data

FieldTypeDescription
resumeFile (PDF)User's resume in PDF format
jobDescriptionstringTarget job description text
jobTitlestringTarget job title

Response 201:

{
"success": true,
"interviewReport": {
"_id": "report_id_here",
"technicalQuestions": [...],
"behavioralQuestions": [...],
"skillGapAnalysis": {...},
"optimizedResume": "..."
}
}

Upload resume & job description:

Upload Page

AI-generated interview report:

Interview Report Page

Interview prep roadmap:

Interview Prep Roadmap

ATS-optimized resume PDF:

Once the report is generated, clicking "Download Resume" triggers a direct PDF download — an ATS-optimized, role-tailored resume built from your profile.

Resume PDF


🚀 Getting Started

Prerequisites

  • Node.js v18+
  • MongoDB Atlas account (or local MongoDB)
  • Google Gemini API Key
  • Brevo (Sendinblue) account for SMTP email

1. Clone the Repository

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

2. Backend Setup

cd backend
npm install
cp .env.example .env

Edit .env with your values:

# ServerPORT=5000TOGGLE_AUTO_CLOAKING=false# DatabaseMONGO_URI=mongodb+srv://<user>:<password>@cluster.mongodb.net/hiresync# AuthenticationJWT_SECRET=your_super_secret_jwt_key# Email (Brevo SMTP)BREVO_API_KEY=your_brevo_api_keySENDER_EMAIL=your_verified_sender@example.comSENDER_NAME=HireSync

Start the backend:

# Development
npm run dev
# Production
npm start

Backend runs at http://localhost:5000 🚀


3. Frontend Setup

cd frontend
npm install
cp .env.example .env

Edit .env:

VITE_BASE_URL=http://localhost:5000

Start the frontend:

npm run dev

Frontend runs at http://localhost:5173


🔒 Security Highlights

  • Passwords hashed with bcrypt — never stored in plaintext
  • JWT Blacklisting on logout — tokens are invalidated server-side
  • OTP Expiry — time-limited, single-use OTPs via Brevo SMTP
  • Protected Routes — all sensitive endpoints require valid JWT via authUser middleware
  • File Validation — Multer restricts uploads to PDF format only

🛠 Tech Stack

Backend

TechnologyPurpose
Node.js + Express.jsServer & REST API
MongoDB + MongooseDatabase & ODM
JSON Web Tokens (JWT)Stateless authentication with blacklisting
bcryptPassword hashing
MulterPDF resume file upload handling
Google Gemini APIResume parsing, skill gap analysis, question generation
PuppeteerHTML → ATS-optimized resume PDF generation
Brevo (SMTP)OTP email delivery
ZodSchema validation for AI-generated structured output
dotenvEnvironment variable management

Frontend

TechnologyPurpose
React.js + ViteUI framework & fast build tool
React RouterClient-side routing & protected routes
Context APIGlobal state management
AxiosHTTP service layer
SCSSComponent-level styling

📁 Environment Variables Reference

Backend .env

VariableDescriptionExample
PORTServer port5000
TOGGLE_AUTO_CLOAKINGInternal togglefalse
MONGO_URIMongoDB connection stringmongodb+srv://...
JWT_SECRETJWT signing secretrandom_secret_key
BREVO_API_KEYBrevo SMTP API keyxkeysib-...
SENDER_EMAILVerified sender emailnoreply@hiresync.com
SENDER_NAMEEmail sender display nameHireSync

Frontend .env

VariableDescriptionExample
VITE_BASE_URLBackend API base URLhttp://localhost:5000

🤝 Contributing

Contributions are welcome! Please open an issue first to discuss what you'd like to change.

git checkout -b feature/your-feature-name
git commit -m "feat: add your feature"
git push origin feature/your-feature-name

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.


Made with ❤️ by harshhere905

Star this repo if you found it helpful!

About

AI-powered interview preparation and ATS resume platform built with MERN and Google Gemini AI. Generate personalized interview reports, skill gap analysis, match scores, ATS-optimized resumes, and PDF exports with secure JWT authentication.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages