# shm11c3/hardwarevisualizer architecture

> Architecture diagram of the GitHub repository shm11c3/hardwarevisualizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shm11c3/hardwarevisualizer
- Repository: https://github.com/shm11c3/hardwarevisualizer

## Overview

##### Project type and purpose
- HardwareVisualizer is a cross-platform desktop application built with Tauri.
- It pairs a React/TypeScript frontend (rendered in a WebView) with a Rust backend that gathers hardware metrics, persists them, and exposes them to the UI.
- Use-cases include real-time monitoring, historical insights, customizable dashboards, and background image support.

##### File structure
- Top-level “src” directory: frontend code (Vite + React + TypeScript + RSPC for RPC).
- “src-tauri” directory: Rust backend code (Cargo.toml, src/main.rs, build.rs, commands, services, database, tests).
- Configuration files: tsconfig.json, vite.config.ts, tauri.conf.json, workflows under .github/workflows.
- Tests split into frontend unit tests (vitest) and Rust integration/tests.
- Utilities and library code in “src/lib” (TypeScript) and “src-tauri/src/utils” (Rust).

##### README for additional insights
- Confirms Tauri, Node.js, Rust versions.
- Describes features: CPU, RAM, GPU, storage, network metrics; history insights; customizable UI.
- Outlines development commands, platform support, and build steps.

##### Elements
- Clear labels:
– “React Renderer”
– “RSPC / Tauri Bridge”
– “Rust Command Handlers”
– “Hardware Services”
– “SQLite Database”
– “OS Metrics APIs”
– UI → RPC → Commands → Services → OS
– Services → DB → RPC → UI (for historical data)
– Backend modules in another (e.g., green)
– Frontend, IPC layer, Backend (sub-modules), External Systems.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Frontend (WebView)"
        FR["React Renderer"]:::frontend
    end

    subgraph "IPC / RPC Layer"
        RSPC["RSPC / Tauri Bridge"]:::ipc
    end

    subgraph "Backend (Rust)"
        subgraph "Command Handlers"
            CMD["Rust Command Handlers"]:::backend
        end
        subgraph "Service Modules"
            SRV["Hardware Service Modules"]:::backend
        end
        subgraph "Database Layer"
            DB["SQLite Database"]:::database
        end
        subgraph "Utilities"
            UT["Utilities"]:::backend
        end
        subgraph "Background Tasks"
            BG["Background Tasks"]:::backend
        end
        subgraph "Tauri Config & Entry"
            TA["Tauri Configuration & Native Entry"]:::backend
        end
    end

    subgraph "External OS / System APIs"
        OS["OS Metrics APIs"]:::external
    end

    subgraph "Assets & Policies"
        AS["Assets & Policies"]:::external
    end

    FR -->|"UI actions"| RSPC
    RSPC -->|"RPC calls"| CMD
    CMD -->|"invoke services"| SRV
    SRV -->|"gather metrics"| OS
    SRV -->|"store/retrieve"| DB
    DB -->|"return data"| RSPC
    RSPC -->|"render updates"| FR
    FR -->|"settings changes"| RSPC
    RSPC -->|"apply settings"| CMD
    CMD -->|"use utils"| UT
    CMD -->|"schedule tasks"| BG
    TA -->|"bundles config"| CMD
    AS -->|"packaged assets"| TA

    classDef frontend fill:#88ccff,stroke:#000,stroke-width:1px
    classDef ipc fill:#88eeff,stroke:#000,stroke-width:1px
    classDef backend fill:#aaffaa,stroke:#000,stroke-width:1px
    classDef database fill:#ffcc88,stroke:#000,stroke-width:1px
    classDef external fill:#dddddd,stroke:#000,stroke-width:1px

    click FR "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src/App.tsx"
    click FR "https://github.com/shm11c3/hardwarevisualizer/tree/develop/src/components/"
    click FR "https://github.com/shm11c3/hardwarevisualizer/tree/develop/src/features/"
    click RSPC "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src/rspc/bindings.ts"
    click TA "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/tauri.conf.json"
    click TA "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/main.rs"
    click TA "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/build.rs"
    click CMD "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/commands/mod.rs"
    click CMD "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/commands/background_image.rs"
    click CMD "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/commands/hardware.rs"
    click CMD "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/commands/settings.rs"
    click CMD "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/commands/system.rs"
    click CMD "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/commands/ui.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/mod.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/ip_linux.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/wmi_service.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/amd_gpu_linux.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/intel_gpu_linux.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/nvidia_gpu_service.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/directx_gpu_service.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/memory/proc_meminfo.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/memory/memory_info_linux.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/memory/dmidecode.rs"
    click SRV "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/services/memory/cached.rs"
    click DB "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/database/mod.rs"
    click DB "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/database/db.rs"
    click DB "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/database/hardware_archive.rs"
    click DB "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/database/gpu_archive.rs"
    click DB "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/database/process_stats.rs"
    click DB "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/database/migration.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/mod.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/logger.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/formatter.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/file.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/color.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/ip.rs"
    click UT "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/utils/tauri.rs"
    click BG "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/backgrounds/mod.rs"
    click BG "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/backgrounds/background_image.rs"
    click BG "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/backgrounds/system_monitor.rs"
    click BG "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/backgrounds/hardware_archive.rs"
    click BG "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/src/backgrounds/updater.rs"
    click AS "https://github.com/shm11c3/hardwarevisualizer/tree/develop/src-tauri/assets/"
    click AS "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/assets/deb/com.HardwareVisualizer.app.policy"
    click AS "https://github.com/shm11c3/hardwarevisualizer/blob/develop/src-tauri/icons/icon.icns"
```
