# arvind-2906/managepro architecture

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

- Interactive diagram: https://gitdiagram.com/arvind-2906/managepro
- Repository: https://github.com/arvind-2906/managepro

## Overview

ManagePro is an employee-management system with Admin and Employee workflows spanning employee and department records, leave approvals, salaries and slips, notices, and reviews. Browser users authenticate, receive role-aware access to dashboards, and use the frontend to call the Express API; backend controllers enforce domain operations and persist records. The README documents MongoDB and Cloudinary integrations. Backend startup and database wiring were not sampled, so some runtime links are shown only where source or README supports them; unsampled capability branches are retained without speculative call edges.

Main entry points: [`React-Backend/src/app.js`](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/app.js) (Express API), [`React-Frontend/src/App.jsx`](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/App.jsx) (Role dashboards), [`React-Backend/src/controllers/user.controller.js`](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/user.controller.js) (User profiles), [`React-Backend/src/controllers/salary.controller.js`](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/salary.controller.js) (Salary API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend workflows"]
  node_app["Role dashboards<br/>[App.jsx]"]
  node_authctx["Authentication state<br/>[AuthContext.jsx]"]
  node_rolechecks["Role route guards<br/>[RoleBaseRoutes.jsx]"]
  node_adminwork["Admin workflows<br/>[AdminSummary.jsx]"]
  node_employeehome["Employee workflows"]
  node_leaveui["Leave workflows<br/>[EmployeeLeaves.jsx]"]
  node_salaryui["Salary workflows<br/>[Salary.jsx]"]
  node_reviewsui["Review management<br/>[AdminReviews.jsx]"]
  node_noticesui["Notice management<br/>[AdminNotices.jsx]"]
end

subgraph group_backend["API and access"]
  node_api["Express API<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_authmw["JWT and admin checks<br/>[auth.middleware.js]"]
end

subgraph group_people["People and departments"]
  node_peopleapi["People API"]
  node_userapi["User profiles<br/>[user.controller.js]"]
  node_deptapi["Department API"]
  node_employee[("Employee records<br/>[employee.model.js]")]
  node_user[("User accounts<br/>[user.model.js]")]
  node_department[("Department records")]
end

subgraph group_operations["HR operations"]
  node_leaveapi["Leave API"]
  node_salaryapi["Salary API"]
  node_reviewapi["Review API"]
  node_noticeapi["Notice API"]
  node_leave[("Leave records<br/>[leave.model.js]")]
  node_salary[("Salary records<br/>[salary.model.js]")]
  node_review[("Review records<br/>[review.model.js]")]
  node_notice[("Notices<br/>[notice.model.js]")]
end

subgraph group_support["Persistence and services"]
  node_cloudinary["Cloudinary assets<br/>[cloudinary.js]"]
  node_pdf["Salary slip PDF<br/>[pdfGenerator.js]"]
  node_mongodb[("MongoDB")]
end

node_browser(("Admin / Employee"))

node_browser -->|"uses"| node_app
node_app -->|"provides auth"| node_authctx
node_app -->|"routes through"| node_rolechecks
node_rolechecks -->|"checks role"| node_authctx
node_app -->|"routes to"| node_adminwork
node_app -->|"routes to"| node_employeehome
node_browser -->|"logs in"| node_authctx
node_authctx -->|"verifies token"| node_api
node_adminwork -.->|"calls API"| node_api
node_employeehome -.->|"calls API"| node_api
node_leaveui -.->|"calls API"| node_api
node_salaryui -.->|"calls API"| node_api
node_reviewsui -.->|"calls API"| node_api
node_noticesui -.->|"calls API"| node_api
node_api -->|"mounts"| node_authroutes
node_api -.->|"mounts routes"| node_peopleapi
node_api -.->|"mounts routes"| node_userapi
node_api -.->|"mounts routes"| node_deptapi
node_api -.->|"mounts routes"| node_leaveapi
node_api -.->|"mounts routes"| node_salaryapi
node_api -->|"mounts routes"| node_reviewapi
node_api -.->|"mounts routes"| node_noticeapi
node_authroutes -->|"uses verification"| node_authmw
node_authmw -->|"loads account"| node_user
node_peopleapi -->|"reads and writes"| node_user
node_peopleapi -->|"reads and writes"| node_employee
node_userapi -->|"reads and writes"| node_user
node_userapi -->|"reads and writes"| node_employee
node_userapi -->|"looks up"| node_department
node_userapi -->|"uploads images"| node_cloudinary
node_peopleapi -->|"uploads images"| node_cloudinary
node_deptapi -.->|"manages"| node_department
node_leaveapi -->|"reads and writes"| node_leave
node_leaveapi -->|"looks up"| node_employee
node_salaryapi -->|"reads and writes"| node_salary
node_salaryapi -->|"looks up"| node_employee
node_salaryapi -->|"creates notice"| node_notice
node_salaryapi -->|"builds slip"| node_pdf
node_reviewapi -->|"reads and writes"| node_review
node_noticeapi -.->|"manages"| node_notice
node_employee -.->|"persists in"| node_mongodb
node_user -.->|"persists in"| node_mongodb
node_department -.->|"persists in"| node_mongodb
node_leave -.->|"persists in"| node_mongodb
node_salary -.->|"persists in"| node_mongodb
node_review -.->|"persists in"| node_mongodb
node_notice -.->|"persists in"| node_mongodb

click node_app "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/App.jsx"
click node_authctx "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/context/AuthContext.jsx"
click node_rolechecks "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/components/RoleBaseRoutes.jsx"
click node_adminwork "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/AdminSummary.jsx"
click node_employeehome "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/EmployeeSummary.jsx"
click node_leaveui "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/EmployeeLeaves.jsx"
click node_salaryui "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/Salary.jsx"
click node_reviewsui "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/AdminReviews.jsx"
click node_noticesui "https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/AdminNotices.jsx"
click node_api "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/app.js"
click node_authroutes "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/routes/auth.routes.js"
click node_authmw "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/middlewares/auth.middleware.js"
click node_peopleapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/employee.controller.js"
click node_userapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/user.controller.js"
click node_deptapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/department.controller.js"
click node_employee "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/employee.model.js"
click node_user "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/user.model.js"
click node_department "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/department.model.js"
click node_leaveapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/leave.controller.js"
click node_salaryapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/salary.controller.js"
click node_reviewapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/review.controller.js"
click node_noticeapi "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/notice.controller.js"
click node_leave "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/leave.model.js"
click node_salary "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/salary.model.js"
click node_review "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/review.model.js"
click node_notice "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/notice.model.js"
click node_cloudinary "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/utils/cloudinary.js"
click node_pdf "https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/utils/pdfGenerator.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_authctx,node_rolechecks,node_adminwork,node_employeehome,node_leaveui,node_salaryui,node_reviewsui,node_noticesui toneBlue
class node_api,node_authroutes,node_authmw toneAmber
class node_peopleapi,node_userapi,node_deptapi,node_employee,node_user,node_department toneMint
class node_leaveapi,node_salaryapi,node_reviewapi,node_noticeapi,node_leave,node_salary,node_review,node_notice toneRose
class node_cloudinary,node_pdf,node_mongodb,node_browser toneIndigo
```

## Components

### Frontend workflows

- [Role dashboards](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/App.jsx): `React-Frontend/src/App.jsx`
- [Authentication state](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/context/AuthContext.jsx): `React-Frontend/src/context/AuthContext.jsx`
- [Role route guards](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/components/RoleBaseRoutes.jsx): `React-Frontend/src/components/RoleBaseRoutes.jsx`
- [Admin workflows](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/AdminSummary.jsx): `React-Frontend/src/pages/AdminSummary.jsx`
- [Employee workflows](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/EmployeeSummary.jsx): `React-Frontend/src/pages/EmployeeSummary.jsx`
- [Leave workflows](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/EmployeeLeaves.jsx): `React-Frontend/src/pages/EmployeeLeaves.jsx`
- [Salary workflows](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/Salary.jsx): `React-Frontend/src/pages/Salary.jsx`
- [Review management](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/AdminReviews.jsx): `React-Frontend/src/pages/AdminReviews.jsx`
- [Notice management](https://github.com/arvind-2906/managepro/blob/main/React-Frontend/src/pages/AdminNotices.jsx): `React-Frontend/src/pages/AdminNotices.jsx`

### API and access

- [Express API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/app.js): `React-Backend/src/app.js`
- [Auth routes](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/routes/auth.routes.js): `React-Backend/src/routes/auth.routes.js`
- [JWT and admin checks](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/middlewares/auth.middleware.js): `React-Backend/src/middlewares/auth.middleware.js`

### People and departments

- [People API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/employee.controller.js): `React-Backend/src/controllers/employee.controller.js`
- [User profiles](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/user.controller.js): `React-Backend/src/controllers/user.controller.js`
- [Department API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/department.controller.js): `React-Backend/src/controllers/department.controller.js`
- [Employee records](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/employee.model.js): `React-Backend/src/models/employee.model.js`
- [User accounts](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/user.model.js): `React-Backend/src/models/user.model.js`
- [Department records](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/department.model.js): `React-Backend/src/models/department.model.js`

### HR operations

- [Leave API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/leave.controller.js): `React-Backend/src/controllers/leave.controller.js`
- [Salary API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/salary.controller.js): `React-Backend/src/controllers/salary.controller.js`
- [Review API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/review.controller.js): `React-Backend/src/controllers/review.controller.js`
- [Notice API](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/controllers/notice.controller.js): `React-Backend/src/controllers/notice.controller.js`
- [Leave records](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/leave.model.js): `React-Backend/src/models/leave.model.js`
- [Salary records](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/salary.model.js): `React-Backend/src/models/salary.model.js`
- [Review records](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/review.model.js): `React-Backend/src/models/review.model.js`
- [Notices](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/models/notice.model.js): `React-Backend/src/models/notice.model.js`

### Persistence and services

- [Cloudinary assets](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/utils/cloudinary.js): `React-Backend/src/utils/cloudinary.js`
- [Salary slip PDF](https://github.com/arvind-2906/managepro/blob/main/React-Backend/src/utils/pdfGenerator.js): `React-Backend/src/utils/pdfGenerator.js`
- **MongoDB**

### Other components

- **Admin / Employee**

## Connections

- Admin / Employee → Role dashboards: uses
- Role dashboards → Authentication state: provides auth (evidence: `React-Frontend/src/App.jsx`)
- Role dashboards → Role route guards: routes through (evidence: `React-Frontend/src/App.jsx`)
- Role route guards → Authentication state: checks role (evidence: `React-Frontend/src/components/RoleBaseRoutes.jsx`)
- Role dashboards → Admin workflows: routes to (evidence: `React-Frontend/src/App.jsx`)
- Role dashboards → Employee workflows: routes to (evidence: `React-Frontend/src/App.jsx`)
- Admin / Employee → Authentication state: logs in (evidence: `React-Frontend/src/context/AuthContext.jsx`)
- Authentication state → Express API: verifies token (evidence: `React-Frontend/src/context/AuthContext.jsx`)
- Admin workflows → Express API: calls API
- Employee workflows → Express API: calls API
- Leave workflows → Express API: calls API
- Salary workflows → Express API: calls API
- Review management → Express API: calls API
- Notice management → Express API: calls API
- Express API → Auth routes: mounts (evidence: `React-Backend/src/app.js`)
- Express API → People API: mounts routes (evidence: `React-Backend/src/app.js`)
- Express API → User profiles: mounts routes (evidence: `React-Backend/src/app.js`)
- Express API → Department API: mounts routes (evidence: `React-Backend/src/app.js`)
- Express API → Leave API: mounts routes (evidence: `React-Backend/src/app.js`)
- Express API → Salary API: mounts routes (evidence: `React-Backend/src/app.js`)
- Express API → Review API: mounts routes (evidence: `React-Backend/src/app.js`)
- Express API → Notice API: mounts routes (evidence: `React-Backend/src/app.js`)
- Auth routes → JWT and admin checks: uses verification (evidence: `React-Backend/src/routes/auth.routes.js`)
- JWT and admin checks → User accounts: loads account (evidence: `React-Backend/src/middlewares/auth.middleware.js`)
- People API → User accounts: reads and writes (evidence: `React-Backend/src/controllers/employee.controller.js`)
- People API → Employee records: reads and writes (evidence: `React-Backend/src/controllers/employee.controller.js`)
- User profiles → User accounts: reads and writes (evidence: `React-Backend/src/controllers/user.controller.js`)
- User profiles → Employee records: reads and writes (evidence: `React-Backend/src/controllers/user.controller.js`)
- User profiles → Department records: looks up (evidence: `React-Backend/src/controllers/user.controller.js`)
- User profiles → Cloudinary assets: uploads images (evidence: `React-Backend/src/controllers/user.controller.js`)
- People API → Cloudinary assets: uploads images (evidence: `React-Backend/src/controllers/employee.controller.js`)
- Department API → Department records: manages
- Leave API → Leave records: reads and writes (evidence: `React-Backend/src/controllers/leave.controller.js`)
- Leave API → Employee records: looks up (evidence: `React-Backend/src/controllers/leave.controller.js`)
- Salary API → Salary records: reads and writes (evidence: `React-Backend/src/controllers/salary.controller.js`)
- Salary API → Employee records: looks up (evidence: `React-Backend/src/controllers/salary.controller.js`)
- Salary API → Notices: creates notice (evidence: `React-Backend/src/controllers/salary.controller.js`)
- Salary API → Salary slip PDF: builds slip (evidence: `React-Backend/src/controllers/salary.controller.js`)
- Review API → Review records: reads and writes (evidence: `React-Backend/src/controllers/review.controller.js`)
- Notice API → Notices: manages
- Employee records → MongoDB: persists in
- User accounts → MongoDB: persists in
- Department records → MongoDB: persists in
- Leave records → MongoDB: persists in
- Salary records → MongoDB: persists in
- Review records → MongoDB: persists in
- Notices → MongoDB: persists in
