# shanthan-peshwaker/hrms-formi-9-use-case architecture

> Architecture diagram of the GitHub repository shanthan-peshwaker/hrms-formi-9-use-case, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanthan-peshwaker/hrms-formi-9-use-case
- Repository: https://github.com/shanthan-peshwaker/hrms-formi-9-use-case

## Overview

This is a new-hire compliance hub: the UI submits employee details and onboarding document text, then displays saved employees with I-9 and document-validation statuses and notes. The backend onboarding service coordinates I-9 verification, document validation, and persistence; the controller exposes create and employee-read endpoints. The tree includes both rule-based and AI-named validator implementations, but their internals and selection are not shown in the sampled source. The README provides no further capability detail, so uncertain validator and storage wiring is omitted.

Main entry points: [`hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/controller/EmployeeController.java`](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/controller/EmployeeController.java) (Employee API), [`hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/NewHireOnboardingService.java`](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/NewHireOnboardingService.java) (Onboarding workflow), [`hrt-newhire-hub/hrt-newhire-hub/frontend/src/App.jsx`](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/frontend/src/App.jsx) (Employee form and list), [`hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/DocumentValidator.java`](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/DocumentValidator.java) (Document validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_ui["Employee form and list<br/>[App.jsx]"]
end

subgraph group_api["API and onboarding"]
  node_controller["Employee API"]
  node_request["Hire request"]
  node_response["Employee response"]
  node_onboarding["Onboarding workflow"]
  node_errors["API error handling"]
end

subgraph group_compliance["Compliance checks"]
  node_i9["I-9 verification"]
  node_validator["Document validator"]
  node_rules["Rule-based validator"]
  node_ai["AI validator"]
end

subgraph group_persistence["Employee persistence"]
  node_employee["Employee record<br/>[Employee.java]"]
  node_repository[("Employee repository")]
end

node_user(("HR user"))

node_user -->|"enters details"| node_ui
node_ui -->|"calls API"| node_controller
node_controller -->|"binds input"| node_request
node_controller -->|"onboards or queries"| node_onboarding
node_onboarding -->|"verifies I-9"| node_i9
node_onboarding -->|"validates text"| node_validator
node_validator -.->|"implemented by"| node_rules
node_validator -.->|"implemented by"| node_ai
node_onboarding -->|"saves or reads"| node_repository
node_repository -->|"persists record"| node_employee
node_controller -->|"maps output"| node_response
node_controller -->|"handles exceptions"| node_errors
node_ui -->|"shows statuses"| node_user

click node_ui "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/frontend/src/App.jsx"
click node_controller "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/controller/EmployeeController.java"
click node_request "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/dto/NewHireRequest.java"
click node_response "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/dto/EmployeeResponse.java"
click node_onboarding "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/NewHireOnboardingService.java"
click node_errors "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/exception/GlobalExceptionHandler.java"
click node_i9 "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/I9VerificationService.java"
click node_validator "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/DocumentValidator.java"
click node_rules "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/RuleBasedDocumentValidator.java"
click node_ai "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/AiDocumentValidator.java"
click node_employee "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/entity/Employee.java"
click node_repository "https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/repository/EmployeeRepository.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_ui,node_user toneBlue
class node_controller,node_request,node_response,node_onboarding,node_errors toneAmber
class node_i9,node_validator,node_rules,node_ai toneMint
class node_employee,node_repository toneRose
```

## Components

### Web interface

- [Employee form and list](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/frontend/src/App.jsx): `hrt-newhire-hub/hrt-newhire-hub/frontend/src/App.jsx`

### API and onboarding

- [Employee API](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/controller/EmployeeController.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/controller/EmployeeController.java`
- [Hire request](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/dto/NewHireRequest.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/dto/NewHireRequest.java`
- [Employee response](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/dto/EmployeeResponse.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/dto/EmployeeResponse.java`
- [Onboarding workflow](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/NewHireOnboardingService.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/NewHireOnboardingService.java`
- [API error handling](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/exception/GlobalExceptionHandler.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/exception/GlobalExceptionHandler.java`

### Compliance checks

- [I-9 verification](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/I9VerificationService.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/I9VerificationService.java`
- [Document validator](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/DocumentValidator.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/DocumentValidator.java`
- [Rule-based validator](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/RuleBasedDocumentValidator.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/RuleBasedDocumentValidator.java`
- [AI validator](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/AiDocumentValidator.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/service/AiDocumentValidator.java`

### Employee persistence

- [Employee record](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/entity/Employee.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/entity/Employee.java`
- [Employee repository](https://github.com/shanthan-peshwaker/hrms-formi-9-use-case/blob/main/hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/repository/EmployeeRepository.java): `hrt-newhire-hub/hrt-newhire-hub/backend/src/main/java/com/hrthub/newhire/repository/EmployeeRepository.java`

### Other components

- **HR user**

## Connections

- HR user → Employee form and list: enters details
- Employee form and list → Employee API: calls API
- Employee API → Hire request: binds input
- Employee API → Onboarding workflow: onboards or queries
- Onboarding workflow → I-9 verification: verifies I-9
- Onboarding workflow → Document validator: validates text
- Document validator → Rule-based validator: implemented by
- Document validator → AI validator: implemented by
- Onboarding workflow → Employee repository: saves or reads
- Employee repository → Employee record: persists record
- Employee API → Employee response: maps output
- Employee API → API error handling: handles exceptions
- Employee form and list → HR user: shows statuses
