# hungnm1911/jobhub architecture

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

- Interactive diagram: https://gitdiagram.com/hungnm1911/jobhub
- Repository: https://github.com/hungnm1911/jobhub

## Overview

JOBHUB is a recruiting platform: candidates and company recruiters use a browser client to discover jobs, manage CVs, apply, and progress applications through hiring workflows; administrators also manage companies and platform data. The backend provides REST business services, MongoDB persistence, realtime delivery, and recovery/expiration workers. Its AI Kit supports CV/job normalization, matching, recommendations, evaluation, and optimization. The README documents the broad system boundaries; sampled source confirms selected application, job, recommendation-retrieval, and model relationships. Frontend business surfaces are not yet built, per the README.

Main entry points: [`backend/src/app.js`](https://github.com/hungnm1911/jobhub/blob/main/backend/src/app.js) (Express API), [`frontend/src/App.jsx`](https://github.com/hungnm1911/jobhub/blob/main/frontend/src/App.jsx) (React application), [`backend/src/services/notification.service.js`](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/notification.service.js) (Notifications and recovery), [`backend/src/services/application.service.js`](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/application.service.js) (Applications and pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Browser client"]
  node_browser["React application<br/>[App.jsx]"]
  node_frontend_routes["Client routing<br/>[index.jsx]"]
  node_http_client["HTTP APIs<br/>[index.js]"]
end

subgraph group_backend["Backend access"]
  node_api_app["Express API<br/>[app.js]"]
  node_routes["API routes<br/>[index.js]"]
  node_auth["Authentication and access<br/>[auth.service.js]"]
end

subgraph group_recruitment["Recruiting workflows"]
  node_companies["Company lifecycle<br/>[company.service.js]"]
  node_jobs["Job lifecycle and discovery<br/>[job.service.js]"]
  node_candidate_cv["Candidate profile and CV"]
  node_applications["Applications and pipeline"]
  node_invitations["Job invitations"]
end

subgraph group_engagement["Realtime and operations"]
  node_chat_interviews["Chat and interviews"]
  node_notifications["Notifications and recovery"]
  node_realtime["Socket.IO delivery"]
  node_workers["Background workers"]
end

subgraph group_ai["AI capabilities"]
  node_ai_adapter["AI Kit adapter<br/>[ai-kit.service.js]"]
  node_ai_kit["AI workflows"]
end

subgraph group_data["Persistence and services"]
  node_mongo[("MongoDB<br/>[mongodb.js]")]
  node_cloudinary[("CV and file storage<br/>[cloudinary.js]")]
  node_smtp["Email delivery<br/>[mailer.js]"]
end

node_candidate(("Candidate"))
node_company_recruiter(("Company recruiter"))
node_admin(("Platform admin"))

node_candidate -->|"uses"| node_browser
node_company_recruiter -->|"uses"| node_browser
node_admin -->|"uses"| node_browser
node_browser -->|"renders routes"| node_frontend_routes
node_browser -.->|"requests data"| node_http_client
node_http_client -->|"calls REST"| node_api_app
node_api_app -.->|"mounts routes"| node_routes
node_api_app -->|"dispatches business work"| node_auth
node_auth -->|"persists accounts"| node_mongo
node_api_app -->|"dispatches business work"| node_companies
node_api_app -->|"dispatches business work"| node_jobs
node_api_app -->|"dispatches business work"| node_candidate_cv
node_api_app -->|"dispatches business work"| node_applications
node_api_app -->|"dispatches business work"| node_invitations
node_api_app -->|"dispatches business work"| node_chat_interviews
node_api_app -->|"dispatches business work"| node_notifications
node_applications -->|"handles conversation and proposals"| node_chat_interviews
node_applications -->|"materializes events"| node_notifications
node_jobs -->|"reads and writes"| node_mongo
node_applications -->|"reads and writes"| node_mongo
node_candidate_cv -->|"stores uploaded files"| node_cloudinary
node_notifications -->|"fans out events"| node_realtime
node_workers -->|"recovers delivery"| node_notifications
node_workers -->|"expires invitations"| node_invitations
node_notifications -.->|"sends email"| node_smtp
node_ai_adapter -.->|"invokes AI workflows"| node_ai_kit
node_ai_kit -.->|"normalizes and matches"| node_jobs

click node_browser "https://github.com/hungnm1911/jobhub/blob/main/frontend/src/App.jsx"
click node_frontend_routes "https://github.com/hungnm1911/jobhub/blob/main/frontend/src/routes/index.jsx"
click node_http_client "https://github.com/hungnm1911/jobhub/blob/main/frontend/src/apis/client/index.js"
click node_api_app "https://github.com/hungnm1911/jobhub/blob/main/backend/src/app.js"
click node_routes "https://github.com/hungnm1911/jobhub/blob/main/backend/src/routes/index.js"
click node_auth "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/auth.service.js"
click node_companies "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/company.service.js"
click node_jobs "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/job.service.js"
click node_candidate_cv "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/candidate-cv.service.js"
click node_applications "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/application.service.js"
click node_invitations "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/job-invitation.service.js"
click node_chat_interviews "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/application.service.js"
click node_notifications "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/notification.service.js"
click node_realtime "https://github.com/hungnm1911/jobhub/blob/main/backend/src/sockets/realtime-server.socket.js"
click node_workers "https://github.com/hungnm1911/jobhub/tree/main/backend/src/workers"
click node_ai_adapter "https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/ai-kit.service.js"
click node_ai_kit "https://github.com/hungnm1911/jobhub/tree/main/ai-kit/src"
click node_mongo "https://github.com/hungnm1911/jobhub/blob/main/backend/src/config/mongodb.js"
click node_cloudinary "https://github.com/hungnm1911/jobhub/blob/main/backend/src/config/cloudinary.js"
click node_smtp "https://github.com/hungnm1911/jobhub/blob/main/backend/src/config/mailer.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_browser,node_frontend_routes,node_http_client toneBlue
class node_api_app,node_routes,node_auth toneAmber
class node_companies,node_jobs,node_candidate_cv,node_applications,node_invitations toneMint
class node_chat_interviews,node_notifications,node_realtime,node_workers toneRose
class node_ai_adapter,node_ai_kit,node_candidate,node_company_recruiter,node_admin toneIndigo
class node_mongo,node_cloudinary,node_smtp toneTeal
```

## Components

### Browser client

- [React application](https://github.com/hungnm1911/jobhub/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Client routing](https://github.com/hungnm1911/jobhub/blob/main/frontend/src/routes/index.jsx): `frontend/src/routes/index.jsx`
- [HTTP APIs](https://github.com/hungnm1911/jobhub/blob/main/frontend/src/apis/client/index.js): `frontend/src/apis/client/index.js`

### Backend access

- [Express API](https://github.com/hungnm1911/jobhub/blob/main/backend/src/app.js): `backend/src/app.js`
- [API routes](https://github.com/hungnm1911/jobhub/blob/main/backend/src/routes/index.js): `backend/src/routes/index.js`
- [Authentication and access](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/auth.service.js): `backend/src/services/auth.service.js`

### Recruiting workflows

- [Company lifecycle](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/company.service.js): `backend/src/services/company.service.js`
- [Job lifecycle and discovery](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/job.service.js): `backend/src/services/job.service.js`
- [Candidate profile and CV](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/candidate-cv.service.js): `backend/src/services/candidate-cv.service.js`
- [Applications and pipeline](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/application.service.js): `backend/src/services/application.service.js`
- [Job invitations](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/job-invitation.service.js): `backend/src/services/job-invitation.service.js`

### Realtime and operations

- [Chat and interviews](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/application.service.js): `backend/src/services/application.service.js`
- [Notifications and recovery](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/notification.service.js): `backend/src/services/notification.service.js`
- [Socket.IO delivery](https://github.com/hungnm1911/jobhub/blob/main/backend/src/sockets/realtime-server.socket.js): `backend/src/sockets/realtime-server.socket.js`
- [Background workers](https://github.com/hungnm1911/jobhub/tree/main/backend/src/workers): `backend/src/workers`

### AI capabilities

- [AI Kit adapter](https://github.com/hungnm1911/jobhub/blob/main/backend/src/services/ai-kit.service.js): `backend/src/services/ai-kit.service.js`
- [AI workflows](https://github.com/hungnm1911/jobhub/tree/main/ai-kit/src): `ai-kit/src`

### Persistence and services

- [MongoDB](https://github.com/hungnm1911/jobhub/blob/main/backend/src/config/mongodb.js): `backend/src/config/mongodb.js`
- [CV and file storage](https://github.com/hungnm1911/jobhub/blob/main/backend/src/config/cloudinary.js): `backend/src/config/cloudinary.js`
- [Email delivery](https://github.com/hungnm1911/jobhub/blob/main/backend/src/config/mailer.js): `backend/src/config/mailer.js`

### Other components

- **Candidate**
- **Company recruiter**
- **Platform admin**

## Connections

- Candidate → React application: uses (evidence: `README.md`)
- Company recruiter → React application: uses (evidence: `README.md`)
- Platform admin → React application: uses (evidence: `README.md`)
- React application → Client routing: renders routes (evidence: `frontend/src/App.jsx`)
- React application → HTTP APIs: requests data
- HTTP APIs → Express API: calls REST (evidence: `README.md`)
- Express API → API routes: mounts routes (evidence: `backend/src/app.js`)
- Express API → Authentication and access: dispatches business work (evidence: `README.md`)
- Authentication and access → MongoDB: persists accounts (evidence: `README.md`)
- Express API → Company lifecycle: dispatches business work (evidence: `README.md`)
- Express API → Job lifecycle and discovery: dispatches business work (evidence: `README.md`)
- Express API → Candidate profile and CV: dispatches business work (evidence: `README.md`)
- Express API → Applications and pipeline: dispatches business work (evidence: `README.md`)
- Express API → Job invitations: dispatches business work (evidence: `README.md`)
- Express API → Chat and interviews: dispatches business work (evidence: `README.md`)
- Express API → Notifications and recovery: dispatches business work (evidence: `README.md`)
- Applications and pipeline → Chat and interviews: handles conversation and proposals (evidence: `backend/src/controllers/application.controller.js`)
- Applications and pipeline → Notifications and recovery: materializes events (evidence: `backend/src/services/application.service.js`)
- Job lifecycle and discovery → MongoDB: reads and writes (evidence: `README.md`)
- Applications and pipeline → MongoDB: reads and writes (evidence: `README.md`)
- Candidate profile and CV → CV and file storage: stores uploaded files (evidence: `README.md`)
- Notifications and recovery → Socket.IO delivery: fans out events (evidence: `README.md`)
- Background workers → Notifications and recovery: recovers delivery (evidence: `README.md`)
- Background workers → Job invitations: expires invitations (evidence: `README.md`)
- Notifications and recovery → Email delivery: sends email
- AI Kit adapter → AI workflows: invokes AI workflows
- AI workflows → Job lifecycle and discovery: normalizes and matches
