# yashnw2005/careerforge-ai architecture

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

- Interactive diagram: https://gitdiagram.com/yashnw2005/careerforge-ai
- Repository: https://github.com/yashnw2005/careerforge-ai

## Overview

CareerForge AI is a resume-to-job matching application. A user registers or signs in, opens the protected dashboard, submits a PDF resume with a job description and required skills, and receives a persisted match analysis with skill gaps and career recommendations; they can also retrieve analysis history. The backend authenticates requests and coordinates the ML service and MongoDB. The ML API exposes additional skill extraction, job matching, semantic matching, skill-gap, and role-recommendation capabilities. Frontend wiring beyond the sampled app and auth context is inferred only where component roles are clear; ML internals are shown at the API-to-service boundary.

Main entry points: [`ml-service/app/main.py`](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/main.py) (ML API), [`backend/models/User.js`](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/models/User.js) (User records), [`backend/server.js`](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/server.js) (Express server), [`backend/controllers/analysisController.js`](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/controllers/analysisController.js) (Analysis controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Application routes<br/>[App.tsx]"]
  node_authctx["Auth state<br/>[AuthContext.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_analysisform["Analysis form<br/>[AnalysisForm.tsx]"]
  node_analysisresults["Analysis results"]
  node_frontendapi["HTTP client<br/>[api.ts]"]
  node_analysisapi["Analysis API client<br/>[analysisApi.ts]"]
end

subgraph group_backend["Backend API"]
  node_server["Express server<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
  node_userroutes["User routes<br/>[userRoutes.js]"]
  node_authmiddleware["Token protection<br/>[authMiddleware.js]"]
  node_analysisroutes["Analysis routes<br/>[analysisRoutes.js]"]
  node_analysiscontroller["Analysis controller"]
  node_mlclient["ML service client<br/>[mlService.js]"]
end

subgraph group_ml["ML analysis"]
  node_mlmain["ML API<br/>[main.py]"]
  node_pdf["PDF extraction<br/>[pdf_extractor.py]"]
  node_resumeanalyzer["Resume analysis<br/>[resume_analyzer.py]"]
  node_skillsextractor["Skill extraction<br/>[skill_extractor.py]"]
  node_jobmatcher["Job matching<br/>[job_matcher.py]"]
  node_semantic["Semantic matching"]
  node_skillgap["Skill gap analysis<br/>[skill_gap.py]"]
  node_roles["Role recommendations"]
end

subgraph group_data["Persistence"]
  node_usermodel[("User records<br/>[User.js]")]
  node_analysis[("Analysis records<br/>[Analysis.js]")]
end

node_user(("User"))
node_mongo[("MongoDB")]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_authctx
node_app -->|"routes"| node_dashboard
node_dashboard -->|"presents"| node_analysisform
node_dashboard -->|"shows"| node_analysisresults
node_authctx -->|"requests"| node_frontendapi
node_analysisform -->|"submits"| node_analysisapi
node_analysisapi -->|"uses"| node_frontendapi
node_frontendapi -->|"HTTP requests"| node_server
node_server -->|"dispatches"| node_authroutes
node_server -->|"dispatches"| node_userroutes
node_server -->|"dispatches"| node_analysisroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads/writes"| node_usermodel
node_authcontroller -->|"issues token for"| node_usermodel
node_userroutes -->|"protects"| node_authmiddleware
node_analysisroutes -->|"protects"| node_authmiddleware
node_authmiddleware -->|"loads"| node_usermodel
node_analysisroutes -->|"dispatches"| node_analysiscontroller
node_analysiscontroller -->|"requests analysis"| node_mlclient
node_mlclient -->|"posts PDF and job data"| node_mlmain
node_analysiscontroller -->|"creates/queries"| node_analysis
node_analysiscontroller -->|"scopes by user"| node_usermodel
node_mlmain -->|"analyzes resume-job"| node_resumeanalyzer
node_mlmain -->|"extracts skills"| node_skillsextractor
node_mlmain -->|"calculates match"| node_jobmatcher
node_mlmain -->|"calculates similarity"| node_semantic
node_mlmain -->|"analyzes gaps"| node_skillgap
node_mlmain -->|"recommends roles"| node_roles
node_mlmain -->|"extracts PDF text"| node_pdf
node_mongo -->|"stores"| node_analysis
node_mongo -->|"stores"| node_usermodel

click node_app "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/App.tsx"
click node_authctx "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/context/AuthContext.tsx"
click node_dashboard "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/pages/Dashboard.tsx"
click node_analysisform "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/components/analysis/AnalysisForm.tsx"
click node_analysisresults "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/components/analysis/AnalysisResults.tsx"
click node_frontendapi "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/services/api.ts"
click node_analysisapi "https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/services/analysisApi.ts"
click node_server "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/server.js"
click node_authroutes "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/controllers/authController.js"
click node_userroutes "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/routes/userRoutes.js"
click node_authmiddleware "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/middleware/authMiddleware.js"
click node_analysisroutes "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/routes/analysisRoutes.js"
click node_analysiscontroller "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/controllers/analysisController.js"
click node_mlclient "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/services/mlService.js"
click node_usermodel "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/models/User.js"
click node_analysis "https://github.com/yashnw2005/careerforge-ai/blob/main/backend/models/Analysis.js"
click node_mlmain "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/main.py"
click node_pdf "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/pdf_extractor.py"
click node_resumeanalyzer "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/resume_analyzer.py"
click node_skillsextractor "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/skill_extractor.py"
click node_jobmatcher "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/job_matcher.py"
click node_semantic "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/semantic_matcher.py"
click node_skillgap "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/skill_gap.py"
click node_roles "https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/role_recommender.py"

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_app,node_authctx,node_dashboard,node_analysisform,node_analysisresults,node_frontendapi,node_analysisapi,node_user toneBlue
class node_server,node_authroutes,node_authcontroller,node_userroutes,node_authmiddleware,node_analysisroutes,node_analysiscontroller,node_mlclient,node_mongo toneAmber
class node_mlmain,node_pdf,node_resumeanalyzer,node_skillsextractor,node_jobmatcher,node_semantic,node_skillgap,node_roles toneMint
class node_usermodel,node_analysis toneRose
```

## Components

### Web application

- [Application routes](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Auth state](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Dashboard](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Analysis form](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/components/analysis/AnalysisForm.tsx): `frontend/src/components/analysis/AnalysisForm.tsx`
- [Analysis results](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/components/analysis/AnalysisResults.tsx): `frontend/src/components/analysis/AnalysisResults.tsx`
- [HTTP client](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Analysis API client](https://github.com/yashnw2005/careerforge-ai/blob/main/frontend/src/services/analysisApi.ts): `frontend/src/services/analysisApi.ts`

### Backend API

- [Express server](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/server.js): `backend/server.js`
- [Auth routes](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Auth controller](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [User routes](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [Token protection](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`
- [Analysis routes](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/routes/analysisRoutes.js): `backend/routes/analysisRoutes.js`
- [Analysis controller](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/controllers/analysisController.js): `backend/controllers/analysisController.js`
- [ML service client](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/services/mlService.js): `backend/services/mlService.js`

### ML analysis

- [ML API](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/main.py): `ml-service/app/main.py`
- [PDF extraction](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/pdf_extractor.py): `ml-service/app/services/pdf_extractor.py`
- [Resume analysis](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/resume_analyzer.py): `ml-service/app/services/resume_analyzer.py`
- [Skill extraction](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/skill_extractor.py): `ml-service/app/services/skill_extractor.py`
- [Job matching](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/job_matcher.py): `ml-service/app/services/job_matcher.py`
- [Semantic matching](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/semantic_matcher.py): `ml-service/app/services/semantic_matcher.py`
- [Skill gap analysis](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/skill_gap.py): `ml-service/app/services/skill_gap.py`
- [Role recommendations](https://github.com/yashnw2005/careerforge-ai/blob/main/ml-service/app/services/role_recommender.py): `ml-service/app/services/role_recommender.py`

### Persistence

- [User records](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/models/User.js): `backend/models/User.js`
- [Analysis records](https://github.com/yashnw2005/careerforge-ai/blob/main/backend/models/Analysis.js): `backend/models/Analysis.js`

### Other components

- **User**
- **MongoDB**

## Connections

- User → Application routes: uses
- Application routes → Auth state: renders
- Application routes → Dashboard: routes
- Dashboard → Analysis form: presents
- Dashboard → Analysis results: shows
- Auth state → HTTP client: requests
- Analysis form → Analysis API client: submits
- Analysis API client → HTTP client: uses
- HTTP client → Express server: HTTP requests
- Express server → Auth routes: dispatches
- Express server → User routes: dispatches
- Express server → Analysis routes: dispatches
- Auth routes → Auth controller: dispatches
- Auth controller → User records: reads/writes
- Auth controller → User records: issues token for
- User routes → Token protection: protects
- Analysis routes → Token protection: protects
- Token protection → User records: loads
- Analysis routes → Analysis controller: dispatches
- Analysis controller → ML service client: requests analysis
- ML service client → ML API: posts PDF and job data
- Analysis controller → Analysis records: creates/queries
- Analysis controller → User records: scopes by user
- ML API → Resume analysis: analyzes resume-job
- ML API → Skill extraction: extracts skills
- ML API → Job matching: calculates match
- ML API → Semantic matching: calculates similarity
- ML API → Skill gap analysis: analyzes gaps
- ML API → Role recommendations: recommends roles
- ML API → PDF extraction: extracts PDF text
- MongoDB → Analysis records: stores
- MongoDB → User records: stores
