# mathankumar-dev/leave-management-system-frontend architecture

> Architecture diagram of the GitHub repository mathankumar-dev/leave-management-system-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mathankumar-dev/leave-management-system-frontend
- Repository: https://github.com/mathankumar-dev/leave-management-system-frontend

## Overview

This is a React/TypeScript HRMS frontend. The principal workflow is employee sign-in, role-based entry into the portal, leave submission, and manager review with approval or rejection; the README documents that leave workflow, while sampled code shows session restoration, role routes, and manager approval actions. Feature modules also cover employee administration, attendance, payroll, notifications, onboarding, birthdays, and skills. Source evidence is partial, so some capability links rely on README statements; unsampled implementations are represented only by existing feature paths.

Main entry points: [`src/services/apiClient.ts`](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/services/apiClient.ts) (HTTP client), [`src/features/leave/hooks/useManagerApprovals.ts`](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/hooks/useManagerApprovals.ts) (Manager decisions), [`src/app/AppRoutes.tsx`](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/app/AppRoutes.tsx) (App routes), [`src/shared/auth/AuthContext.tsx`](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/shared/auth/AuthContext.tsx) (Session context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry and access"]
  node_routes["App routes<br/>[AppRoutes.tsx]"]
  node_authcontext["Session context<br/>[AuthContext.tsx]"]
  node_authapi["Authentication API<br/>[authApi.ts]"]
  node_dashboardroutes["Portal routes"]
end

subgraph group_workforce["Workforce operations"]
  node_employeeops["Employee management<br/>[employeeService.ts]"]
  node_attendance["Attendance calendar<br/>[useCalendar.ts]"]
  node_payroll["Payroll and payslips<br/>[payrollService.ts]"]
  node_onboarding["Employee onboarding"]
  node_skills["Skills and progression<br/>[skillsetService.ts]"]
end

subgraph group_leave["Leave workflow"]
  node_leaveui["Leave requests<br/>[MyLeavesView.tsx]"]
  node_approvalhook["Manager decisions"]
  node_leaveapi["Leave service<br/>[leaveService.ts]"]
  node_requestapi["Access request service<br/>[requestService.ts]"]
end

subgraph group_insights["Dashboards and updates"]
  node_dashboard["Role dashboards"]
  node_notifications["Notifications and flash news"]
  node_birthday["Birthday features<br/>[birthdayService.ts]"]
end

subgraph group_shared["Shared platform"]
  node_authstorage["Session cookies<br/>[authStorage.ts]"]
  node_api["HTTP client<br/>[apiClient.ts]"]
end

node_employee(("Employee / manager"))
node_backend{{"HRMS REST API"}}

node_employee -.->|"opens portal"| node_routes
node_routes -->|"checks session"| node_authcontext
node_routes -->|"routes protected users"| node_dashboardroutes
node_authcontext -->|"restores profile"| node_authapi
node_authcontext -->|"reads and writes"| node_authstorage
node_authapi -->|"uses client"| node_api
node_dashboardroutes -->|"renders by role"| node_dashboard
node_employee -.->|"submits leave"| node_leaveui
node_leaveui -.->|"requests leave"| node_leaveapi
node_employee -.->|"reviews requests"| node_approvalhook
node_approvalhook -->|"fetches and decides"| node_leaveapi
node_approvalhook -->|"approves access"| node_requestapi
node_approvalhook -->|"resolves employee names"| node_employeeops
node_leaveapi -->|"uses client"| node_api
node_requestapi -.->|"uses client"| node_api
node_employeeops -->|"uses client"| node_api
node_attendance -->|"loads attendance"| node_api
node_dashboard -->|"loads dashboard data"| node_api
node_payroll -.->|"uses client"| node_api
node_notifications -.->|"uses client"| node_api
node_birthday -.->|"uses client"| node_api
node_skills -.->|"uses client"| node_api
node_onboarding -.->|"uses client"| node_api
node_api -.->|"sends REST requests"| node_backend

click node_routes "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/app/AppRoutes.tsx"
click node_authcontext "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/shared/auth/AuthContext.tsx"
click node_authapi "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/auth/api/authApi.ts"
click node_authstorage "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/services/auth/authStorage.ts"
click node_dashboardroutes "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/dashboard/layout/DashboardRoutes.tsx"
click node_dashboard "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/dashboard/manager/pages/ManagerDashboardView.tsx"
click node_employeeops "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/employee/services/employeeService.ts"
click node_attendance "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/attendance/hooks/useCalendar.ts"
click node_payroll "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/payroll/services/payrollService.ts"
click node_onboarding "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/onboarding/services/onboardingService.ts"
click node_leaveui "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/pages/MyLeavesView.tsx"
click node_approvalhook "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/hooks/useManagerApprovals.ts"
click node_leaveapi "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/services/leaveService.ts"
click node_requestapi "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/services/requestService.ts"
click node_notifications "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/notification/services/notificationService.ts"
click node_birthday "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/birthday/services/birthdayService.ts"
click node_skills "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/skillset/skillsetService.ts"
click node_api "https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/services/apiClient.ts"

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_routes,node_authcontext,node_authapi,node_dashboardroutes toneBlue
class node_employeeops,node_attendance,node_payroll,node_onboarding,node_skills toneAmber
class node_leaveui,node_approvalhook,node_leaveapi,node_requestapi,node_backend toneMint
class node_dashboard,node_notifications,node_birthday toneRose
class node_authstorage,node_api,node_employee toneIndigo
```

## Components

### App entry and access

- [App routes](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/app/AppRoutes.tsx): `src/app/AppRoutes.tsx`
- [Session context](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/shared/auth/AuthContext.tsx): `src/shared/auth/AuthContext.tsx`
- [Authentication API](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/auth/api/authApi.ts): `src/features/auth/api/authApi.ts`
- [Portal routes](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/dashboard/layout/DashboardRoutes.tsx): `src/features/dashboard/layout/DashboardRoutes.tsx`

### Workforce operations

- [Employee management](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/employee/services/employeeService.ts): `src/features/employee/services/employeeService.ts`
- [Attendance calendar](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/attendance/hooks/useCalendar.ts): `src/features/attendance/hooks/useCalendar.ts`
- [Payroll and payslips](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/payroll/services/payrollService.ts): `src/features/payroll/services/payrollService.ts`
- [Employee onboarding](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/onboarding/services/onboardingService.ts): `src/features/onboarding/services/onboardingService.ts`
- [Skills and progression](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/skillset/skillsetService.ts): `src/features/skillset/skillsetService.ts`

### Leave workflow

- [Leave requests](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/pages/MyLeavesView.tsx): `src/features/leave/pages/MyLeavesView.tsx`
- [Manager decisions](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/hooks/useManagerApprovals.ts): `src/features/leave/hooks/useManagerApprovals.ts`
- [Leave service](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/services/leaveService.ts): `src/features/leave/services/leaveService.ts`
- [Access request service](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/leave/services/requestService.ts): `src/features/leave/services/requestService.ts`

### Dashboards and updates

- [Role dashboards](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/dashboard/manager/pages/ManagerDashboardView.tsx): `src/features/dashboard/manager/pages/ManagerDashboardView.tsx`
- [Notifications and flash news](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/notification/services/notificationService.ts): `src/features/notification/services/notificationService.ts`
- [Birthday features](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/features/birthday/services/birthdayService.ts): `src/features/birthday/services/birthdayService.ts`

### Shared platform

- [Session cookies](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/services/auth/authStorage.ts): `src/services/auth/authStorage.ts`
- [HTTP client](https://github.com/mathankumar-dev/leave-management-system-frontend/blob/main/src/services/apiClient.ts): `src/services/apiClient.ts`

### Other components

- **Employee / manager**
- **HRMS REST API**

## Connections

- Employee / manager → App routes: opens portal
- App routes → Session context: checks session (evidence: `src/app/AppRoutes.tsx`)
- App routes → Portal routes: routes protected users (evidence: `src/features/dashboard/layout/DashboardRoutes.tsx`)
- Session context → Authentication API: restores profile (evidence: `src/shared/auth/AuthContext.tsx`)
- Session context → Session cookies: reads and writes (evidence: `src/shared/auth/AuthContext.tsx`)
- Authentication API → HTTP client: uses client (evidence: `src/features/auth/api/authApi.ts`)
- Portal routes → Role dashboards: renders by role (evidence: `src/features/dashboard/layout/DashboardRoutes.tsx`)
- Employee / manager → Leave requests: submits leave (evidence: `README.md`)
- Leave requests → Leave service: requests leave (evidence: `README.md`)
- Employee / manager → Manager decisions: reviews requests (evidence: `README.md`)
- Manager decisions → Leave service: fetches and decides (evidence: `src/features/leave/hooks/useManagerApprovals.ts`)
- Manager decisions → Access request service: approves access (evidence: `src/features/leave/hooks/useManagerApprovals.ts`)
- Manager decisions → Employee management: resolves employee names (evidence: `src/features/leave/hooks/useManagerApprovals.ts`)
- Leave service → HTTP client: uses client (evidence: `src/features/leave/services/leaveService.ts`)
- Access request service → HTTP client: uses client
- Employee management → HTTP client: uses client (evidence: `src/features/employee/services/employeeService.ts`)
- Attendance calendar → HTTP client: loads attendance
- Role dashboards → HTTP client: loads dashboard data
- Payroll and payslips → HTTP client: uses client
- Notifications and flash news → HTTP client: uses client
- Birthday features → HTTP client: uses client
- Skills and progression → HTTP client: uses client
- Employee onboarding → HTTP client: uses client
- HTTP client → HRMS REST API: sends REST requests
