# ritikdevelop/hrms architecture

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

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

## Overview

HRMS is a mobile employee-and-admin HR system backed by an Express API and MongoDB. The principal workflow is that an employee submits attendance, leave, reimbursement, report, or task information; the API handles the request and domain logic, stores it, and supports admin review and updates. The app also provides employee dashboards and admin analytics, management, and approvals. The README documents real-time notifications and other integrations; where source excerpts do not show wiring, those links are omitted or marked unverified.

Main entry points: [`Backend/index.js`](https://github.com/ritikdevelop/hrms/blob/master/Backend/index.js) (Express API), [`src/navigation/AppNavigator.tsx`](https://github.com/ritikdevelop/hrms/blob/master/src/navigation/AppNavigator.tsx) (App navigation), [`Backend/middleware/auth.middleware.js`](https://github.com/ritikdevelop/hrms/blob/master/Backend/middleware/auth.middleware.js) (JWT access control), [`Backend/models`](https://github.com/ritikdevelop/hrms/tree/master/Backend/models) (HR records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Mobile app"]
  node_appnav["App navigation<br/>[AppNavigator.tsx]"]
  node_empdash["Employee dashboard"]
  node_employeedetails["Employee details"]
  node_employeeleave["Employee leave"]
  node_taskdetails["Task details"]
  node_admindash["Admin dashboard"]
  node_analytics["Admin analytics"]
  node_adminnav["Admin tabs"]
end

subgraph group_api["API and access"]
  node_api["Express API<br/>[index.js]"]
  node_auth["JWT access control<br/>[auth.middleware.js]"]
  node_adminctrl["Admin controller"]
  node_employeectrl["Employee controller"]
  node_attendancectrl["Attendance controller"]
  node_leavectrl["Leave controller"]
  node_reimbursectrl["Reimbursement controller"]
  node_taskctrl["Task controller<br/>[task.controller.js]"]
  node_dailyctrl["Daily report controller"]
end

subgraph group_domain["HR workflows"]
  node_adminsvc["Admin services<br/>[admin.service.js]"]
  node_employeesvc["Employee services"]
  node_attendancesvc["Attendance services"]
  node_leavesvc["Leave services<br/>[leave.service.js]"]
  node_reimbursesvc["Reimbursement services"]
  node_tasks["Task services<br/>[task.service.js]"]
end

subgraph group_data["Persistence and alerts"]
  node_models[("HR records")]
  node_notifications["Notification service"]
end

node_employee(("Employee"))
node_admin(("Admin"))
node_mongodb[("MongoDB")]
node_socket(("Socket.IO clients"))

node_employee -->|"uses"| node_appnav
node_admin -->|"uses"| node_appnav
node_appnav -->|"routes to"| node_adminnav
node_appnav -->|"routes to"| node_employeedetails
node_appnav -->|"routes to"| node_employeeleave
node_appnav -->|"routes to"| node_taskdetails
node_adminnav -->|"routes to"| node_admindash
node_adminnav -->|"routes to"| node_analytics
node_employee -->|"views"| node_empdash
node_admin -->|"views"| node_admindash
node_appnav -.->|"uses API"| node_api
node_api -->|"mounts routes"| node_adminctrl
node_api -->|"mounts routes"| node_employeectrl
node_api -->|"mounts routes"| node_attendancectrl
node_api -->|"mounts routes"| node_leavectrl
node_api -->|"mounts routes"| node_reimbursectrl
node_api -->|"mounts routes"| node_taskctrl
node_api -->|"mounts routes"| node_dailyctrl
node_auth -->|"guards routes"| node_adminctrl
node_auth -->|"guards routes"| node_attendancectrl
node_auth -->|"guards routes"| node_leavectrl
node_auth -->|"guards routes"| node_reimbursectrl
node_auth -->|"guards routes"| node_taskctrl
node_adminctrl -->|"calls"| node_adminsvc
node_adminctrl -->|"calls"| node_reimbursesvc
node_employeectrl -->|"calls"| node_employeesvc
node_attendancectrl -->|"calls"| node_attendancesvc
node_leavectrl -->|"calls"| node_leavesvc
node_reimbursectrl -->|"calls"| node_reimbursesvc
node_adminsvc -->|"reads and writes"| node_models
node_employeesvc -->|"reads and writes"| node_models
node_attendancesvc -->|"uses records"| node_models
node_leavesvc -->|"uses records"| node_models
node_reimbursesvc -->|"uses records"| node_models
node_tasks -->|"uses records"| node_models
node_api -->|"connects"| node_mongodb
node_leavesvc -->|"creates alerts"| node_notifications
node_reimbursesvc -->|"creates alerts"| node_notifications
node_notifications -->|"emits events"| node_socket

click node_appnav "https://github.com/ritikdevelop/hrms/blob/master/src/navigation/AppNavigator.tsx"
click node_empdash "https://github.com/ritikdevelop/hrms/blob/master/src/screens/EmployeeDashboardScreen.tsx"
click node_employeedetails "https://github.com/ritikdevelop/hrms/blob/master/src/screens/EmployeeDetailsScreen.tsx"
click node_employeeleave "https://github.com/ritikdevelop/hrms/blob/master/src/screens/EmployeeLeaveScreen.tsx"
click node_taskdetails "https://github.com/ritikdevelop/hrms/blob/master/src/screens/TaskDetailsScreen.tsx"
click node_admindash "https://github.com/ritikdevelop/hrms/blob/master/src/screens/AdminDashboardScreen.tsx"
click node_analytics "https://github.com/ritikdevelop/hrms/blob/master/src/screens/AdminEmployeeAnalyticsScreen.tsx"
click node_adminnav "https://github.com/ritikdevelop/hrms/blob/master/src/navigation/AdminBottomTabNavigator.tsx"
click node_api "https://github.com/ritikdevelop/hrms/blob/master/Backend/index.js"
click node_auth "https://github.com/ritikdevelop/hrms/blob/master/Backend/middleware/auth.middleware.js"
click node_adminctrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/admin.controller.js"
click node_employeectrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/employee.controller.js"
click node_attendancectrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/attendance.controller.js"
click node_leavectrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/leave.controller.js"
click node_reimbursectrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/reimburse.controller.js"
click node_taskctrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/task.controller.js"
click node_dailyctrl "https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/daily.report.controller.js"
click node_adminsvc "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/admin.service.js"
click node_employeesvc "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/employee.service.js"
click node_attendancesvc "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/attendance.service.js"
click node_leavesvc "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/leave.service.js"
click node_reimbursesvc "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/reimburse.service.js"
click node_tasks "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/task.service.js"
click node_models "https://github.com/ritikdevelop/hrms/tree/master/Backend/models"
click node_notifications "https://github.com/ritikdevelop/hrms/blob/master/Backend/services/notification.service.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_appnav,node_empdash,node_employeedetails,node_employeeleave,node_taskdetails,node_admindash,node_analytics,node_adminnav,node_socket toneBlue
class node_api,node_auth,node_adminctrl,node_employeectrl,node_attendancectrl,node_leavectrl,node_reimbursectrl,node_taskctrl,node_dailyctrl,node_mongodb toneAmber
class node_adminsvc,node_employeesvc,node_attendancesvc,node_leavesvc,node_reimbursesvc,node_tasks toneMint
class node_models,node_notifications toneRose
class node_employee,node_admin toneIndigo
```

## Components

### Mobile app

- [App navigation](https://github.com/ritikdevelop/hrms/blob/master/src/navigation/AppNavigator.tsx): `src/navigation/AppNavigator.tsx`
- [Employee dashboard](https://github.com/ritikdevelop/hrms/blob/master/src/screens/EmployeeDashboardScreen.tsx): `src/screens/EmployeeDashboardScreen.tsx`
- [Employee details](https://github.com/ritikdevelop/hrms/blob/master/src/screens/EmployeeDetailsScreen.tsx): `src/screens/EmployeeDetailsScreen.tsx`
- [Employee leave](https://github.com/ritikdevelop/hrms/blob/master/src/screens/EmployeeLeaveScreen.tsx): `src/screens/EmployeeLeaveScreen.tsx`
- [Task details](https://github.com/ritikdevelop/hrms/blob/master/src/screens/TaskDetailsScreen.tsx): `src/screens/TaskDetailsScreen.tsx`
- [Admin dashboard](https://github.com/ritikdevelop/hrms/blob/master/src/screens/AdminDashboardScreen.tsx): `src/screens/AdminDashboardScreen.tsx`
- [Admin analytics](https://github.com/ritikdevelop/hrms/blob/master/src/screens/AdminEmployeeAnalyticsScreen.tsx): `src/screens/AdminEmployeeAnalyticsScreen.tsx`
- [Admin tabs](https://github.com/ritikdevelop/hrms/blob/master/src/navigation/AdminBottomTabNavigator.tsx): `src/navigation/AdminBottomTabNavigator.tsx`

### API and access

- [Express API](https://github.com/ritikdevelop/hrms/blob/master/Backend/index.js): `Backend/index.js`
- [JWT access control](https://github.com/ritikdevelop/hrms/blob/master/Backend/middleware/auth.middleware.js): `Backend/middleware/auth.middleware.js`
- [Admin controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/admin.controller.js): `Backend/controllers/admin.controller.js`
- [Employee controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/employee.controller.js): `Backend/controllers/employee.controller.js`
- [Attendance controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/attendance.controller.js): `Backend/controllers/attendance.controller.js`
- [Leave controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/leave.controller.js): `Backend/controllers/leave.controller.js`
- [Reimbursement controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/reimburse.controller.js): `Backend/controllers/reimburse.controller.js`
- [Task controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/task.controller.js): `Backend/controllers/task.controller.js`
- [Daily report controller](https://github.com/ritikdevelop/hrms/blob/master/Backend/controllers/daily.report.controller.js): `Backend/controllers/daily.report.controller.js`

### HR workflows

- [Admin services](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/admin.service.js): `Backend/services/admin.service.js`
- [Employee services](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/employee.service.js): `Backend/services/employee.service.js`
- [Attendance services](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/attendance.service.js): `Backend/services/attendance.service.js`
- [Leave services](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/leave.service.js): `Backend/services/leave.service.js`
- [Reimbursement services](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/reimburse.service.js): `Backend/services/reimburse.service.js`
- [Task services](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/task.service.js): `Backend/services/task.service.js`

### Persistence and alerts

- [HR records](https://github.com/ritikdevelop/hrms/tree/master/Backend/models): `Backend/models`
- [Notification service](https://github.com/ritikdevelop/hrms/blob/master/Backend/services/notification.service.js): `Backend/services/notification.service.js`

### Other components

- **Employee**
- **Admin**
- **MongoDB**
- **Socket.IO clients**

## Connections

- Employee → App navigation: uses (evidence: `README.md`)
- Admin → App navigation: uses (evidence: `README.md`)
- App navigation → Admin tabs: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- App navigation → Employee details: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- App navigation → Employee leave: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- App navigation → Task details: routes to (evidence: `src/navigation/AppNavigator.tsx`)
- Admin tabs → Admin dashboard: routes to (evidence: `src/navigation/AdminBottomTabNavigator.tsx`)
- Admin tabs → Admin analytics: routes to (evidence: `src/navigation/AdminBottomTabNavigator.tsx`)
- Employee → Employee dashboard: views (evidence: `README.md`)
- Admin → Admin dashboard: views (evidence: `README.md`)
- App navigation → Express API: uses API
- Express API → Admin controller: mounts routes (evidence: `Backend/index.js`)
- Express API → Employee controller: mounts routes (evidence: `Backend/index.js`)
- Express API → Attendance controller: mounts routes (evidence: `Backend/index.js`)
- Express API → Leave controller: mounts routes (evidence: `Backend/index.js`)
- Express API → Reimbursement controller: mounts routes (evidence: `Backend/index.js`)
- Express API → Task controller: mounts routes (evidence: `Backend/index.js`)
- Express API → Daily report controller: mounts routes (evidence: `Backend/index.js`)
- JWT access control → Admin controller: guards routes (evidence: `Backend/routes/admin.route.js`)
- JWT access control → Attendance controller: guards routes (evidence: `Backend/routes/attendance.route.js`)
- JWT access control → Leave controller: guards routes (evidence: `Backend/routes/leave.route.js`)
- JWT access control → Reimbursement controller: guards routes (evidence: `Backend/routes/reimburse.route.js`)
- JWT access control → Task controller: guards routes (evidence: `Backend/routes/task.route.js`)
- Admin controller → Admin services: calls (evidence: `Backend/controllers/admin.controller.js`)
- Admin controller → Reimbursement services: calls (evidence: `Backend/controllers/admin.controller.js`)
- Employee controller → Employee services: calls (evidence: `Backend/controllers/employee.controller.js`)
- Attendance controller → Attendance services: calls (evidence: `Backend/controllers/attendance.controller.js`)
- Leave controller → Leave services: calls (evidence: `Backend/controllers/leave.controller.js`)
- Reimbursement controller → Reimbursement services: calls (evidence: `Backend/controllers/reimburse.controller.js`)
- Admin services → HR records: reads and writes (evidence: `Backend/services/admin.service.js`)
- Employee services → HR records: reads and writes (evidence: `Backend/services/employee.service.js`)
- Attendance services → HR records: uses records (evidence: `Backend/services/attendance.service.js`)
- Leave services → HR records: uses records (evidence: `Backend/services/leave.service.js`)
- Reimbursement services → HR records: uses records (evidence: `Backend/services/reimburse.service.js`)
- Task services → HR records: uses records (evidence: `Backend/services/task.service.js`)
- Express API → MongoDB: connects (evidence: `Backend/index.js`)
- Leave services → Notification service: creates alerts (evidence: `Backend/services/leave.service.js`)
- Reimbursement services → Notification service: creates alerts (evidence: `Backend/services/reimburse.service.js`)
- Notification service → Socket.IO clients: emits events (evidence: `Backend/services/notification.service.js`)
