# abdul8704/hrms-zuntra architecture

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

- Interactive diagram: https://gitdiagram.com/abdul8704/hrms-zuntra
- Repository: https://github.com/abdul8704/hrms-zuntra

## Overview

This is a workforce-management web application spanning employee and role administration, attendance and leave, project delivery, learning, and company documents. Users enter through the browser’s routed pages, authenticate, and use those workflows; the client sends API requests to an Express server, whose routes dispatch to controllers and services that operate on MongoDB models. The sampled source supports several server-side call chains and client routes. Frontend-to-feature API pairings are not fully visible, so those links are shown as unverified rather than inferred as direct calls.

Main entry points: [`client/src/App.jsx`](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/App.jsx) (Route shell), [`client/src/pages/employee/EmployeeManagement.jsx`](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/EmployeeManagement.jsx) (Employee admin), [`server/server.js`](https://github.com/abdul8704/hrms-zuntra/blob/master/server/server.js) (Express API), [`server/src/services/attendanceService.js`](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/attendanceService.js) (Attendance and leave)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Route shell<br/>[App.jsx]"]
  node_auth["Session context<br/>[AuthContext.jsx]"]
  node_login["Login<br/>[Login.jsx]"]
  node_api["HTTP client<br/>[axios.js]"]
  node_employee_ui["Employee admin"]
  node_role_ui["Role editing<br/>[EditRolePopup.jsx]"]
  node_remove_ui["Employee removal"]
  node_course_ui["Course management"]
  node_team_ui["Team leadership<br/>[TeamLeader.jsx]"]
  node_loading_ui["Loading state<br/>[Loading.jsx]"]
end

subgraph group_server["API server"]
  node_server["Express API<br/>[server.js]"]
  node_employee_routes["Employee routes<br/>[employeeRoutes.js]"]
  node_course_routes["Course routes<br/>[courseRoutes.js]"]
  node_phase_routes["Phase routes<br/>[phaseRoutes.js]"]
end

subgraph group_people["People and attendance"]
  node_employee_controller["Employee controller"]
  node_attendance_service["Attendance and leave"]
  node_attendance_helper["Attendance calculations"]
  node_attendance_store[("Attendance records<br/>[attendance.js]")]
end

subgraph group_projects["Project delivery"]
  node_phase_controller["Phase controller<br/>[phaseController.js]"]
  node_phase_service["Phase operations<br/>[phaseService.js]"]
  node_team_service["Team operations<br/>[teamService.js]"]
  node_phase_store[("Phase records<br/>[phase.js]")]
end

subgraph group_learning["Learning and documents"]
  node_course_controller["Course controller"]
  node_course_service["Course operations<br/>[courseService.js]"]
end

node_user(("Employee or HR"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_employee_ui
node_app -->|"routes to"| node_course_ui
node_app -->|"routes to"| node_team_ui
node_app -->|"wraps routes"| node_auth
node_auth -->|"fetches session"| node_api
node_employee_ui -->|"renders"| node_role_ui
node_employee_ui -->|"renders"| node_remove_ui
node_employee_ui -->|"renders"| node_loading_ui
node_course_ui -->|"renders"| node_loading_ui
node_api -.->|"sends requests"| node_server
node_server -->|"mounts"| node_employee_routes
node_server -->|"mounts"| node_course_routes
node_server -->|"mounts"| node_phase_routes
node_employee_routes -->|"dispatches to"| node_employee_controller
node_course_routes -->|"dispatches to"| node_course_controller
node_phase_routes -->|"dispatches to"| node_phase_controller
node_employee_controller -->|"calls"| node_attendance_service
node_attendance_service -->|"uses"| node_attendance_helper
node_attendance_service -->|"reads and writes"| node_attendance_store
node_phase_controller -->|"calls"| node_phase_service
node_phase_service -->|"reads and writes"| node_phase_store
node_phase_service -->|"delegates to"| node_team_service
node_course_controller -->|"calls"| node_course_service

click node_app "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/App.jsx"
click node_auth "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/context/AuthContext.jsx"
click node_login "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/Login.jsx"
click node_api "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/api/axios.js"
click node_employee_ui "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/EmployeeManagement.jsx"
click node_role_ui "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/components/EditRolePopup.jsx"
click node_remove_ui "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/components/RemoveEmployeePopup.jsx"
click node_course_ui "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/course/CourseManagement.jsx"
click node_team_ui "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/teams/TeamLeader.jsx"
click node_loading_ui "https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/utils/Loading.jsx"
click node_server "https://github.com/abdul8704/hrms-zuntra/blob/master/server/server.js"
click node_employee_routes "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/routes/employeeRoutes.js"
click node_course_routes "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/routes/courseRoutes.js"
click node_phase_routes "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/routes/projectRoutes/phaseRoutes.js"
click node_employee_controller "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/controllers/employeeController.js"
click node_attendance_service "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/attendanceService.js"
click node_attendance_helper "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/utils/attendanceHelper.js"
click node_attendance_store "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/models/attendanceManagement/attendance.js"
click node_phase_controller "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/controllers/projectControllers/phaseController.js"
click node_phase_service "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/projectService/phaseService.js"
click node_team_service "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/projectService/teamService.js"
click node_phase_store "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/models/projectManagement/phase.js"
click node_course_controller "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/controllers/courseController.js"
click node_course_service "https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/courseService.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,node_login,node_api,node_employee_ui,node_role_ui,node_remove_ui,node_course_ui,node_team_ui,node_loading_ui toneBlue
class node_server,node_employee_routes,node_course_routes,node_phase_routes toneAmber
class node_employee_controller,node_attendance_service,node_attendance_helper,node_attendance_store toneMint
class node_phase_controller,node_phase_service,node_team_service,node_phase_store toneRose
class node_course_controller,node_course_service,node_user toneIndigo
```

## Components

### Web client

- [Route shell](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/App.jsx): `client/src/App.jsx`
- [Session context](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Login](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/Login.jsx): `client/src/pages/Login.jsx`
- [HTTP client](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/api/axios.js): `client/src/api/axios.js`
- [Employee admin](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/EmployeeManagement.jsx): `client/src/pages/employee/EmployeeManagement.jsx`
- [Role editing](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/components/EditRolePopup.jsx): `client/src/pages/employee/components/EditRolePopup.jsx`
- [Employee removal](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/employee/components/RemoveEmployeePopup.jsx): `client/src/pages/employee/components/RemoveEmployeePopup.jsx`
- [Course management](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/course/CourseManagement.jsx): `client/src/pages/course/CourseManagement.jsx`
- [Team leadership](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/teams/TeamLeader.jsx): `client/src/pages/teams/TeamLeader.jsx`
- [Loading state](https://github.com/abdul8704/hrms-zuntra/blob/master/client/src/pages/utils/Loading.jsx): `client/src/pages/utils/Loading.jsx`

### API server

- [Express API](https://github.com/abdul8704/hrms-zuntra/blob/master/server/server.js): `server/server.js`
- [Employee routes](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/routes/employeeRoutes.js): `server/src/routes/employeeRoutes.js`
- [Course routes](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/routes/courseRoutes.js): `server/src/routes/courseRoutes.js`
- [Phase routes](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/routes/projectRoutes/phaseRoutes.js): `server/src/routes/projectRoutes/phaseRoutes.js`

### People and attendance

- [Employee controller](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/controllers/employeeController.js): `server/src/controllers/employeeController.js`
- [Attendance and leave](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/attendanceService.js): `server/src/services/attendanceService.js`
- [Attendance calculations](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/utils/attendanceHelper.js): `server/src/utils/attendanceHelper.js`
- [Attendance records](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/models/attendanceManagement/attendance.js): `server/src/models/attendanceManagement/attendance.js`

### Project delivery

- [Phase controller](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/controllers/projectControllers/phaseController.js): `server/src/controllers/projectControllers/phaseController.js`
- [Phase operations](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/projectService/phaseService.js): `server/src/services/projectService/phaseService.js`
- [Team operations](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/projectService/teamService.js): `server/src/services/projectService/teamService.js`
- [Phase records](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/models/projectManagement/phase.js): `server/src/models/projectManagement/phase.js`

### Learning and documents

- [Course controller](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/controllers/courseController.js): `server/src/controllers/courseController.js`
- [Course operations](https://github.com/abdul8704/hrms-zuntra/blob/master/server/src/services/courseService.js): `server/src/services/courseService.js`

### Other components

- **Employee or HR**

## Connections

- Employee or HR → Route shell: opens (evidence: `client/src/App.jsx`)
- Route shell → Login: routes to (evidence: `client/src/App.jsx`)
- Route shell → Employee admin: routes to (evidence: `client/src/App.jsx`)
- Route shell → Course management: routes to (evidence: `client/src/App.jsx`)
- Route shell → Team leadership: routes to (evidence: `client/src/App.jsx`)
- Route shell → Session context: wraps routes (evidence: `client/src/App.jsx`)
- Session context → HTTP client: fetches session (evidence: `client/src/context/AuthContext.jsx`)
- Employee admin → Role editing: renders (evidence: `client/src/pages/employee/EmployeeManagement.jsx`)
- Employee admin → Employee removal: renders (evidence: `client/src/pages/employee/EmployeeManagement.jsx`)
- Employee admin → Loading state: renders (evidence: `client/src/pages/employee/EmployeeManagement.jsx`)
- Course management → Loading state: renders (evidence: `client/src/pages/course/CourseManagement.jsx`)
- HTTP client → Express API: sends requests
- Express API → Employee routes: mounts (evidence: `server/server.js`)
- Express API → Course routes: mounts (evidence: `server/server.js`)
- Express API → Phase routes: mounts (evidence: `server/server.js`)
- Employee routes → Employee controller: dispatches to (evidence: `server/src/routes/employeeRoutes.js`)
- Course routes → Course controller: dispatches to (evidence: `server/src/routes/courseRoutes.js`)
- Phase routes → Phase controller: dispatches to (evidence: `server/src/routes/projectRoutes/phaseRoutes.js`)
- Employee controller → Attendance and leave: calls (evidence: `server/src/controllers/employeeController.js`)
- Attendance and leave → Attendance calculations: uses (evidence: `server/src/services/attendanceService.js`)
- Attendance and leave → Attendance records: reads and writes (evidence: `server/src/services/attendanceService.js`)
- Phase controller → Phase operations: calls (evidence: `server/src/controllers/projectControllers/phaseController.js`)
- Phase operations → Phase records: reads and writes (evidence: `server/src/services/projectService/phaseService.js`)
- Phase operations → Team operations: delegates to (evidence: `server/src/services/projectService/phaseService.js`)
- Course controller → Course operations: calls (evidence: `server/src/controllers/courseController.js`)
