# rumesh36/job-portal architecture

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

- Interactive diagram: https://gitdiagram.com/rumesh36/job-portal
- Repository: https://github.com/rumesh36/job-portal

## Overview

HireBase is a hiring marketplace with candidate, employer, and administrator workspaces. Candidates create profiles, browse approved employers’ active jobs, apply, and track or withdraw applications; employers manage jobs and review applicants; administrators approve or revoke companies. The graph shows the evidenced frontend routing and backend route/controller/model relationships. Several page-to-page and browser-to-backend links are not shown in the excerpts, so those connections are omitted rather than inferred.

Main entry points: [`Frontend/src/Layout/MainLayout.tsx`](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Layout/MainLayout.tsx) (Route layout), [`Backend/src/routes/company.routes.js`](https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/company.routes.js) (Employer routes), [`Backend/src/controllers/user.controller.js`](https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/user.controller.js) (Candidate operations), [`Backend/src/controllers/employerDashboard.controller.js`](https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/employerDashboard.controller.js) (Jobs and applicant review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Application entry<br/>[App.tsx]"]
  node_main_layout["Route layout<br/>[MainLayout.tsx]"]
  node_home["Marketplace home<br/>[Home.tsx]"]
end

subgraph group_candidate["Candidate workspace"]
  node_candidate_ui["Candidate portal"]
  node_candidate_auth["Candidate sign-in"]
  node_candidate_api["Candidate API client<br/>[user.api.ts]"]
end

subgraph group_employer["Employer workspace"]
  node_employer_ui["Employer portal"]
  node_employer_auth["Employer access"]
  node_employer_api["Employer API client<br/>[company.api.ts]"]
end

subgraph group_admin["Admin oversight"]
  node_admin_ui["Admin portal"]
  node_admin_auth["Admin sign-in<br/>[AdminLogin.tsx]"]
  node_admin_api["Admin API client<br/>[admin.api.ts]"]
end

subgraph group_backend["Backend services"]
  node_server["HTTP server<br/>[index.js]"]
  node_user_routes["Candidate routes<br/>[user.routes.js]"]
  node_company_routes["Employer routes<br/>[company.routes.js]"]
  node_admin_routes["Admin routes<br/>[admin.routes.js]"]
  node_auth["Token and role checks<br/>[auth.middleware.js]"]
  node_user_controller["Candidate operations<br/>[user.controller.js]"]
  node_company_controller["Employer access"]
  node_employer_controller["Jobs and applicant review"]
  node_admin_controller["Company approvals"]
  node_user_store[("Candidate records<br/>[user.model.js]")]
  node_company_store[("Company records<br/>[company.model.js]")]
  node_job_store[("Job listings<br/>[job.model.js]")]
  node_application_store[("Applications")]
end

node_user(("Candidate"))
node_company_actor(("Employer"))
node_admin_actor(("Administrator"))

node_app -->|"renders"| node_main_layout
node_main_layout -->|"routes to"| node_home
node_main_layout -->|"routes to"| node_admin_ui
node_main_layout -->|"routes to"| node_admin_auth
node_main_layout -->|"routes to"| node_employer_ui
node_main_layout -->|"routes to"| node_candidate_ui
node_candidate_ui -->|"uses"| node_candidate_api
node_candidate_auth -->|"uses"| node_candidate_api
node_employer_ui -->|"uses"| node_employer_api
node_employer_auth -->|"uses"| node_employer_api
node_admin_auth -->|"uses"| node_admin_api
node_server -->|"registers"| node_user_routes
node_server -->|"registers"| node_company_routes
node_server -->|"registers"| node_admin_routes
node_user_routes -->|"dispatches"| node_user_controller
node_user_routes -->|"checks token"| node_auth
node_company_routes -->|"dispatches"| node_company_controller
node_company_routes -->|"dispatches"| node_employer_controller
node_company_routes -->|"checks token"| node_auth
node_admin_routes -->|"dispatches"| node_admin_controller
node_admin_routes -->|"checks token"| node_auth
node_user_controller -->|"reads/writes"| node_user_store
node_user_controller -->|"reads"| node_job_store
node_user_controller -->|"reads/writes"| node_application_store
node_company_controller -->|"reads/writes"| node_company_store
node_employer_controller -->|"reads"| node_company_store
node_employer_controller -->|"reads/writes"| node_job_store
node_employer_controller -->|"reads/writes"| node_application_store
node_admin_controller -->|"reads/writes"| node_company_store

click node_app "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/App.tsx"
click node_main_layout "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Layout/MainLayout.tsx"
click node_home "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Pages/Home.tsx"
click node_candidate_ui "https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Pages/Employees"
click node_candidate_auth "https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Auth/Employee"
click node_candidate_api "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/api/auth/user.api.ts"
click node_employer_ui "https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Pages/Company"
click node_employer_auth "https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Auth/Companies"
click node_employer_api "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/api/auth/company.api.ts"
click node_admin_ui "https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Pages/Admin"
click node_admin_auth "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Auth/AdminLog/AdminLogin.tsx"
click node_admin_api "https://github.com/rumesh36/job-portal/blob/main/Frontend/src/api/auth/admin.api.ts"
click node_server "https://github.com/rumesh36/job-portal/blob/main/Backend/src/index.js"
click node_user_routes "https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/user.routes.js"
click node_company_routes "https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/company.routes.js"
click node_admin_routes "https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/admin.routes.js"
click node_auth "https://github.com/rumesh36/job-portal/blob/main/Backend/src/middlewares/auth.middleware.js"
click node_user_controller "https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/user.controller.js"
click node_company_controller "https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/company.controller.js"
click node_employer_controller "https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/employerDashboard.controller.js"
click node_admin_controller "https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/admin.controller.js"
click node_user_store "https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/user.model.js"
click node_company_store "https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/company.model.js"
click node_job_store "https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/job.model.js"
click node_application_store "https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/application.model.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_main_layout,node_home toneBlue
class node_candidate_ui,node_candidate_auth,node_candidate_api toneAmber
class node_employer_ui,node_employer_auth,node_employer_api toneMint
class node_admin_ui,node_admin_auth,node_admin_api toneRose
class node_server,node_user_routes,node_company_routes,node_admin_routes,node_auth,node_user_controller,node_company_controller,node_employer_controller,node_admin_controller,node_user_store,node_company_store,node_job_store,node_application_store,node_user,node_company_actor,node_admin_actor toneIndigo
```

## Components

### Web application

- [Application entry](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/App.tsx): `Frontend/src/App.tsx`
- [Route layout](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Layout/MainLayout.tsx): `Frontend/src/Layout/MainLayout.tsx`
- [Marketplace home](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Pages/Home.tsx): `Frontend/src/Pages/Home.tsx`

### Candidate workspace

- [Candidate portal](https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Pages/Employees): `Frontend/src/Pages/Employees`
- [Candidate sign-in](https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Auth/Employee): `Frontend/src/Auth/Employee`
- [Candidate API client](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/api/auth/user.api.ts): `Frontend/src/api/auth/user.api.ts`

### Employer workspace

- [Employer portal](https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Pages/Company): `Frontend/src/Pages/Company`
- [Employer access](https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Auth/Companies): `Frontend/src/Auth/Companies`
- [Employer API client](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/api/auth/company.api.ts): `Frontend/src/api/auth/company.api.ts`

### Admin oversight

- [Admin portal](https://github.com/rumesh36/job-portal/tree/main/Frontend/src/Pages/Admin): `Frontend/src/Pages/Admin`
- [Admin sign-in](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/Auth/AdminLog/AdminLogin.tsx): `Frontend/src/Auth/AdminLog/AdminLogin.tsx`
- [Admin API client](https://github.com/rumesh36/job-portal/blob/main/Frontend/src/api/auth/admin.api.ts): `Frontend/src/api/auth/admin.api.ts`

### Backend services

- [HTTP server](https://github.com/rumesh36/job-portal/blob/main/Backend/src/index.js): `Backend/src/index.js`
- [Candidate routes](https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/user.routes.js): `Backend/src/routes/user.routes.js`
- [Employer routes](https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/company.routes.js): `Backend/src/routes/company.routes.js`
- [Admin routes](https://github.com/rumesh36/job-portal/blob/main/Backend/src/routes/admin.routes.js): `Backend/src/routes/admin.routes.js`
- [Token and role checks](https://github.com/rumesh36/job-portal/blob/main/Backend/src/middlewares/auth.middleware.js): `Backend/src/middlewares/auth.middleware.js`
- [Candidate operations](https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/user.controller.js): `Backend/src/controllers/user.controller.js`
- [Employer access](https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/company.controller.js): `Backend/src/controllers/company.controller.js`
- [Jobs and applicant review](https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/employerDashboard.controller.js): `Backend/src/controllers/employerDashboard.controller.js`
- [Company approvals](https://github.com/rumesh36/job-portal/blob/main/Backend/src/controllers/admin.controller.js): `Backend/src/controllers/admin.controller.js`
- [Candidate records](https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/user.model.js): `Backend/src/models/user.model.js`
- [Company records](https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/company.model.js): `Backend/src/models/company.model.js`
- [Job listings](https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/job.model.js): `Backend/src/models/job.model.js`
- [Applications](https://github.com/rumesh36/job-portal/blob/main/Backend/src/models/application.model.js): `Backend/src/models/application.model.js`

### Other components

- **Candidate**
- **Employer**
- **Administrator**

## Connections

- Application entry → Route layout: renders (evidence: `Frontend/src/App.tsx`)
- Route layout → Marketplace home: routes to (evidence: `Frontend/src/Layout/MainLayout.tsx`)
- Route layout → Admin portal: routes to (evidence: `Frontend/src/Layout/MainLayout.tsx`)
- Route layout → Admin sign-in: routes to (evidence: `Frontend/src/Layout/MainLayout.tsx`)
- Route layout → Employer portal: routes to (evidence: `Frontend/src/Layout/MainLayout.tsx`)
- Route layout → Candidate portal: routes to (evidence: `Frontend/src/Layout/MainLayout.tsx`)
- Candidate portal → Candidate API client: uses (evidence: `Frontend/src/Pages/Employees/Profile/Profile.tsx`)
- Candidate sign-in → Candidate API client: uses (evidence: `Frontend/src/Auth/Employee/EmpRegister.tsx`)
- Employer portal → Employer API client: uses (evidence: `Frontend/src/Pages/Company/Applicants/Applicants.tsx`)
- Employer access → Employer API client: uses (evidence: `Frontend/src/Auth/Companies/CampRegister.tsx`)
- Admin sign-in → Admin API client: uses (evidence: `Frontend/src/Auth/AdminLog/AdminLogin.tsx`)
- HTTP server → Candidate routes: registers (evidence: `Backend/src/index.js`)
- HTTP server → Employer routes: registers (evidence: `Backend/src/index.js`)
- HTTP server → Admin routes: registers (evidence: `Backend/src/index.js`)
- Candidate routes → Candidate operations: dispatches (evidence: `Backend/src/routes/user.routes.js`)
- Candidate routes → Token and role checks: checks token (evidence: `Backend/src/routes/user.routes.js`)
- Employer routes → Employer access: dispatches (evidence: `Backend/src/routes/company.routes.js`)
- Employer routes → Jobs and applicant review: dispatches (evidence: `Backend/src/routes/company.routes.js`)
- Employer routes → Token and role checks: checks token (evidence: `Backend/src/routes/company.routes.js`)
- Admin routes → Company approvals: dispatches (evidence: `Backend/src/routes/admin.routes.js`)
- Admin routes → Token and role checks: checks token (evidence: `Backend/src/routes/admin.routes.js`)
- Candidate operations → Candidate records: reads/writes (evidence: `Backend/src/controllers/user.controller.js`)
- Candidate operations → Job listings: reads (evidence: `Backend/src/controllers/user.controller.js`)
- Candidate operations → Applications: reads/writes (evidence: `Backend/src/controllers/user.controller.js`)
- Employer access → Company records: reads/writes (evidence: `Backend/src/controllers/company.controller.js`)
- Jobs and applicant review → Company records: reads (evidence: `Backend/src/controllers/employerDashboard.controller.js`)
- Jobs and applicant review → Job listings: reads/writes (evidence: `Backend/src/controllers/employerDashboard.controller.js`)
- Jobs and applicant review → Applications: reads/writes (evidence: `Backend/src/controllers/employerDashboard.controller.js`)
- Company approvals → Company records: reads/writes (evidence: `Backend/src/controllers/admin.controller.js`)
