# viethung0823/7hkem10-hrms architecture

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

- Interactive diagram: https://gitdiagram.com/viethung0823/7hkem10-hrms
- Repository: https://github.com/viethung0823/7hkem10-hrms

## Overview

This is a Java/Spring human-resource management application. Its apparent user workflow is to authenticate and manage employee records, organizational structure, contracts, and location data through REST resources, with services handling domain operations and repositories persisting entities. The README is only a placeholder, so the feature inventory comes from the source tree; controller-to-service wiring is not shown in the excerpts and is marked unverified. The graph emphasizes the major domain stages and sampled service/persistence relationships.

Main entry points: [`src/main/java/com/oop7hkem10/hrm/repos`](https://github.com/viethung0823/7hkem10-hrms/tree/main/src/main/java/com/oop7hkem10/hrm/repos) (JPA repositories), [`src/main/java/com/oop7hkem10/hrm/rest`](https://github.com/viethung0823/7hkem10-hrms/tree/main/src/main/java/com/oop7hkem10/hrm/rest) (REST resources), [`src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java`](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java) (Location management), [`src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java`](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java) (Employee management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["REST API"]
  node_resources["REST resources"]
  node_repositories[("JPA repositories")]
end

subgraph group_people["People and Organization"]
  node_employees["Employee management"]
  node_departments["Department management"]
  node_positions["Job positions"]
  node_company["Company management"]
  node_employee_data[("Employee records<br/>[HrEmployee.java]")]
  node_department_data[("Departments<br/>[HrDepartment.java]")]
  node_position_data[("Job positions<br/>[HrJobPosition.java]")]
  node_company_data[("Companies<br/>[ResCompany.java]")]
end

subgraph group_contracts["Contracts"]
  node_contracts["Contract management"]
  node_contract_data[("Contract records<br/>[HrContract.java]")]
end

subgraph group_locations["Locations"]
  node_location_service["Location management"]
  node_location_data[("Work locations<br/>[ResLocation.java]")]
  node_geography_data[("Geographic records<br/>[ResDistrict.java]")]
end

subgraph group_security["Authentication"]
  node_auth["Login and JWT"]
  node_token_filter["JWT request filter"]
  node_user_service["User authentication"]
end

node_user(("HRMS user"))

node_user -.->|"uses"| node_resources
node_resources -.->|"dispatches"| node_employees
node_resources -.->|"dispatches"| node_departments
node_resources -.->|"dispatches"| node_positions
node_resources -.->|"dispatches"| node_contracts
node_resources -.->|"dispatches"| node_location_service
node_employees -->|"queries"| node_repositories
node_departments -->|"queries"| node_repositories
node_positions -->|"queries"| node_repositories
node_company -->|"queries"| node_repositories
node_contracts -->|"queries"| node_repositories
node_location_service -->|"queries"| node_repositories
node_repositories -->|"persists"| node_employee_data
node_repositories -->|"persists"| node_contract_data
node_repositories -->|"persists"| node_position_data
node_repositories -->|"persists"| node_location_data
node_employees -->|"manages"| node_employee_data
node_departments -->|"manages"| node_department_data
node_positions -->|"manages"| node_position_data
node_company -->|"manages"| node_company_data
node_contracts -->|"manages"| node_contract_data
node_location_service -->|"manages"| node_location_data
node_location_service -->|"uses"| node_geography_data
node_auth -.->|"authenticates"| node_user_service
node_token_filter -->|"loads user"| node_user_service

click node_resources "https://github.com/viethung0823/7hkem10-hrms/tree/main/src/main/java/com/oop7hkem10/hrm/rest"
click node_employees "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java"
click node_departments "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrDepartmentService.java"
click node_positions "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrJobPositionService.java"
click node_company "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/ResCompanyService.java"
click node_employee_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrEmployee.java"
click node_department_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrDepartment.java"
click node_position_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrJobPosition.java"
click node_company_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/ResCompany.java"
click node_contracts "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrContractService.java"
click node_contract_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrContract.java"
click node_location_service "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java"
click node_location_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/ResLocation.java"
click node_geography_data "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/ResDistrict.java"
click node_auth "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/rest/AuthController.java"
click node_token_filter "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/util/AuthTokenFilter.java"
click node_user_service "https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/CustomUserDetailsService.java"
click node_repositories "https://github.com/viethung0823/7hkem10-hrms/tree/main/src/main/java/com/oop7hkem10/hrm/repos"

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_resources,node_repositories,node_user toneBlue
class node_employees,node_departments,node_positions,node_company,node_employee_data,node_department_data,node_position_data,node_company_data toneAmber
class node_contracts,node_contract_data toneMint
class node_location_service,node_location_data,node_geography_data toneRose
class node_auth,node_token_filter,node_user_service toneIndigo
```

## Components

### REST API

- [REST resources](https://github.com/viethung0823/7hkem10-hrms/tree/main/src/main/java/com/oop7hkem10/hrm/rest): `src/main/java/com/oop7hkem10/hrm/rest`
- [JPA repositories](https://github.com/viethung0823/7hkem10-hrms/tree/main/src/main/java/com/oop7hkem10/hrm/repos): `src/main/java/com/oop7hkem10/hrm/repos`

### People and Organization

- [Employee management](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java): `src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java`
- [Department management](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrDepartmentService.java): `src/main/java/com/oop7hkem10/hrm/service/HrDepartmentService.java`
- [Job positions](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrJobPositionService.java): `src/main/java/com/oop7hkem10/hrm/service/HrJobPositionService.java`
- [Company management](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/ResCompanyService.java): `src/main/java/com/oop7hkem10/hrm/service/ResCompanyService.java`
- [Employee records](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrEmployee.java): `src/main/java/com/oop7hkem10/hrm/domain/HrEmployee.java`
- [Departments](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrDepartment.java): `src/main/java/com/oop7hkem10/hrm/domain/HrDepartment.java`
- [Job positions](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrJobPosition.java): `src/main/java/com/oop7hkem10/hrm/domain/HrJobPosition.java`
- [Companies](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/ResCompany.java): `src/main/java/com/oop7hkem10/hrm/domain/ResCompany.java`

### Contracts

- [Contract management](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/HrContractService.java): `src/main/java/com/oop7hkem10/hrm/service/HrContractService.java`
- [Contract records](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/HrContract.java): `src/main/java/com/oop7hkem10/hrm/domain/HrContract.java`

### Locations

- [Location management](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java): `src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java`
- [Work locations](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/ResLocation.java): `src/main/java/com/oop7hkem10/hrm/domain/ResLocation.java`
- [Geographic records](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/domain/ResDistrict.java): `src/main/java/com/oop7hkem10/hrm/domain/ResDistrict.java`

### Authentication

- [Login and JWT](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/rest/AuthController.java): `src/main/java/com/oop7hkem10/hrm/rest/AuthController.java`
- [JWT request filter](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/util/AuthTokenFilter.java): `src/main/java/com/oop7hkem10/hrm/util/AuthTokenFilter.java`
- [User authentication](https://github.com/viethung0823/7hkem10-hrms/blob/main/src/main/java/com/oop7hkem10/hrm/service/CustomUserDetailsService.java): `src/main/java/com/oop7hkem10/hrm/service/CustomUserDetailsService.java`

### Other components

- **HRMS user**

## Connections

- HRMS user → REST resources: uses
- REST resources → Employee management: dispatches
- REST resources → Department management: dispatches
- REST resources → Job positions: dispatches
- REST resources → Contract management: dispatches
- REST resources → Location management: dispatches
- Employee management → JPA repositories: queries (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java`)
- Department management → JPA repositories: queries (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrDepartmentService.java`)
- Job positions → JPA repositories: queries (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrJobPositionService.java`)
- Company management → JPA repositories: queries (evidence: `src/main/java/com/oop7hkem10/hrm/service/ResCompanyService.java`)
- Contract management → JPA repositories: queries (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrContractService.java`)
- Location management → JPA repositories: queries (evidence: `src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java`)
- JPA repositories → Employee records: persists (evidence: `src/main/java/com/oop7hkem10/hrm/repos/HrEmployeeRepository.java`)
- JPA repositories → Contract records: persists (evidence: `src/main/java/com/oop7hkem10/hrm/repos/HrContractRepository.java`)
- JPA repositories → Job positions: persists (evidence: `src/main/java/com/oop7hkem10/hrm/repos/HrJobPositionRepository.java`)
- JPA repositories → Work locations: persists (evidence: `src/main/java/com/oop7hkem10/hrm/repos/ResLocationRepository.java`)
- Employee management → Employee records: manages (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrEmployeeService.java`)
- Department management → Departments: manages (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrDepartmentService.java`)
- Job positions → Job positions: manages (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrJobPositionService.java`)
- Company management → Companies: manages (evidence: `src/main/java/com/oop7hkem10/hrm/service/ResCompanyService.java`)
- Contract management → Contract records: manages (evidence: `src/main/java/com/oop7hkem10/hrm/service/HrContractService.java`)
- Location management → Work locations: manages (evidence: `src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java`)
- Location management → Geographic records: uses (evidence: `src/main/java/com/oop7hkem10/hrm/service/ResLocationService.java`)
- Login and JWT → User authentication: authenticates
- JWT request filter → User authentication: loads user (evidence: `src/main/java/com/oop7hkem10/hrm/util/AuthTokenFilter.java`)
