# pedro-h-dev/asset-audit-system architecture

> Architecture diagram of the GitHub repository pedro-h-dev/asset-audit-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pedro-h-dev/asset-audit-system
- Repository: https://github.com/pedro-h-dev/asset-audit-system

## Overview

AssetOS is a lightweight asset-inventory and audit application. Users work through a browser UI that loads and filters assets, then calls the Spring REST API; the service applies asset rules, persists changes, and records audit events. The README also describes employee assignment, location management, and KPI reporting; the sampled frontend shows employee and location views backed by in-memory data, not dedicated server persistence. The graph reflects documented capabilities, but unsampled implementation details and some UI-to-API calls are omitted where excerpts do not establish them.

Main entry points: [`backend/src/main/resources/static/app.js`](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js) (Asset inventory UI), [`backend/src/main/java/backend/service/AssetService.java`](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/service/AssetService.java) (Asset rules and audit), [`backend/src/main/java/backend/controller/AssetController.java`](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/controller/AssetController.java) (Asset REST API), [`backend/src/main/java/backend/repository/AssetRepository.java`](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/repository/AssetRepository.java) (Asset repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Browser interface"]
  node_web["Dashboard shell<br/>[index.html]"]
  node_asset_ui["Asset inventory UI<br/>[app.js]"]
  node_employee_ui["Employee assignments<br/>[app.js]"]
  node_location_ui["Location views<br/>[app.js]"]
  node_dashboard["KPIs and search<br/>[app.js]"]
end

subgraph group_domain["Asset API and domain"]
  node_controller["Asset REST API"]
  node_service["Asset rules and audit<br/>[AssetService.java]"]
  node_asset["Asset records<br/>[Asset.java]"]
  node_audit["Audit events<br/>[AuditLog.java]"]
end

subgraph group_storage["Persistence"]
  node_asset_repo["Asset repository"]
  node_audit_repo["Audit repository"]
  node_database[("H2 database")]
end

node_user(("Staff user"))

node_user -->|"uses"| node_web
node_web -.->|"hosts"| node_asset_ui
node_asset_ui -->|"calls API"| node_controller
node_controller -->|"delegates"| node_service
node_service -->|"reads and writes"| node_asset_repo
node_service -->|"records and reads"| node_audit_repo
node_asset_repo -.->|"persists assets"| node_database
node_audit_repo -.->|"persists events"| node_database
node_asset_ui -->|"filters assets"| node_dashboard
node_asset_ui -->|"renders assignments"| node_employee_ui
node_asset_ui -->|"renders locations"| node_location_ui
node_service -->|"manages"| node_asset
node_service -->|"creates and queries"| node_audit
node_controller -->|"accepts and returns"| node_asset
node_controller -->|"returns history"| node_audit
node_asset_repo -->|"stores"| node_asset
node_audit_repo -->|"stores"| node_audit

click node_web "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/index.html"
click node_asset_ui "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js"
click node_employee_ui "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js"
click node_location_ui "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js"
click node_dashboard "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js"
click node_controller "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/controller/AssetController.java"
click node_service "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/service/AssetService.java"
click node_asset "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/model/Asset.java"
click node_audit "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/model/AuditLog.java"
click node_asset_repo "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/repository/AssetRepository.java"
click node_audit_repo "https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/repository/AuditLogRepository.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_web,node_asset_ui,node_employee_ui,node_location_ui,node_dashboard,node_user toneBlue
class node_controller,node_service,node_asset,node_audit toneAmber
class node_asset_repo,node_audit_repo,node_database toneMint
```

## Components

### Browser interface

- [Dashboard shell](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/index.html): `backend/src/main/resources/static/index.html`
- [Asset inventory UI](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js): `backend/src/main/resources/static/app.js`
- [Employee assignments](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js): `backend/src/main/resources/static/app.js`
- [Location views](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js): `backend/src/main/resources/static/app.js`
- [KPIs and search](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/resources/static/app.js): `backend/src/main/resources/static/app.js`

### Asset API and domain

- [Asset REST API](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/controller/AssetController.java): `backend/src/main/java/backend/controller/AssetController.java`
- [Asset rules and audit](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/service/AssetService.java): `backend/src/main/java/backend/service/AssetService.java`
- [Asset records](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/model/Asset.java): `backend/src/main/java/backend/model/Asset.java`
- [Audit events](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/model/AuditLog.java): `backend/src/main/java/backend/model/AuditLog.java`

### Persistence

- [Asset repository](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/repository/AssetRepository.java): `backend/src/main/java/backend/repository/AssetRepository.java`
- [Audit repository](https://github.com/pedro-h-dev/asset-audit-system/blob/main/backend/src/main/java/backend/repository/AuditLogRepository.java): `backend/src/main/java/backend/repository/AuditLogRepository.java`
- **H2 database**

### Other components

- **Staff user**

## Connections

- Staff user → Dashboard shell: uses (evidence: `README.md`)
- Dashboard shell → Asset inventory UI: hosts
- Asset inventory UI → Asset REST API: calls API (evidence: `backend/src/main/resources/static/app.js`)
- Asset REST API → Asset rules and audit: delegates (evidence: `backend/src/main/java/backend/controller/AssetController.java`)
- Asset rules and audit → Asset repository: reads and writes (evidence: `backend/src/main/java/backend/service/AssetService.java`)
- Asset rules and audit → Audit repository: records and reads (evidence: `backend/src/main/java/backend/service/AssetService.java`)
- Asset repository → H2 database: persists assets
- Audit repository → H2 database: persists events
- Asset inventory UI → KPIs and search: filters assets (evidence: `backend/src/main/resources/static/app.js`)
- Asset inventory UI → Employee assignments: renders assignments (evidence: `backend/src/main/resources/static/app.js`)
- Asset inventory UI → Location views: renders locations (evidence: `backend/src/main/resources/static/app.js`)
- Asset rules and audit → Asset records: manages (evidence: `backend/src/main/java/backend/service/AssetService.java`)
- Asset rules and audit → Audit events: creates and queries (evidence: `backend/src/main/java/backend/service/AssetService.java`)
- Asset REST API → Asset records: accepts and returns (evidence: `backend/src/main/java/backend/controller/AssetController.java`)
- Asset REST API → Audit events: returns history (evidence: `backend/src/main/java/backend/controller/AssetController.java`)
- Asset repository → Asset records: stores (evidence: `backend/src/main/java/backend/repository/AssetRepository.java`)
- Audit repository → Audit events: stores (evidence: `backend/src/main/java/backend/repository/AuditLogRepository.java`)
