# akshay4754/gapwiseai architecture

> Architecture diagram of the GitHub repository akshay4754/gapwiseai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akshay4754/gapwiseai
- Repository: https://github.com/akshay4754/gapwiseai

## Overview

GapWise AI helps a job seeker turn a resume or self-description and a job description into a tailored interview report, then review saved reports and download a tailored resume PDF. The frontend routes users through authentication, report creation, and report history; the backend handles uploads, PDF text extraction, optional RAG retrieval, AI generation, and persistence. The README documents match scores, skill-gap analysis, questions, and a preparation roadmap as report capabilities. Some frontend API and AI-service internals were not excerpted, so unverified HTTP or service links are shown as dashed.

Main entry points: [`Backend/src/routes/interview.routes.js`](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/routes/interview.routes.js) (Interview routes), [`Backend/src/controllers/interview.controller.js`](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/controllers/interview.controller.js) (Report orchestration), [`Backend/src/routes/auth.routes.js`](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/routes/auth.routes.js) (Auth routes), [`Backend/server.js`](https://github.com/akshay4754/gapwiseai/blob/main/Backend/server.js) (Express server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_webapp["React application<br/>[App.jsx]"]
  node_routing["Page routing<br/>[app.routes.jsx]"]
end

subgraph group_auth["Identity and access"]
  node_authpages["Login and register"]
  node_authstate["Auth state and API<br/>[useAuth.js]"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_authcontroller["Auth handlers<br/>[auth.controller.js]"]
  node_authmiddleware["JWT authorization<br/>[auth.middleware.js]"]
  node_userstore[("User and token records<br/>[user.model.js]")]
end

subgraph group_interview["Interview preparation"]
  node_interviewpages["Interview workspace"]
  node_interviewstate["Report state and API<br/>[useInterview.js]"]
end

subgraph group_backend["Backend services"]
  node_interviewroutes["Interview routes"]
  node_interviewcontroller["Report orchestration"]
  node_upload["Resume upload<br/>[file.middleware.js]"]
  node_reportstore[("Interview report history")]
  node_mongodb[("MongoDB")]
  node_server["Express server<br/>[server.js]"]
end

subgraph group_knowledge["AI and retrieval"]
  node_rag["Resume RAG pipeline<br/>[rag.service.js]"]
  node_ai["AI report and PDF<br/>[ai.service.js]"]
  node_gemini{{"Google Gemini"}}
  node_pinecone[("Pinecone vector index")]
end

node_jobseeker(("Job seeker"))

node_jobseeker -->|"uses"| node_webapp
node_webapp -->|"renders"| node_routing
node_routing -->|"routes"| node_authpages
node_routing -->|"routes"| node_interviewpages
node_authpages -->|"uses"| node_authstate
node_interviewpages -->|"uses"| node_interviewstate
node_authstate -.->|"requests"| node_authroutes
node_interviewstate -.->|"requests"| node_interviewroutes
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_interviewroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"guards"| node_authmiddleware
node_authcontroller -->|"reads and writes"| node_userstore
node_authmiddleware -->|"checks blacklist"| node_userstore
node_interviewroutes -->|"guards"| node_authmiddleware
node_interviewroutes -->|"accepts resume"| node_upload
node_interviewroutes -->|"dispatches"| node_interviewcontroller
node_interviewcontroller -->|"extracts and retrieves"| node_rag
node_interviewcontroller -->|"generates report or PDF"| node_ai
node_interviewcontroller -->|"creates and queries"| node_reportstore
node_rag -->|"embeds text"| node_gemini
node_rag -->|"indexes and searches"| node_pinecone
node_ai -.->|"generates content"| node_gemini
node_server -.->|"connects"| node_mongodb
node_reportstore -.->|"persists reports"| node_mongodb
node_userstore -.->|"persists users"| node_mongodb

click node_webapp "https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/App.jsx"
click node_routing "https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/app.routes.jsx"
click node_authpages "https://github.com/akshay4754/gapwiseai/tree/main/Frontend/src/features/auth/pages"
click node_authstate "https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/features/auth/hooks/useAuth.js"
click node_authroutes "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/routes/auth.routes.js"
click node_authcontroller "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/controllers/auth.controller.js"
click node_authmiddleware "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/middlewares/auth.middleware.js"
click node_userstore "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/models/user.model.js"
click node_interviewpages "https://github.com/akshay4754/gapwiseai/tree/main/Frontend/src/features/interview/pages"
click node_interviewstate "https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/features/interview/hooks/useInterview.js"
click node_interviewroutes "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/routes/interview.routes.js"
click node_interviewcontroller "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/controllers/interview.controller.js"
click node_upload "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/middlewares/file.middleware.js"
click node_reportstore "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/models/interviewReport.model.js"
click node_rag "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/services/rag.service.js"
click node_ai "https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/services/ai.service.js"
click node_server "https://github.com/akshay4754/gapwiseai/blob/main/Backend/server.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webapp,node_routing toneBlue
class node_authpages,node_authstate,node_authroutes,node_authcontroller,node_authmiddleware,node_userstore toneAmber
class node_interviewpages,node_interviewstate toneMint
class node_interviewroutes,node_interviewcontroller,node_upload,node_reportstore,node_mongodb,node_server toneRose
class node_rag,node_ai,node_gemini,node_pinecone,node_jobseeker toneIndigo
```

## Components

### Frontend experience

- [React application](https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Page routing](https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/app.routes.jsx): `Frontend/src/app.routes.jsx`

### Identity and access

- [Login and register](https://github.com/akshay4754/gapwiseai/tree/main/Frontend/src/features/auth/pages): `Frontend/src/features/auth/pages`
- [Auth state and API](https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/features/auth/hooks/useAuth.js): `Frontend/src/features/auth/hooks/useAuth.js`
- [Auth routes](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/routes/auth.routes.js): `Backend/src/routes/auth.routes.js`
- [Auth handlers](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/controllers/auth.controller.js): `Backend/src/controllers/auth.controller.js`
- [JWT authorization](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/middlewares/auth.middleware.js): `Backend/src/middlewares/auth.middleware.js`
- [User and token records](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/models/user.model.js): `Backend/src/models/user.model.js`

### Interview preparation

- [Interview workspace](https://github.com/akshay4754/gapwiseai/tree/main/Frontend/src/features/interview/pages): `Frontend/src/features/interview/pages`
- [Report state and API](https://github.com/akshay4754/gapwiseai/blob/main/Frontend/src/features/interview/hooks/useInterview.js): `Frontend/src/features/interview/hooks/useInterview.js`

### Backend services

- [Interview routes](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/routes/interview.routes.js): `Backend/src/routes/interview.routes.js`
- [Report orchestration](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/controllers/interview.controller.js): `Backend/src/controllers/interview.controller.js`
- [Resume upload](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/middlewares/file.middleware.js): `Backend/src/middlewares/file.middleware.js`
- [Interview report history](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/models/interviewReport.model.js): `Backend/src/models/interviewReport.model.js`
- **MongoDB**
- [Express server](https://github.com/akshay4754/gapwiseai/blob/main/Backend/server.js): `Backend/server.js`

### AI and retrieval

- [Resume RAG pipeline](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/services/rag.service.js): `Backend/src/services/rag.service.js`
- [AI report and PDF](https://github.com/akshay4754/gapwiseai/blob/main/Backend/src/services/ai.service.js): `Backend/src/services/ai.service.js`
- **Google Gemini**
- **Pinecone vector index**

### Other components

- **Job seeker**

## Connections

- Job seeker → React application: uses (evidence: `README.md`)
- React application → Page routing: renders (evidence: `Frontend/src/App.jsx`)
- Page routing → Login and register: routes (evidence: `Frontend/src/app.routes.jsx`)
- Page routing → Interview workspace: routes (evidence: `Frontend/src/app.routes.jsx`)
- Login and register → Auth state and API: uses (evidence: `Frontend/src/features/auth/hooks/useAuth.js`)
- Interview workspace → Report state and API: uses (evidence: `Frontend/src/features/interview/hooks/useInterview.js`)
- Auth state and API → Auth routes: requests
- Report state and API → Interview routes: requests
- Express server → Auth routes: mounts
- Express server → Interview routes: mounts
- Auth routes → Auth handlers: dispatches (evidence: `Backend/src/routes/auth.routes.js`)
- Auth routes → JWT authorization: guards (evidence: `Backend/src/routes/auth.routes.js`)
- Auth handlers → User and token records: reads and writes (evidence: `Backend/src/controllers/auth.controller.js`)
- JWT authorization → User and token records: checks blacklist (evidence: `Backend/src/middlewares/auth.middleware.js`)
- Interview routes → JWT authorization: guards (evidence: `Backend/src/routes/interview.routes.js`)
- Interview routes → Resume upload: accepts resume (evidence: `Backend/src/routes/interview.routes.js`)
- Interview routes → Report orchestration: dispatches (evidence: `Backend/src/routes/interview.routes.js`)
- Report orchestration → Resume RAG pipeline: extracts and retrieves (evidence: `Backend/src/controllers/interview.controller.js`)
- Report orchestration → AI report and PDF: generates report or PDF (evidence: `Backend/src/controllers/interview.controller.js`)
- Report orchestration → Interview report history: creates and queries (evidence: `Backend/src/controllers/interview.controller.js`)
- Resume RAG pipeline → Google Gemini: embeds text (evidence: `Backend/src/services/rag.service.js`)
- Resume RAG pipeline → Pinecone vector index: indexes and searches (evidence: `Backend/src/services/rag.service.js`)
- AI report and PDF → Google Gemini: generates content (evidence: `README.md`)
- Express server → MongoDB: connects (evidence: `README.md`)
- Interview report history → MongoDB: persists reports (evidence: `README.md`)
- User and token records → MongoDB: persists users (evidence: `README.md`)
