# naveengupta2800/ai-job-portal architecture

> Architecture diagram of the GitHub repository naveengupta2800/ai-job-portal, 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/naveengupta2800/ai-job-portal
- Repository: https://github.com/naveengupta2800/ai-job-portal

## Overview

This is a two-sided job portal for job seekers and recruiters. Users browse jobs, build profiles, apply and track applications, while recruiters post jobs, manage applicants, review analytics and subscriptions. Both roles enter through a routed React application and authenticate through shared auth state; frontend API calls reach an Express backend that dispatches to domain controllers and MongoDB models. AI profile analysis, job matching and career assistance are additional job-seeker capabilities. Some frontend-to-backend endpoint wiring is not shown in the excerpts, so that connection is marked unverified.

Main entry points: [`Frontends/src/App.jsx`](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/App.jsx) (Route application), [`Backend/server.js`](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/server.js) (Express API), [`Backend/models/User.js`](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/User.js) (User records), [`Backend/controllers/jobController.js`](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/jobController.js) (Job management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Route application<br/>[App.jsx]"]
  node_auth_state["Auth context<br/>[AuthContext.jsx]"]
  node_api_client["API client<br/>[api.js]"]
  node_public_jobs["Public job discovery<br/>[Jobs.jsx]"]
  node_job_details["Job details<br/>[JobDetailsPage.jsx]"]
  node_candidate_dashboard["Candidate workspace"]
  node_candidate_profile["Candidate profile"]
  node_candidate_applications["Candidate applications"]
  node_ai_features["Career AI tools"]
  node_recruiter_workspace["Recruiter workspace"]
  node_recruiter_applications["Applicant management"]
  node_recruiter_billing["Recruiter billing"]
end

subgraph group_identity["Identity and profiles"]
  node_auth_routes["Auth routes<br/>[authRoutes.js]"]
  node_auth_controller["Authentication<br/>[authController.js]"]
  node_profile_routes["Profile routes<br/>[profileRoutes.js]"]
  node_profile_controller["Profile management"]
  node_upload_middleware["Profile uploads"]
  node_user_model[("User records<br/>[User.js]")]
end

subgraph group_opportunities["Jobs and applications"]
  node_job_routes["Job routes<br/>[jobsRoutes.js]"]
  node_job_controller["Job management<br/>[jobController.js]"]
  node_application_routes["Application routes<br/>[applyRoutes.js]"]
  node_application_controller["Application workflow<br/>[applyController.js]"]
  node_job_model[("Job records<br/>[Job.js]")]
  node_application_model[("Application records<br/>[Application.js]")]
  node_ai_routes["AI routes<br/>[aiRoutes.js]"]
  node_ai_controller["AI orchestration<br/>[aiController.js]"]
  node_gemini_service["Gemini capabilities<br/>[geminiService.js]"]
end

subgraph group_recruiter["Recruiter operations"]
  node_payment_routes["Payment routes<br/>[paymentRoutes.js]"]
  node_payment_controller["Subscription payments"]
  node_payment_model[("Payment records<br/>[Payment.js]")]
end

subgraph group_platform["Backend platform"]
  node_backend["Express API<br/>[server.js]"]
end

node_visitor(("Job seeker"))
node_recruiting_user(("Recruiter"))
node_cashfree{{"Cashfree"}}

node_visitor -->|"uses"| node_app
node_recruiting_user -->|"uses"| node_app
node_app -->|"routes to"| node_public_jobs
node_app -->|"routes to"| node_job_details
node_app -->|"routes to"| node_candidate_dashboard
node_app -->|"routes to"| node_candidate_applications
node_app -->|"routes to"| node_candidate_profile
node_app -->|"routes to"| node_ai_features
node_app -->|"routes to"| node_recruiter_applications
node_app -->|"routes to"| node_recruiter_workspace
node_app -->|"routes to"| node_recruiter_billing
node_auth_state -->|"requests through"| node_api_client
node_api_client -.->|"sends HTTP"| node_backend
node_backend -->|"mounts"| node_auth_routes
node_backend -->|"mounts"| node_job_routes
node_backend -->|"mounts"| node_application_routes
node_backend -->|"mounts"| node_profile_routes
node_backend -->|"mounts"| node_ai_routes
node_backend -->|"mounts"| node_payment_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"reads and writes"| node_user_model
node_profile_routes -->|"dispatches"| node_profile_controller
node_profile_routes -->|"processes uploads"| node_upload_middleware
node_profile_controller -->|"updates profile"| node_user_model
node_job_routes -->|"dispatches"| node_job_controller
node_job_controller -->|"reads and writes"| node_job_model
node_job_controller -->|"queries applications"| node_application_model
node_job_controller -->|"queries users"| node_user_model
node_application_routes -->|"dispatches"| node_application_controller
node_application_controller -->|"reads and writes"| node_application_model
node_application_controller -->|"checks jobs"| node_job_model
node_application_controller -->|"looks up users"| node_user_model
node_ai_routes -->|"dispatches"| node_ai_controller
node_ai_controller -->|"invokes"| node_gemini_service
node_payment_routes -->|"dispatches"| node_payment_controller
node_payment_controller -->|"reads and writes"| node_payment_model
node_payment_controller -->|"checks subscription"| node_user_model
node_payment_controller -->|"creates and verifies"| node_cashfree

click node_app "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/App.jsx"
click node_auth_state "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/context/AuthContext.jsx"
click node_api_client "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/services/api.js"
click node_public_jobs "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/public/Jobs.jsx"
click node_job_details "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/JobDetailsPage.jsx"
click node_candidate_dashboard "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/JobSeekerDashboard.jsx"
click node_candidate_profile "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/JobSeekerProfile.jsx"
click node_candidate_applications "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/MyApplicationsPage.jsx"
click node_ai_features "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/AIJobMatchingPage.jsx"
click node_recruiter_workspace "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/recruiter/RecruiterAnalytics.jsx"
click node_recruiter_applications "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/recruiter/RecruiterApplications.jsx"
click node_recruiter_billing "https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/recruiter/RecruiterBilling.jsx"
click node_backend "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/server.js"
click node_auth_routes "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/authRoutes.js"
click node_auth_controller "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/authController.js"
click node_profile_routes "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/profileRoutes.js"
click node_profile_controller "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/profileController.js"
click node_upload_middleware "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/middleware/uploadMiddleware.js"
click node_user_model "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/User.js"
click node_job_routes "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/jobsRoutes.js"
click node_job_controller "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/jobController.js"
click node_application_routes "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/applyRoutes.js"
click node_application_controller "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/applyController.js"
click node_job_model "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/Job.js"
click node_application_model "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/Application.js"
click node_ai_routes "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/aiRoutes.js"
click node_ai_controller "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/aiController.js"
click node_gemini_service "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/services/geminiService.js"
click node_payment_routes "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/paymentRoutes.js"
click node_payment_controller "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/paymentController.js"
click node_payment_model "https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/Payment.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_app,node_auth_state,node_api_client,node_public_jobs,node_job_details,node_candidate_dashboard,node_candidate_profile,node_candidate_applications,node_ai_features,node_recruiter_workspace,node_recruiter_applications,node_recruiter_billing toneBlue
class node_auth_routes,node_auth_controller,node_profile_routes,node_profile_controller,node_upload_middleware,node_user_model toneAmber
class node_job_routes,node_job_controller,node_application_routes,node_application_controller,node_job_model,node_application_model,node_ai_routes,node_ai_controller,node_gemini_service toneMint
class node_payment_routes,node_payment_controller,node_payment_model toneRose
class node_backend,node_visitor,node_recruiting_user,node_cashfree toneIndigo
```

## Components

### Web application

- [Route application](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/App.jsx): `Frontends/src/App.jsx`
- [Auth context](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/context/AuthContext.jsx): `Frontends/src/context/AuthContext.jsx`
- [API client](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/services/api.js): `Frontends/src/services/api.js`
- [Public job discovery](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/public/Jobs.jsx): `Frontends/src/pages/public/Jobs.jsx`
- [Job details](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/JobDetailsPage.jsx): `Frontends/src/pages/JobDetailsPage.jsx`
- [Candidate workspace](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/JobSeekerDashboard.jsx): `Frontends/src/pages/jobseeker/JobSeekerDashboard.jsx`
- [Candidate profile](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/JobSeekerProfile.jsx): `Frontends/src/pages/jobseeker/JobSeekerProfile.jsx`
- [Candidate applications](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/MyApplicationsPage.jsx): `Frontends/src/pages/jobseeker/MyApplicationsPage.jsx`
- [Career AI tools](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/jobseeker/AIJobMatchingPage.jsx): `Frontends/src/pages/jobseeker/AIJobMatchingPage.jsx`
- [Recruiter workspace](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/recruiter/RecruiterAnalytics.jsx): `Frontends/src/pages/recruiter/RecruiterAnalytics.jsx`
- [Applicant management](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/recruiter/RecruiterApplications.jsx): `Frontends/src/pages/recruiter/RecruiterApplications.jsx`
- [Recruiter billing](https://github.com/naveengupta2800/ai-job-portal/blob/main/Frontends/src/pages/recruiter/RecruiterBilling.jsx): `Frontends/src/pages/recruiter/RecruiterBilling.jsx`

### Identity and profiles

- [Auth routes](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/authRoutes.js): `Backend/routes/authRoutes.js`
- [Authentication](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/authController.js): `Backend/controllers/authController.js`
- [Profile routes](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/profileRoutes.js): `Backend/routes/profileRoutes.js`
- [Profile management](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/profileController.js): `Backend/controllers/profileController.js`
- [Profile uploads](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/middleware/uploadMiddleware.js): `Backend/middleware/uploadMiddleware.js`
- [User records](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/User.js): `Backend/models/User.js`

### Jobs and applications

- [Job routes](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/jobsRoutes.js): `Backend/routes/jobsRoutes.js`
- [Job management](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/jobController.js): `Backend/controllers/jobController.js`
- [Application routes](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/applyRoutes.js): `Backend/routes/applyRoutes.js`
- [Application workflow](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/applyController.js): `Backend/controllers/applyController.js`
- [Job records](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/Job.js): `Backend/models/Job.js`
- [Application records](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/Application.js): `Backend/models/Application.js`
- [AI routes](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/aiRoutes.js): `Backend/routes/aiRoutes.js`
- [AI orchestration](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/aiController.js): `Backend/controllers/aiController.js`
- [Gemini capabilities](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/services/geminiService.js): `Backend/services/geminiService.js`

### Recruiter operations

- [Payment routes](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/routes/paymentRoutes.js): `Backend/routes/paymentRoutes.js`
- [Subscription payments](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/controllers/paymentController.js): `Backend/controllers/paymentController.js`
- [Payment records](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/models/Payment.js): `Backend/models/Payment.js`

### Backend platform

- [Express API](https://github.com/naveengupta2800/ai-job-portal/blob/main/Backend/server.js): `Backend/server.js`

### Other components

- **Job seeker**
- **Recruiter**
- **Cashfree**

## Connections

- Job seeker → Route application: uses (evidence: `Frontends/src/App.jsx`)
- Recruiter → Route application: uses (evidence: `Frontends/src/App.jsx`)
- Route application → Public job discovery: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Job details: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Candidate workspace: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Candidate applications: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Candidate profile: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Career AI tools: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Applicant management: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Recruiter workspace: routes to (evidence: `Frontends/src/App.jsx`)
- Route application → Recruiter billing: routes to (evidence: `Frontends/src/App.jsx`)
- Auth context → API client: requests through (evidence: `Frontends/src/context/AuthContext.jsx`)
- API client → Express API: sends HTTP
- Express API → Auth routes: mounts (evidence: `Backend/server.js`)
- Express API → Job routes: mounts (evidence: `Backend/server.js`)
- Express API → Application routes: mounts (evidence: `Backend/server.js`)
- Express API → Profile routes: mounts (evidence: `Backend/server.js`)
- Express API → AI routes: mounts (evidence: `Backend/server.js`)
- Express API → Payment routes: mounts (evidence: `Backend/server.js`)
- Auth routes → Authentication: dispatches (evidence: `Backend/routes/authRoutes.js`)
- Authentication → User records: reads and writes (evidence: `Backend/controllers/authController.js`)
- Profile routes → Profile management: dispatches (evidence: `Backend/routes/profileRoutes.js`)
- Profile routes → Profile uploads: processes uploads (evidence: `Backend/routes/profileRoutes.js`)
- Profile management → User records: updates profile (evidence: `Backend/controllers/profileController.js`)
- Job routes → Job management: dispatches (evidence: `Backend/routes/jobsRoutes.js`)
- Job management → Job records: reads and writes (evidence: `Backend/controllers/jobController.js`)
- Job management → Application records: queries applications (evidence: `Backend/controllers/jobController.js`)
- Job management → User records: queries users (evidence: `Backend/controllers/jobController.js`)
- Application routes → Application workflow: dispatches (evidence: `Backend/routes/applyRoutes.js`)
- Application workflow → Application records: reads and writes (evidence: `Backend/controllers/applyController.js`)
- Application workflow → Job records: checks jobs (evidence: `Backend/controllers/applyController.js`)
- Application workflow → User records: looks up users (evidence: `Backend/controllers/applyController.js`)
- AI routes → AI orchestration: dispatches (evidence: `Backend/routes/aiRoutes.js`)
- AI orchestration → Gemini capabilities: invokes (evidence: `Backend/controllers/aiController.js`)
- Payment routes → Subscription payments: dispatches (evidence: `Backend/routes/paymentRoutes.js`)
- Subscription payments → Payment records: reads and writes (evidence: `Backend/controllers/paymentController.js`)
- Subscription payments → User records: checks subscription (evidence: `Backend/controllers/paymentController.js`)
- Subscription payments → Cashfree: creates and verifies (evidence: `Backend/controllers/paymentController.js`)
