Skip to content

riya-kaurav/Ai-Job-Copilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 

Repository files navigation

AI Job Copilot

Your Intelligent Career OS โ€” An AI-powered job search assistant that tracks applications, analyzes job fit, and tells you exactly what to do next.


๐ŸŽฏ Project Overview

AI Job Copilot is a full-stack SaaS application that transforms job searching from a chaotic spreadsheet exercise into an intelligent, data-driven workflow. It combines a beautiful dark-mode UI with powerful AI features to give you a real edge in your job search.


โœจ Features

๐Ÿ” Authentication System

  • JWT-based auth with access + refresh token pattern
  • Short-lived access tokens (15 min) + long-lived refresh tokens (7 days)
  • Auto token refresh โ€” seamless re-auth without re-login
  • Protected routes with middleware guard

๐Ÿ“Š Dashboard

  • Real-time stats: total applications, interviews, offers, response rate
  • Area chart: application trend over 8 weeks (Recharts)
  • Pie chart: status breakdown visualization
  • Recent applications quick-view

๐Ÿ’ผ Job Management

  • Full CRUD โ€” add, edit, delete job applications
  • Fields: company, role, status, link, notes, salary, location, job description, date
  • Advanced filtering by status + full-text search
  • Responsive card grid layout

๐Ÿ“Œ Kanban Board

  • Drag-and-drop pipeline view using @dnd-kit
  • 4 columns: Applied โ†’ Interview โ†’ Offer โ†’ Rejected
  • Drag a card to automatically update its status in the DB
  • Touch-friendly for mobile use

๐Ÿค– AI Copilot (6 Features โ€” Core USP)

Feature What it does
Smart Match Score Analyzes resume vs job description. Returns match %, matched skills, missing skills, suggestions
Next Best Actions AI studies your job search data and generates a prioritized action plan
Weekly AI Report Generates a full performance summary: strengths, weak areas, suggestions, health score
Resume Optimizer Scores each resume section, identifies keyword gaps, gives ATS improvement tips
Follow-up Generator Writes professional follow-up emails in professional/friendly/assertive tone
Interview Prep Generates technical + behavioral questions, study topics, company insights

๐Ÿงฑ Tech Stack

Layer Technology
Frontend Next.js 14 (App Router) + TypeScript
Styling Tailwind CSS (custom premium design system)
State Zustand (global store with persistence)
Backend Next.js API Route Handlers
Database MongoDB (Mongoose ODM)
Auth JWT (jsonwebtoken + bcryptjs)
AI OpenAI GPT-4o
Charts Recharts
DnD @dnd-kit/core + @dnd-kit/sortable
Fonts Syne (display) + DM Sans (body) + JetBrains Mono
Toasts react-hot-toast

๐Ÿ—‚๏ธ Project Architecture

src/
โ”œโ”€โ”€ app/                        # Next.js App Router
โ”‚   โ”œโ”€โ”€ api/                    # API Route Handlers
โ”‚   โ”‚   โ”œโ”€โ”€ auth/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ login/route.ts  # POST /api/auth/login
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ signup/route.ts # POST /api/auth/signup
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ refresh/route.ts# POST /api/auth/refresh
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ profile/route.ts# GET/PUT /api/auth/profile
โ”‚   โ”‚   โ”œโ”€โ”€ jobs/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ route.ts        # GET (list) + POST (create)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ [id]/route.ts   # GET + PUT + DELETE by ID
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ stats/route.ts  # GET dashboard analytics
โ”‚   โ”‚   โ””โ”€โ”€ ai/
โ”‚   โ”‚       โ”œโ”€โ”€ match/route.ts  # POST โ€” match score
โ”‚   โ”‚       โ”œโ”€โ”€ actions/route.ts# POST โ€” next actions
โ”‚   โ”‚       โ”œโ”€โ”€ report/route.ts # POST โ€” weekly report
โ”‚   โ”‚       โ”œโ”€โ”€ resume/route.ts # POST โ€” resume optimizer
โ”‚   โ”‚       โ”œโ”€โ”€ followup/route.ts# POST โ€” follow-up generator
โ”‚   โ”‚       โ””โ”€โ”€ interview/route.ts# POST โ€” interview prep
โ”‚   โ”œโ”€โ”€ dashboard/page.tsx      # Stats + charts
โ”‚   โ”œโ”€โ”€ jobs/page.tsx           # Job list with filters
โ”‚   โ”œโ”€โ”€ kanban/page.tsx         # Drag-and-drop board
โ”‚   โ”œโ”€โ”€ ai-copilot/page.tsx     # All 6 AI features
โ”‚   โ”œโ”€โ”€ profile/page.tsx        # User settings
โ”‚   โ”œโ”€โ”€ login/page.tsx          # Auth pages
โ”‚   โ”œโ”€โ”€ signup/page.tsx
โ”‚   โ”œโ”€โ”€ layout.tsx              # Root layout + providers
โ”‚   โ””โ”€โ”€ globals.css             # Design system + animations
โ”‚
โ”œโ”€โ”€ components/                 # Reusable UI components
โ”‚   โ”œโ”€โ”€ layout/
โ”‚   โ”‚   โ”œโ”€โ”€ Sidebar.tsx         # Main navigation
โ”‚   โ”‚   โ””โ”€โ”€ AppLayout.tsx       # Authenticated page wrapper
โ”‚   โ”œโ”€โ”€ dashboard/
โ”‚   โ”‚   โ””โ”€โ”€ StatCard.tsx        # Metric display card
โ”‚   โ”œโ”€โ”€ jobs/
โ”‚   โ”‚   โ”œโ”€โ”€ JobCard.tsx         # Job application card
โ”‚   โ”‚   โ””โ”€โ”€ JobFormModal.tsx    # Add/edit modal
โ”‚   โ”œโ”€โ”€ kanban/
โ”‚   โ”‚   โ””โ”€โ”€ KanbanBoard.tsx     # DnD board
โ”‚   โ””โ”€โ”€ ai/
โ”‚       โ””โ”€โ”€ AIPanels.tsx        # All 6 AI feature panels
โ”‚
โ”œโ”€โ”€ hooks/                      # Zustand stores (state management)
โ”‚   โ”œโ”€โ”€ useAuth.ts              # Auth state + actions
โ”‚   โ””โ”€โ”€ useJobs.ts              # Jobs state + CRUD actions
โ”‚
โ”œโ”€โ”€ lib/                        # Core utilities
โ”‚   โ”œโ”€โ”€ db.ts                   # MongoDB connection (cached)
โ”‚   โ”œโ”€โ”€ auth.ts                 # JWT sign/verify helpers
โ”‚   โ”œโ”€โ”€ middleware.ts           # withAuth() route guard
โ”‚   โ”œโ”€โ”€ openai.ts               # All AI feature functions
โ”‚   โ””โ”€โ”€ api-client.ts           # Frontend HTTP client (auto-refresh)
โ”‚
โ”œโ”€โ”€ models/                     # Mongoose schemas
โ”‚   โ”œโ”€โ”€ User.ts                 # User model (with bcrypt hook)
โ”‚   โ””โ”€โ”€ Job.ts                  # Job application model
โ”‚
โ”œโ”€โ”€ types/                      # TypeScript type definitions
โ”‚   โ””โ”€โ”€ index.ts                # All shared types
โ”‚
โ””โ”€โ”€ utils/                      # Shared utilities
    โ””โ”€โ”€ index.ts                # cn(), formatDate(), constants

๐Ÿš€ Setup Instructions

Prerequisites

  • Node.js 18+
  • MongoDB Atlas account (free tier works)
  • OpenAI API key

1. Clone the repository

git clone https://github.com/yourusername/ai-job-copilot.git
cd ai-job-copilot

2. Install dependencies

npm install

3. Configure environment variables

cp .env.example .env.local

Edit .env.local:

MONGODB_URI=mongodb+srv://...
JWT_SECRET=your-secret-key-min-32-chars
JWT_REFRESH_SECRET=your-refresh-secret-min-32-chars
OPENAI_API_KEY=sk-proj-...
NEXT_PUBLIC_APP_URL=http://localhost:3000

4. Start development server

npm run dev

Open http://localhost:3000 โ€” you'll be redirected to login.

5. Create an account

Navigate to /signup, create an account. No email verification required in development.


๐Ÿ” Environment Variables

Variable Required Description
MONGODB_URI โœ… MongoDB connection string
JWT_SECRET โœ… Secret for signing access tokens (min 32 chars)
JWT_REFRESH_SECRET โœ… Secret for refresh tokens (different from above)
OPENAI_API_KEY โœ… Your OpenAI API key (for all AI features)
NEXT_PUBLIC_APP_URL โœ… Your app's base URL
JWT_ACCESS_EXPIRY โŒ Access token expiry (default: 15m)
JWT_REFRESH_EXPIRY โŒ Refresh token expiry (default: 7d)
OPENAI_MODEL โŒ OpenAI model to use (default: gpt-4o)

๐Ÿค– How AI Copilot Works

The AI layer (src/lib/openai.ts) uses structured prompt engineering to get reliable JSON from GPT-4o:

1. User triggers an AI feature (e.g., Match Score)
2. Frontend POSTs to /api/ai/match with job data
3. API route (protected by withAuth middleware) fetches user's resume from DB
4. openai.ts constructs a system + user prompt with strict JSON schema
5. GPT-4o returns structured JSON (match score, skills, suggestions)
6. API validates and returns to frontend
7. Frontend renders the AI results with rich UI

Key design decisions:

  • System prompt defines the AI's role and instructs JSON-only output
  • User prompt injects real data (resume, job description, stats)
  • Responses parsed with a parseJSON<T>() helper that strips markdown fences
  • Each feature has its own typed interface (e.g., MatchAnalysis, NextAction)
  • All AI calls are wrapped in try/catch with user-friendly error messages

๐ŸŽจ Design System

The UI is built on a custom premium dark theme:

  • Colors: Deep black (#080B14) backgrounds, purple (#7C3AED) accent, blue (#2563EB) secondary
  • Typography: Syne (display/headings) + DM Sans (body) โ€” chosen for premium SaaS feel
  • Effects: Glassmorphism cards, glow shadows, ambient background orbs, grid pattern
  • Animations: Staggered fade-in-up, shimmer skeletons, hover lift, spin loaders
  • Components: All in globals.css as @layer components โ€” glass-card, btn-primary, input-field, badge, nav-item

๐Ÿ“ธ Pages Overview

Page Route Description
Login /login JWT authentication
Signup /signup Account creation
Dashboard /dashboard Stats, charts, recent jobs
Applications /jobs Full list with search/filter
Kanban /kanban Drag-and-drop pipeline
AI Copilot /ai-copilot All 6 AI features
Profile /profile Resume, skills, target roles

๐Ÿ”ฎ Future Improvements

  • Email notifications for follow-up reminders
  • Browser extension to auto-import jobs from LinkedIn/Indeed
  • AI-generated cover letters
  • Calendar integration for interview scheduling
  • Team/referral features (share job leads with connections)
  • Export to CSV / PDF report
  • Dark/light mode toggle
  • Mobile app (React Native)
  • Job market analytics (trends by role/location)
  • Integration with Glassdoor for salary data

๐Ÿง  What I Learned Building This

  1. JWT refresh token flow โ€” implementing secure silent token refresh without user interruption
  2. OpenAI structured outputs โ€” prompting for reliable JSON with type-safe parsing
  3. DnD-kit โ€” building accessible drag-and-drop that works on touch devices
  4. Mongoose connection caching โ€” preventing hot-reload from spawning too many DB connections
  5. Zustand with persistence โ€” persisting auth state across page refreshes without Redux complexity
  6. Next.js App Router patterns โ€” route handlers, server components, client components

Built with โค๏ธ and a lot of โ˜• | AI Job Copilot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors