# mailtoraj369/employee-hub-ui architecture

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

- Interactive diagram: https://gitdiagram.com/mailtoraj369/employee-hub-ui
- Repository: https://github.com/mailtoraj369/employee-hub-ui

## Overview

Employee Hub UI is an Angular experience backed by a Spring Boot API façade that proxies employee queries to a separately configured service. The main user journey is login, guarded dashboard/report navigation, then employee or aggregate data retrieval and display; the Java layer forwards API calls and returns JSON. Metrics and error handling are additional backend capabilities. The repository evidence shows frontend-to-controller routing and controller-to-client calls; the downstream service implementation is outside this repository.

Main entry points: [`ui/src/app/routes/app.routes.ts`](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/routes/app.routes.ts) (Route configuration), [`ui/src/app/app.ts`](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/app.ts) (Angular app shell), [`src/main/java/com/acme/employeehub/ui/controller/EmployeeController.java`](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/controller/EmployeeController.java) (Employee API), [`ui/src/app/services/employee.service.ts`](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/services/employee.service.ts) (HTTP data service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Angular experience"]
  node_angular["Angular app shell<br/>[app.ts]"]
  node_routes["Route configuration<br/>[app.routes.ts]"]
  node_auth["Login and auth state<br/>[auth.service.ts]"]
  node_guard["Auth route guard<br/>[auth.guard.ts]"]
  node_dashboard["Employee dashboard"]
  node_report["Employee reports"]
  node_employee_service["HTTP data service"]
end

subgraph group_backend["Spring API façade"]
  node_spring["Spring Boot app"]
  node_employee_controller["Employee API"]
  node_rest_client["Downstream REST client"]
  node_errors["API error handling"]
end

subgraph group_observability["API observability"]
  node_metrics_controller["Metrics endpoints"]
  node_metrics[("API metric counters<br/>[ApiMetrics.java]")]
  node_timing["Request timing"]
end

node_user(("User"))
node_downstream{{"Employee service"}}

node_user -->|"uses"| node_angular
node_angular -->|"configures"| node_routes
node_routes -->|"guards routes"| node_guard
node_guard -->|"checks auth"| node_auth
node_angular -->|"logs out"| node_auth
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_report
node_dashboard -->|"requests employees"| node_employee_service
node_report -->|"requests aggregates"| node_employee_service
node_employee_service -->|"calls API"| node_employee_controller
node_employee_controller -->|"delegates queries"| node_rest_client
node_rest_client -->|"calls service"| node_downstream
node_employee_controller -.->|"handled by"| node_errors
node_metrics_controller -->|"reads counters"| node_metrics
node_timing -.->|"records timings"| node_metrics

click node_angular "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/app.ts"
click node_routes "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/routes/app.routes.ts"
click node_auth "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/auth/auth.service.ts"
click node_guard "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/auth/auth.guard.ts"
click node_dashboard "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/dashboard/dashboard.component.ts"
click node_report "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/report/report.component.ts"
click node_employee_service "https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/services/employee.service.ts"
click node_spring "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/EmployeeHubUiApplication.java"
click node_employee_controller "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/controller/EmployeeController.java"
click node_rest_client "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/client/EmployeeRestClient.java"
click node_errors "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/exception/GlobalExceptionHandler.java"
click node_metrics_controller "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/controller/MetricsController.java"
click node_metrics "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/config/ApiMetrics.java"
click node_timing "https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/config/RequestTimingAspect.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_angular,node_routes,node_auth,node_guard,node_dashboard,node_report,node_employee_service,node_user toneBlue
class node_spring,node_employee_controller,node_rest_client,node_errors toneAmber
class node_metrics_controller,node_metrics,node_timing toneMint
class node_downstream toneIndigo
```

## Components

### Angular experience

- [Angular app shell](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/app.ts): `ui/src/app/app.ts`
- [Route configuration](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/routes/app.routes.ts): `ui/src/app/routes/app.routes.ts`
- [Login and auth state](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/auth/auth.service.ts): `ui/src/app/auth/auth.service.ts`
- [Auth route guard](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/auth/auth.guard.ts): `ui/src/app/auth/auth.guard.ts`
- [Employee dashboard](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/dashboard/dashboard.component.ts): `ui/src/app/dashboard/dashboard.component.ts`
- [Employee reports](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/report/report.component.ts): `ui/src/app/report/report.component.ts`
- [HTTP data service](https://github.com/mailtoraj369/employee-hub-ui/blob/main/ui/src/app/services/employee.service.ts): `ui/src/app/services/employee.service.ts`

### Spring API façade

- [Spring Boot app](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/EmployeeHubUiApplication.java): `src/main/java/com/acme/employeehub/ui/EmployeeHubUiApplication.java`
- [Employee API](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/controller/EmployeeController.java): `src/main/java/com/acme/employeehub/ui/controller/EmployeeController.java`
- [Downstream REST client](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/client/EmployeeRestClient.java): `src/main/java/com/acme/employeehub/ui/client/EmployeeRestClient.java`
- [API error handling](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/exception/GlobalExceptionHandler.java): `src/main/java/com/acme/employeehub/ui/exception/GlobalExceptionHandler.java`

### API observability

- [Metrics endpoints](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/controller/MetricsController.java): `src/main/java/com/acme/employeehub/ui/controller/MetricsController.java`
- [API metric counters](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/config/ApiMetrics.java): `src/main/java/com/acme/employeehub/ui/config/ApiMetrics.java`
- [Request timing](https://github.com/mailtoraj369/employee-hub-ui/blob/main/src/main/java/com/acme/employeehub/ui/config/RequestTimingAspect.java): `src/main/java/com/acme/employeehub/ui/config/RequestTimingAspect.java`

### Other components

- **User**
- **Employee service**

## Connections

- User → Angular app shell: uses (evidence: `README.md`)
- Angular app shell → Route configuration: configures
- Route configuration → Auth route guard: guards routes (evidence: `ui/src/app/routes/app.routes.ts`)
- Auth route guard → Login and auth state: checks auth (evidence: `ui/src/app/auth/auth.guard.ts`)
- Angular app shell → Login and auth state: logs out (evidence: `ui/src/app/app.ts`)
- Route configuration → Employee dashboard: routes to (evidence: `ui/src/app/routes/app.routes.ts`)
- Route configuration → Employee reports: routes to (evidence: `ui/src/app/routes/app.routes.ts`)
- Employee dashboard → HTTP data service: requests employees (evidence: `ui/src/app/dashboard/dashboard.component.ts`)
- Employee reports → HTTP data service: requests aggregates (evidence: `ui/src/app/report/report.component.ts`)
- HTTP data service → Employee API: calls API (evidence: `README.md`)
- Employee API → Downstream REST client: delegates queries (evidence: `src/main/java/com/acme/employeehub/ui/controller/EmployeeController.java`)
- Downstream REST client → Employee service: calls service (evidence: `src/main/java/com/acme/employeehub/ui/client/EmployeeRestClient.java`)
- Employee API → API error handling: handled by
- Metrics endpoints → API metric counters: reads counters (evidence: `src/main/java/com/acme/employeehub/ui/controller/MetricsController.java`)
- Request timing → API metric counters: records timings (evidence: `src/main/java/com/acme/employeehub/ui/config/RequestTimingAspect.java`)
