# abhishek-0-04/employee_leave_management architecture

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

- Interactive diagram: https://gitdiagram.com/abhishek-0-04/employee_leave_management
- Repository: https://github.com/abhishek-0-04/employee_leave_management

## Overview

This is a full-stack employee leave management application: employees register or sign in, submit and track leave, while admins manage employees and departments, review leave requests, and view dashboard statistics. Angular pages call a Spring Boot REST API, which uses MySQL for persistence. The frontend routes and service calls are evidenced by sampled source; backend internals are unsampled, so their links are limited to README-documented API and persistence boundaries or marked unverified.

Main entry points: [`frontend/src/app/services`](https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/services) (API services), [`frontend/src/app/app.routes.ts`](https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/app.routes.ts) (Routes and guards), [`frontend/src/app/components/admin`](https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/admin) (Admin pages), [`frontend/src/app/services/auth.service.ts`](https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/services/auth.service.ts) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular application"]
  node_authui["Sign in / register"]
  node_employeeui["Employee pages"]
  node_adminui["Admin pages"]
  node_routing["Routes and guards<br/>[app.routes.ts]"]
  node_authstate["Auth state<br/>[auth.service.ts]"]
  node_apiclients["API services"]
  node_apiurl["API endpoint config<br/>[api.ts]"]
  node_models["Client data models<br/>[models.ts]"]
end

subgraph group_backend["Spring Boot API"]
  node_authapi["Authentication API"]
  node_employeeapi["Employee API"]
  node_departmentapi["Department API"]
  node_leaveapi["Leave API"]
  node_dashboardapi["Dashboard API"]
  node_authlogic["Authentication logic<br/>[AuthService.java]"]
  node_employee_logic["Employee and department logic"]
  node_leavelogic["Leave workflow logic<br/>[LeaveService.java]"]
  node_dashboardlogic["Dashboard statistics"]
end

subgraph group_data["Persistence"]
  node_mysql[("MySQL database<br/>[schema.sql]")]
end

node_employee(("Employee"))
node_admin(("Administrator"))

node_employee -->|"signs in"| node_authui
node_employee -->|"uses"| node_employeeui
node_admin -->|"signs in"| node_authui
node_admin -->|"manages"| node_adminui
node_authui -->|"submits credentials"| node_authstate
node_routing -->|"routes to"| node_authui
node_routing -->|"routes to"| node_employeeui
node_routing -->|"routes to"| node_adminui
node_routing -->|"guards routes"| node_authstate
node_employeeui -->|"requests data"| node_apiclients
node_adminui -->|"requests data"| node_apiclients
node_authstate -->|"uses endpoint"| node_apiurl
node_apiclients -->|"uses endpoint"| node_apiurl
node_apiclients -->|"uses types"| node_models
node_authstate -->|"calls REST"| node_authapi
node_apiclients -->|"calls REST"| node_employeeapi
node_apiclients -->|"calls REST"| node_departmentapi
node_apiclients -->|"calls REST"| node_leaveapi
node_adminui -.->|"requests statistics"| node_dashboardapi
node_authapi -.->|"delegates"| node_authlogic
node_employeeapi -.->|"delegates"| node_employee_logic
node_departmentapi -.->|"delegates"| node_employee_logic
node_leaveapi -.->|"delegates"| node_leavelogic
node_dashboardapi -.->|"delegates"| node_dashboardlogic
node_authlogic -.->|"persists data"| node_mysql
node_employee_logic -.->|"persists data"| node_mysql
node_leavelogic -.->|"persists requests"| node_mysql
node_dashboardlogic -.->|"reads statistics"| node_mysql

click node_authui "https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/auth"
click node_employeeui "https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/employee"
click node_adminui "https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/admin"
click node_routing "https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/app.routes.ts"
click node_authstate "https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/services/auth.service.ts"
click node_apiclients "https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/services"
click node_apiurl "https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/core/api.ts"
click node_models "https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/models/models.ts"
click node_authapi "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/AuthController.java"
click node_employeeapi "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/EmployeeController.java"
click node_departmentapi "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/DepartmentController.java"
click node_leaveapi "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/LeaveController.java"
click node_dashboardapi "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/DashboardController.java"
click node_authlogic "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/service/AuthService.java"
click node_employee_logic "https://github.com/abhishek-0-04/employee_leave_management/tree/main/backend/src/main/java/com/example/leavemanagement/service"
click node_leavelogic "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/service/LeaveService.java"
click node_dashboardlogic "https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/service/DashboardService.java"
click node_mysql "https://github.com/abhishek-0-04/employee_leave_management/blob/main/database/schema.sql"

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_authui,node_employeeui,node_adminui,node_routing,node_authstate,node_apiclients,node_apiurl,node_models toneBlue
class node_authapi,node_employeeapi,node_departmentapi,node_leaveapi,node_dashboardapi,node_authlogic,node_employee_logic,node_leavelogic,node_dashboardlogic toneAmber
class node_mysql toneMint
class node_employee,node_admin toneIndigo
```

## Components

### Angular application

- [Sign in / register](https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/auth): `frontend/src/app/components/auth`
- [Employee pages](https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/employee): `frontend/src/app/components/employee`
- [Admin pages](https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/components/admin): `frontend/src/app/components/admin`
- [Routes and guards](https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Auth state](https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/services/auth.service.ts): `frontend/src/app/services/auth.service.ts`
- [API services](https://github.com/abhishek-0-04/employee_leave_management/tree/main/frontend/src/app/services): `frontend/src/app/services`
- [API endpoint config](https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/core/api.ts): `frontend/src/app/core/api.ts`
- [Client data models](https://github.com/abhishek-0-04/employee_leave_management/blob/main/frontend/src/app/models/models.ts): `frontend/src/app/models/models.ts`

### Spring Boot API

- [Authentication API](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/AuthController.java): `backend/src/main/java/com/example/leavemanagement/controller/AuthController.java`
- [Employee API](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/EmployeeController.java): `backend/src/main/java/com/example/leavemanagement/controller/EmployeeController.java`
- [Department API](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/DepartmentController.java): `backend/src/main/java/com/example/leavemanagement/controller/DepartmentController.java`
- [Leave API](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/LeaveController.java): `backend/src/main/java/com/example/leavemanagement/controller/LeaveController.java`
- [Dashboard API](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/controller/DashboardController.java): `backend/src/main/java/com/example/leavemanagement/controller/DashboardController.java`
- [Authentication logic](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/service/AuthService.java): `backend/src/main/java/com/example/leavemanagement/service/AuthService.java`
- [Employee and department logic](https://github.com/abhishek-0-04/employee_leave_management/tree/main/backend/src/main/java/com/example/leavemanagement/service): `backend/src/main/java/com/example/leavemanagement/service`
- [Leave workflow logic](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/service/LeaveService.java): `backend/src/main/java/com/example/leavemanagement/service/LeaveService.java`
- [Dashboard statistics](https://github.com/abhishek-0-04/employee_leave_management/blob/main/backend/src/main/java/com/example/leavemanagement/service/DashboardService.java): `backend/src/main/java/com/example/leavemanagement/service/DashboardService.java`

### Persistence

- [MySQL database](https://github.com/abhishek-0-04/employee_leave_management/blob/main/database/schema.sql): `database/schema.sql`

### Other components

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

## Connections

- Employee → Sign in / register: signs in (evidence: `README.md`)
- Employee → Employee pages: uses (evidence: `README.md`)
- Administrator → Sign in / register: signs in (evidence: `README.md`)
- Administrator → Admin pages: manages (evidence: `README.md`)
- Sign in / register → Auth state: submits credentials (evidence: `frontend/src/app/services/auth.service.ts`)
- Routes and guards → Sign in / register: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Routes and guards → Employee pages: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Routes and guards → Admin pages: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Routes and guards → Auth state: guards routes
- Employee pages → API services: requests data (evidence: `frontend/src/app/components/employee/dashboard.component.ts`)
- Admin pages → API services: requests data (evidence: `frontend/src/app/components/admin/employee-management.component.ts`)
- Auth state → API endpoint config: uses endpoint (evidence: `frontend/src/app/services/auth.service.ts`)
- API services → API endpoint config: uses endpoint (evidence: `frontend/src/app/services/leave.service.ts`)
- API services → Client data models: uses types (evidence: `frontend/src/app/services/leave.service.ts`)
- Auth state → Authentication API: calls REST (evidence: `README.md`)
- API services → Employee API: calls REST (evidence: `README.md`)
- API services → Department API: calls REST (evidence: `README.md`)
- API services → Leave API: calls REST (evidence: `README.md`)
- Admin pages → Dashboard API: requests statistics
- Authentication API → Authentication logic: delegates
- Employee API → Employee and department logic: delegates
- Department API → Employee and department logic: delegates
- Leave API → Leave workflow logic: delegates
- Dashboard API → Dashboard statistics: delegates
- Authentication logic → MySQL database: persists data
- Employee and department logic → MySQL database: persists data
- Leave workflow logic → MySQL database: persists requests
- Dashboard statistics → MySQL database: reads statistics
