# hongyuyang296/leasepluse-springboot architecture

> Architecture diagram of the GitHub repository hongyuyang296/leasepluse-springboot, 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/hongyuyang296/leasepluse-springboot
- Repository: https://github.com/hongyuyang296/leasepluse-springboot

## Overview

LeasePluse is a small Spring Boot API for calculating employee salary-packaging limits. A client posts employee details to the calculation endpoint; Spring binds them to an Employee, the controller calls the salary rules service, and the numeric result is returned to the client. WebConfig documents cross-origin access for the frontend. The sampled application excludes datasource auto-configuration, and the repository tree shows no persistence implementation. Edges reflect the documented endpoint and sampled controller/service calls.

Main entry points: [`src/main/java/com/leasepluse/backend/controller/SalaryCalculatorController.java`](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/controller/SalaryCalculatorController.java) (Calculation Endpoint), [`src/main/java/com/leasepluse/backend/service/SalaryPackageService.java`](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/service/SalaryPackageService.java) (Salary Rules), [`src/main/java/com/leasepluse/backend/BackendApplication.java`](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/BackendApplication.java) (Backend Application), [`src/main/java/com/leasepluse/backend/config/WebConfig.java`](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/config/WebConfig.java) (CORS Configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application Runtime"]
  node_application["Backend Application"]
  node_cors["CORS Configuration<br/>[WebConfig.java]"]
end

subgraph group_api["HTTP API"]
  node_calculator["Calculation Endpoint"]
end

subgraph group_domain["Calculation Domain"]
  node_employee["Employee Input<br/>[Employee.java]"]
  node_salary_service["Salary Rules"]
end

node_client(("API Client"))

node_client -->|"posts details"| node_calculator
node_calculator -->|"binds request"| node_employee
node_calculator -->|"calculates limit"| node_salary_service
node_salary_service -->|"reads fields"| node_employee
node_salary_service -->|"returns limit"| node_calculator
node_calculator -->|"returns result"| node_client
node_application -->|"starts context"| node_calculator
node_application -->|"starts context"| node_salary_service
node_application -->|"starts context"| node_cors
node_cors -->|"sets CORS policy"| node_calculator

click node_application "https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/BackendApplication.java"
click node_cors "https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/config/WebConfig.java"
click node_calculator "https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/controller/SalaryCalculatorController.java"
click node_employee "https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/model/Employee.java"
click node_salary_service "https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/service/SalaryPackageService.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_application,node_cors,node_client toneBlue
class node_calculator toneAmber
class node_employee,node_salary_service toneMint
```

## Components

### Application Runtime

- [Backend Application](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/BackendApplication.java): `src/main/java/com/leasepluse/backend/BackendApplication.java`
- [CORS Configuration](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/config/WebConfig.java): `src/main/java/com/leasepluse/backend/config/WebConfig.java`

### HTTP API

- [Calculation Endpoint](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/controller/SalaryCalculatorController.java): `src/main/java/com/leasepluse/backend/controller/SalaryCalculatorController.java`

### Calculation Domain

- [Employee Input](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/model/Employee.java): `src/main/java/com/leasepluse/backend/model/Employee.java`
- [Salary Rules](https://github.com/hongyuyang296/leasepluse-springboot/blob/master/src/main/java/com/leasepluse/backend/service/SalaryPackageService.java): `src/main/java/com/leasepluse/backend/service/SalaryPackageService.java`

### Other components

- **API Client**

## Connections

- API Client → Calculation Endpoint: posts details
- Calculation Endpoint → Employee Input: binds request
- Calculation Endpoint → Salary Rules: calculates limit
- Salary Rules → Employee Input: reads fields
- Salary Rules → Calculation Endpoint: returns limit
- Calculation Endpoint → API Client: returns result
- Backend Application → Calculation Endpoint: starts context
- Backend Application → Salary Rules: starts context
- Backend Application → CORS Configuration: starts context
- CORS Configuration → Calculation Endpoint: sets CORS policy
