# tungxeng2406/quanlynhansu architecture

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

- Interactive diagram: https://gitdiagram.com/tungxeng2406/quanlynhansu
- Repository: https://github.com/tungxeng2406/quanlynhansu

## Overview

HR Management is a Spring Boot web application for employee records, with its browser UI served by the backend. Users search, filter, sort and page through employee records, then view, create, edit, delete or export them; the API delegates business work to a service and persists through Spring Data JPA. A separate browser-side workflow imports item CSV files, validates and calculates VAT, displays results and exports them. The README documents capabilities beyond the sampled source; those are represented at subsystem level where paths are supported.

Main entry points: [`src/main/java/vn/tungxeng/hr/controller/EmployeeController.java`](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/controller/EmployeeController.java) (Employee API), [`src/main/resources/static/index.html`](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/index.html) (Employee page), [`src/main/resources/static/app.js`](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/app.js) (Employee workflows), [`src/main/java/vn/tungxeng/hr/service/impl/EmployeeServiceImpl.java`](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/service/impl/EmployeeServiceImpl.java) (Employee operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser experience"]
  node_employee_page["Employee page<br/>[index.html]"]
  node_employee_ui["Employee workflows<br/>[app.js]"]
  node_items_csv["Items CSV<br/>[items-csv.js]"]
end

subgraph group_employee_api["Employee API"]
  node_application["Spring Boot app<br/>[HrApplication.java]"]
  node_controller["Employee API"]
  node_dto["API DTOs"]
  node_error_handler["Error handling"]
end

subgraph group_business["Business logic"]
  node_service["Employee service"]
  node_service_impl["Employee operations"]
end

subgraph group_persistence["Persistence"]
  node_employee_entity["Employee record<br/>[Employee.java]"]
  node_repository["Employee repository"]
  node_h2[("H2 database")]
end

node_user(("HR user"))
node_download["Downloaded CSV"]

node_user -->|"uses"| node_employee_page
node_employee_page -->|"loads"| node_employee_ui
node_employee_page -->|"loads"| node_items_csv
node_employee_ui -->|"calls API"| node_controller
node_controller -->|"returns data"| node_employee_ui
node_controller -->|"delegates"| node_service
node_controller -->|"maps payloads"| node_dto
node_service -->|"implemented by"| node_service_impl
node_service_impl -->|"queries and saves"| node_repository
node_repository -->|"reads and writes"| node_h2
node_service_impl -->|"maps records"| node_employee_entity
node_items_csv -->|"exports items"| node_download
node_employee_ui -->|"downloads export"| node_download
node_application -->|"serves static UI"| node_employee_page
node_controller -->|"handled errors"| node_error_handler

click node_employee_page "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/index.html"
click node_employee_ui "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/app.js"
click node_items_csv "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/items-csv.js"
click node_application "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/HrApplication.java"
click node_controller "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/controller/EmployeeController.java"
click node_dto "https://github.com/tungxeng2406/quanlynhansu/tree/main/src/main/java/vn/tungxeng/hr/dto"
click node_error_handler "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/exception/GlobalExceptionHandler.java"
click node_service "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/service/EmployeeService.java"
click node_service_impl "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/service/impl/EmployeeServiceImpl.java"
click node_employee_entity "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/entity/Employee.java"
click node_repository "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/repository/EmployeeRepository.java"
click node_h2 "https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/application-local.yml"

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_page,node_employee_ui,node_items_csv,node_user toneBlue
class node_application,node_controller,node_dto,node_error_handler toneAmber
class node_service,node_service_impl toneMint
class node_employee_entity,node_repository,node_h2 toneRose
class node_download toneIndigo
```

## Components

### Browser experience

- [Employee page](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/index.html): `src/main/resources/static/index.html`
- [Employee workflows](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/app.js): `src/main/resources/static/app.js`
- [Items CSV](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/static/items-csv.js): `src/main/resources/static/items-csv.js`

### Employee API

- [Spring Boot app](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/HrApplication.java): `src/main/java/vn/tungxeng/hr/HrApplication.java`
- [Employee API](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/controller/EmployeeController.java): `src/main/java/vn/tungxeng/hr/controller/EmployeeController.java`
- [API DTOs](https://github.com/tungxeng2406/quanlynhansu/tree/main/src/main/java/vn/tungxeng/hr/dto): `src/main/java/vn/tungxeng/hr/dto`
- [Error handling](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/exception/GlobalExceptionHandler.java): `src/main/java/vn/tungxeng/hr/exception/GlobalExceptionHandler.java`

### Business logic

- [Employee service](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/service/EmployeeService.java): `src/main/java/vn/tungxeng/hr/service/EmployeeService.java`
- [Employee operations](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/service/impl/EmployeeServiceImpl.java): `src/main/java/vn/tungxeng/hr/service/impl/EmployeeServiceImpl.java`

### Persistence

- [Employee record](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/entity/Employee.java): `src/main/java/vn/tungxeng/hr/entity/Employee.java`
- [Employee repository](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/java/vn/tungxeng/hr/repository/EmployeeRepository.java): `src/main/java/vn/tungxeng/hr/repository/EmployeeRepository.java`
- [H2 database](https://github.com/tungxeng2406/quanlynhansu/blob/main/src/main/resources/application-local.yml): `src/main/resources/application-local.yml`

### Other components

- **HR user**
- **Downloaded CSV**

## Connections

- HR user → Employee page: uses
- Employee page → Employee workflows: loads
- Employee page → Items CSV: loads
- Employee workflows → Employee API: calls API
- Employee API → Employee workflows: returns data
- Employee API → Employee service: delegates
- Employee API → API DTOs: maps payloads
- Employee service → Employee operations: implemented by
- Employee operations → Employee repository: queries and saves
- Employee repository → H2 database: reads and writes
- Employee operations → Employee record: maps records
- Items CSV → Downloaded CSV: exports items
- Employee workflows → Downloaded CSV: downloads export
- Spring Boot app → Employee page: serves static UI
- Employee API → Error handling: handled errors
