# kirill-talk/luxpower-data-visualizer architecture

> Architecture diagram of the GitHub repository kirill-talk/luxpower-data-visualizer, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kirill-talk/luxpower-data-visualizer
- Repository: https://github.com/kirill-talk/luxpower-data-visualizer

## Overview

Luxpower Data Visualizer is a web dashboard for monitoring Luxpower hybrid-inverter telemetry. Users authenticate with Luxpower Cloud (or use configured credentials), then view live operating status, power flow, KPIs, 24-hour charts, and searchable/exportable telemetry history. The React app presents desktop and mobile views; an Express gateway exposes telemetry routes and uses a Luxpower client to retrieve cloud data. Source excerpts establish the server-to-client calls and UI module references; the browser-to-gateway request wiring is not shown, so that connection is marked unverified.

Main entry points: [`client/src/App.jsx`](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/App.jsx) (Dashboard App), [`client/src/utils/i18n.js`](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/utils/i18n.js) (Translations), [`client/src/components/AuthModal.jsx`](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/AuthModal.jsx) (Cloud Login), [`client/src/components/mobile/MobileKpiGrid.jsx`](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileKpiGrid.jsx) (Mobile KPIs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard UI"]
  node_app["Dashboard App<br/>[App.jsx]"]
  node_auth["Cloud Login<br/>[AuthModal.jsx]"]
end

subgraph group_analytics["Telemetry Views"]
  node_desktop_flow["Desktop Power Flow"]
  node_mobile_flow["Mobile Power Flow"]
  node_mobile_kpis["Mobile KPIs<br/>[MobileKpiGrid.jsx]"]
  node_mobile_status["Mobile Status"]
  node_mobile_log["Recent Telemetry"]
  node_power_chart["Power Chart<br/>[PowerFlowChart.jsx]"]
  node_battery_chart["Battery Chart<br/>[BatteryChart.jsx]"]
  node_grid_chart["Grid and Temperature"]
  node_telemetry_table["Telemetry Table<br/>[DataTable.jsx]"]
end

subgraph group_gateway["Gateway and Cloud"]
  node_gateway_api["Telemetry API<br/>[server.js]"]
  node_lux_client["Luxpower Client<br/>[luxpower.js]"]
end

subgraph group_shared["Shared Presentation Logic"]
  node_energy_math["Energy Calculations<br/>[energyMath.js]"]
  node_translations["Translations<br/>[i18n.js]"]
end

node_operator(("Operator"))
node_cloud["Luxpower Cloud"]

node_operator -->|"uses"| node_app
node_app -->|"renders"| node_auth
node_app -->|"renders"| node_desktop_flow
node_app -->|"renders"| node_mobile_flow
node_app -->|"renders"| node_mobile_kpis
node_app -->|"renders"| node_mobile_status
node_app -->|"renders"| node_mobile_log
node_app -->|"renders"| node_power_chart
node_app -->|"renders"| node_battery_chart
node_app -->|"renders"| node_grid_chart
node_app -->|"renders"| node_telemetry_table
node_app -->|"uses"| node_energy_math
node_app -->|"uses"| node_translations
node_mobile_kpis -->|"formats durations"| node_energy_math
node_auth -->|"uses"| node_translations
node_mobile_log -->|"uses"| node_translations
node_mobile_status -->|"uses"| node_translations
node_app -.->|"requests telemetry"| node_gateway_api
node_gateway_api -->|"calls"| node_lux_client
node_lux_client -->|"requests data"| node_cloud

click node_app "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/App.jsx"
click node_auth "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/AuthModal.jsx"
click node_desktop_flow "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/PowerFlowDiagram.jsx"
click node_mobile_flow "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobilePowerFlowDiagram.jsx"
click node_mobile_kpis "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileKpiGrid.jsx"
click node_mobile_status "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileStatusBar.jsx"
click node_mobile_log "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileRecentLog.jsx"
click node_power_chart "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/PowerFlowChart.jsx"
click node_battery_chart "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/BatteryChart.jsx"
click node_grid_chart "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/GridVoltageTempChart.jsx"
click node_telemetry_table "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/DataTable.jsx"
click node_energy_math "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/utils/energyMath.js"
click node_translations "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/utils/i18n.js"
click node_gateway_api "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/server.js"
click node_lux_client "https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/src/api/luxpower.js"

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_app,node_auth toneBlue
class node_desktop_flow,node_mobile_flow,node_mobile_kpis,node_mobile_status,node_mobile_log,node_power_chart,node_battery_chart,node_grid_chart,node_telemetry_table toneAmber
class node_gateway_api,node_lux_client toneMint
class node_energy_math,node_translations toneRose
class node_operator,node_cloud toneIndigo
```

## Components

### Dashboard UI

- [Dashboard App](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Cloud Login](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/AuthModal.jsx): `client/src/components/AuthModal.jsx`

### Telemetry Views

- [Desktop Power Flow](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/PowerFlowDiagram.jsx): `client/src/components/PowerFlowDiagram.jsx`
- [Mobile Power Flow](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobilePowerFlowDiagram.jsx): `client/src/components/mobile/MobilePowerFlowDiagram.jsx`
- [Mobile KPIs](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileKpiGrid.jsx): `client/src/components/mobile/MobileKpiGrid.jsx`
- [Mobile Status](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileStatusBar.jsx): `client/src/components/mobile/MobileStatusBar.jsx`
- [Recent Telemetry](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/mobile/MobileRecentLog.jsx): `client/src/components/mobile/MobileRecentLog.jsx`
- [Power Chart](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/PowerFlowChart.jsx): `client/src/components/PowerFlowChart.jsx`
- [Battery Chart](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/BatteryChart.jsx): `client/src/components/BatteryChart.jsx`
- [Grid and Temperature](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/GridVoltageTempChart.jsx): `client/src/components/GridVoltageTempChart.jsx`
- [Telemetry Table](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/components/DataTable.jsx): `client/src/components/DataTable.jsx`

### Gateway and Cloud

- [Telemetry API](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/server.js): `server.js`
- [Luxpower Client](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/src/api/luxpower.js): `src/api/luxpower.js`

### Shared Presentation Logic

- [Energy Calculations](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/utils/energyMath.js): `client/src/utils/energyMath.js`
- [Translations](https://github.com/kirill-talk/luxpower-data-visualizer/blob/main/client/src/utils/i18n.js): `client/src/utils/i18n.js`

### Other components

- **Operator**
- **Luxpower Cloud**

## Connections

- Operator → Dashboard App: uses (evidence: `README.md`)
- Dashboard App → Cloud Login: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Desktop Power Flow: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Mobile Power Flow: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Mobile KPIs: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Mobile Status: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Recent Telemetry: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Power Chart: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Battery Chart: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Grid and Temperature: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Telemetry Table: renders (evidence: `client/src/App.jsx`)
- Dashboard App → Energy Calculations: uses (evidence: `client/src/App.jsx`)
- Dashboard App → Translations: uses (evidence: `client/src/App.jsx`)
- Mobile KPIs → Energy Calculations: formats durations (evidence: `client/src/components/mobile/MobileKpiGrid.jsx`)
- Cloud Login → Translations: uses (evidence: `client/src/components/AuthModal.jsx`)
- Recent Telemetry → Translations: uses (evidence: `client/src/components/mobile/MobileRecentLog.jsx`)
- Mobile Status → Translations: uses (evidence: `client/src/components/mobile/MobileStatusBar.jsx`)
- Dashboard App → Telemetry API: requests telemetry
- Telemetry API → Luxpower Client: calls (evidence: `server.js`)
- Luxpower Client → Luxpower Cloud: requests data (evidence: `src/api/luxpower.js`)
