# mohankrishna-07/leave-management-system architecture

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

- Interactive diagram: https://gitdiagram.com/mohankrishna-07/leave-management-system
- Repository: https://github.com/mohankrishna-07/leave-management-system

## Overview

LMS supports separate employee and administrator portals backed by a Spring Boot API. Employees sign in, view profile and leave status, submit requests, and review history; administrators manage employees, inspect aggregate statistics, and approve or reject requests. The backend authenticates users, applies leave rules, and persists employee and request records. Portal routes and backend controller/service behavior are sampled; some page-to-endpoint wiring is based on the documented API capabilities rather than inspected frontend service code.

Main entry points: [`employee-portal/src/services/api.js`](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/services/api.js) (Employee API client), [`admin-portal/src/services/api.js`](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/services/api.js) (Admin API client), [`employee-portal/src/App.jsx`](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/App.jsx) (Employee routes), [`admin-portal/src/App.jsx`](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/App.jsx) (Admin routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_portals["Web portals"]
  node_employee_app["Employee routes<br/>[App.jsx]"]
  node_employee_login["Employee login<br/>[Login.jsx]"]
  node_employee_dashboard["Employee dashboard<br/>[Dashboard.jsx]"]
  node_employee_apply["Apply leave<br/>[ApplyLeave.jsx]"]
  node_employee_history["Leave history<br/>[LeaveRequests.jsx]"]
  node_employee_profile["Employee profile<br/>[Profile.jsx]"]
  node_admin_app["Admin routes<br/>[App.jsx]"]
  node_admin_login["Admin login<br/>[Login.jsx]"]
  node_admin_dashboard["Admin dashboard<br/>[Dashboard.jsx]"]
  node_employee_management["Employee management"]
  node_admin_leaves["Leave decisions<br/>[LeaveRequests.jsx]"]
  node_admin_profile["Admin profile<br/>[Profile.jsx]"]
end

subgraph group_api["API and security"]
  node_employee_api["Employee API client<br/>[api.js]"]
  node_admin_api["Admin API client<br/>[api.js]"]
  node_auth_controller["Authentication API"]
  node_security["JWT security"]
  node_employee_controller["Employee API"]
  node_admin_controller["Admin API"]
  node_leave_controller["Leave API"]
end

subgraph group_domain["Leave domain"]
  node_employee_service["Employee operations"]
  node_leave_service["Leave rules and stats"]
end

subgraph group_persistence["Persistence"]
  node_employee_repo["Employee repository"]
  node_leave_repo["Leave repository"]
  node_database[("Relational database")]
end

node_employee(("Employee"))
node_administrator(("Administrator"))

node_employee -->|"signs in"| node_employee_login
node_employee -->|"views status"| node_employee_dashboard
node_employee -->|"submits request"| node_employee_apply
node_employee -->|"reviews history"| node_employee_history
node_employee -->|"views profile"| node_employee_profile
node_administrator -->|"signs in"| node_admin_login
node_administrator -->|"views metrics"| node_admin_dashboard
node_administrator -->|"manages employees"| node_employee_management
node_administrator -->|"reviews requests"| node_admin_leaves
node_administrator -->|"views profile"| node_admin_profile
node_employee_app -->|"routes to"| node_employee_login
node_employee_app -->|"routes to"| node_employee_dashboard
node_employee_app -->|"routes to"| node_employee_apply
node_employee_app -->|"routes to"| node_employee_history
node_employee_app -->|"routes to"| node_employee_profile
node_admin_app -->|"routes to"| node_admin_login
node_admin_app -->|"routes to"| node_admin_dashboard
node_admin_app -->|"routes to"| node_employee_management
node_admin_app -->|"routes to"| node_admin_leaves
node_admin_app -->|"routes to"| node_admin_profile
node_employee_login -->|"requests auth"| node_employee_api
node_employee_dashboard -->|"requests stats"| node_employee_api
node_employee_apply -->|"submits leave"| node_employee_api
node_employee_history -->|"loads history"| node_employee_api
node_employee_profile -->|"loads profile"| node_employee_api
node_admin_login -->|"requests auth"| node_admin_api
node_admin_dashboard -->|"requests metrics"| node_admin_api
node_employee_management -->|"manages records"| node_admin_api
node_admin_leaves -->|"reviews requests"| node_admin_api
node_admin_profile -->|"loads profile"| node_admin_api
node_employee_api -->|"calls auth endpoints"| node_auth_controller
node_admin_api -->|"calls auth endpoints"| node_auth_controller
node_employee_api -->|"calls employee endpoints"| node_employee_controller
node_employee_api -->|"calls leave endpoints"| node_leave_controller
node_admin_api -->|"calls admin endpoints"| node_admin_controller
node_auth_controller -->|"authenticates"| node_security
node_auth_controller -->|"loads account"| node_employee_service
node_employee_controller -->|"delegates operations"| node_employee_service
node_leave_controller -->|"delegates requests"| node_leave_service
node_admin_controller -->|"manages employees"| node_employee_service
node_admin_controller -->|"manages leave"| node_leave_service
node_employee_service -->|"reads and writes"| node_employee_repo
node_leave_service -->|"reads and writes"| node_employee_repo
node_leave_service -->|"reads and writes"| node_leave_repo
node_employee_repo -->|"persists employees"| node_database
node_leave_repo -->|"persists requests"| node_database

click node_employee_app "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/App.jsx"
click node_employee_login "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/Login.jsx"
click node_employee_dashboard "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/Dashboard.jsx"
click node_employee_apply "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/ApplyLeave.jsx"
click node_employee_history "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/LeaveRequests.jsx"
click node_employee_profile "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/Profile.jsx"
click node_admin_app "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/App.jsx"
click node_admin_login "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/Login.jsx"
click node_admin_dashboard "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/Dashboard.jsx"
click node_employee_management "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/ManageEmployees.jsx"
click node_admin_leaves "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/LeaveRequests.jsx"
click node_admin_profile "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/Profile.jsx"
click node_employee_api "https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/services/api.js"
click node_admin_api "https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/services/api.js"
click node_auth_controller "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/AuthController.java"
click node_security "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/security/SecurityConfig.java"
click node_employee_controller "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/EmployeeController.java"
click node_admin_controller "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/AdminController.java"
click node_leave_controller "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/LeaveController.java"
click node_employee_service "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/service/impl/EmployeeServiceImpl.java"
click node_leave_service "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/service/impl/LeaveServiceImpl.java"
click node_employee_repo "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/repository/EmployeeRepository.java"
click node_leave_repo "https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/repository/LeaveRequestRepository.java"

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_employee_app,node_employee_login,node_employee_dashboard,node_employee_apply,node_employee_history,node_employee_profile,node_admin_app,node_admin_login,node_admin_dashboard,node_employee_management,node_admin_leaves,node_admin_profile toneBlue
class node_employee_api,node_admin_api,node_auth_controller,node_security,node_employee_controller,node_admin_controller,node_leave_controller toneAmber
class node_employee_service,node_leave_service toneMint
class node_employee_repo,node_leave_repo,node_database toneRose
class node_employee,node_administrator toneIndigo
```

## Components

### Web portals

- [Employee routes](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/App.jsx): `employee-portal/src/App.jsx`
- [Employee login](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/Login.jsx): `employee-portal/src/pages/Login.jsx`
- [Employee dashboard](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/Dashboard.jsx): `employee-portal/src/pages/Dashboard.jsx`
- [Apply leave](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/ApplyLeave.jsx): `employee-portal/src/pages/ApplyLeave.jsx`
- [Leave history](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/LeaveRequests.jsx): `employee-portal/src/pages/LeaveRequests.jsx`
- [Employee profile](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/pages/Profile.jsx): `employee-portal/src/pages/Profile.jsx`
- [Admin routes](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/App.jsx): `admin-portal/src/App.jsx`
- [Admin login](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/Login.jsx): `admin-portal/src/pages/Login.jsx`
- [Admin dashboard](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/Dashboard.jsx): `admin-portal/src/pages/Dashboard.jsx`
- [Employee management](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/ManageEmployees.jsx): `admin-portal/src/pages/ManageEmployees.jsx`
- [Leave decisions](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/LeaveRequests.jsx): `admin-portal/src/pages/LeaveRequests.jsx`
- [Admin profile](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/pages/Profile.jsx): `admin-portal/src/pages/Profile.jsx`

### API and security

- [Employee API client](https://github.com/mohankrishna-07/leave-management-system/blob/main/employee-portal/src/services/api.js): `employee-portal/src/services/api.js`
- [Admin API client](https://github.com/mohankrishna-07/leave-management-system/blob/main/admin-portal/src/services/api.js): `admin-portal/src/services/api.js`
- [Authentication API](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/AuthController.java): `backend/src/main/java/com/leavemanager/controller/AuthController.java`
- [JWT security](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/security/SecurityConfig.java): `backend/src/main/java/com/leavemanager/security/SecurityConfig.java`
- [Employee API](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/EmployeeController.java): `backend/src/main/java/com/leavemanager/controller/EmployeeController.java`
- [Admin API](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/AdminController.java): `backend/src/main/java/com/leavemanager/controller/AdminController.java`
- [Leave API](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/controller/LeaveController.java): `backend/src/main/java/com/leavemanager/controller/LeaveController.java`

### Leave domain

- [Employee operations](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/service/impl/EmployeeServiceImpl.java): `backend/src/main/java/com/leavemanager/service/impl/EmployeeServiceImpl.java`
- [Leave rules and stats](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/service/impl/LeaveServiceImpl.java): `backend/src/main/java/com/leavemanager/service/impl/LeaveServiceImpl.java`

### Persistence

- [Employee repository](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/repository/EmployeeRepository.java): `backend/src/main/java/com/leavemanager/repository/EmployeeRepository.java`
- [Leave repository](https://github.com/mohankrishna-07/leave-management-system/blob/main/backend/src/main/java/com/leavemanager/repository/LeaveRequestRepository.java): `backend/src/main/java/com/leavemanager/repository/LeaveRequestRepository.java`
- **Relational database**

### Other components

- **Employee**
- **Administrator**

## Connections

- Employee → Employee login: signs in
- Employee → Employee dashboard: views status
- Employee → Apply leave: submits request
- Employee → Leave history: reviews history
- Employee → Employee profile: views profile
- Administrator → Admin login: signs in
- Administrator → Admin dashboard: views metrics
- Administrator → Employee management: manages employees
- Administrator → Leave decisions: reviews requests
- Administrator → Admin profile: views profile
- Employee routes → Employee login: routes to
- Employee routes → Employee dashboard: routes to
- Employee routes → Apply leave: routes to
- Employee routes → Leave history: routes to
- Employee routes → Employee profile: routes to
- Admin routes → Admin login: routes to
- Admin routes → Admin dashboard: routes to
- Admin routes → Employee management: routes to
- Admin routes → Leave decisions: routes to
- Admin routes → Admin profile: routes to
- Employee login → Employee API client: requests auth
- Employee dashboard → Employee API client: requests stats
- Apply leave → Employee API client: submits leave
- Leave history → Employee API client: loads history
- Employee profile → Employee API client: loads profile
- Admin login → Admin API client: requests auth
- Admin dashboard → Admin API client: requests metrics
- Employee management → Admin API client: manages records
- Leave decisions → Admin API client: reviews requests
- Admin profile → Admin API client: loads profile
- Employee API client → Authentication API: calls auth endpoints
- Admin API client → Authentication API: calls auth endpoints
- Employee API client → Employee API: calls employee endpoints
- Employee API client → Leave API: calls leave endpoints
- Admin API client → Admin API: calls admin endpoints
- Authentication API → JWT security: authenticates
- Authentication API → Employee operations: loads account
- Employee API → Employee operations: delegates operations
- Leave API → Leave rules and stats: delegates requests
- Admin API → Employee operations: manages employees
- Admin API → Leave rules and stats: manages leave
- Employee operations → Employee repository: reads and writes
- Leave rules and stats → Employee repository: reads and writes
- Leave rules and stats → Leave repository: reads and writes
- Employee repository → Relational database: persists employees
- Leave repository → Relational database: persists requests
