# rubengameztorrijos/solaxpower-sk-su5000e architecture

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

- Interactive diagram: https://gitdiagram.com/rubengameztorrijos/solaxpower-sk-su5000e
- Repository: https://github.com/rubengameztorrijos/solaxpower-sk-su5000e

## Overview

##### Main Components
- Node-RED: The heart of the project, responsible for gathering data from the inverter via RESTful API calls (both local and cloud endpoints) and processing it.
- InfluxDB 2.0: The time-series database receiving the data for indefinite storage and data query.
- Grafana (Optional): The layer for advanced data visualization and dashboard design.
- Solax Inverter & External Data Sources: Represents the device (or endpoints) from which real-time or historical data is retrieved using HTTP GET calls.
- (Optional) MySQL: Mentioned as an alternative storage option in the README, though InfluxDB is recommended.

##### Component Relationships & Data Flow
- The inverter exposes API endpoints (via local network and cloud) for real-time and historical data.
- Node-RED acts as the data acquisition engine. It calls these endpoints, processes the received data (translating and formatting), and then forwards it.
- Data Flow: API Calls (via GET) from the inverter → Node-RED (processing flow, as seen in the Node-RED flow directory) → Data storage in InfluxDB 2.0.
- (Optional) Grafana connects with InfluxDB to fetch stored data and render dashboards.

##### Architectural Patterns & Design Principles
- Separation of concerns: Node-RED handles data acquisition and transformation, while InfluxDB handles time-series data storage and Grafana provides the analytics/visualization layer.
- The design leverages a modular and decoupled architecture making it easy to replace or add components (for example, switching MySQL in place of InfluxDB if necessary).
- Use of Docker in the overall deployment for Node-RED, InfluxDB, and Grafana as per the prerequisites, indicating containerized environments and potential orchestration.

##### Relevant Technologies, Frameworks, and Libraries
- Node-RED (illustrated with a dedicated directory containing flows).
- InfluxDB 2.0 (time-series database).
- Grafana (dashboard and visualization tool).
- Docker (as the common deployment platform for these components).
- HTTP GET calls for real-time data and historical data retrieval.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Systems
    subgraph "External Systems"
        InverterLocal["Solax Inverter (Local)"]:::external
        InverterCloud["Solax Inverter (Cloud)"]:::external
    end

    %% Docker Container: Node-RED
    subgraph "Docker Container: Node-RED"
        NR["Node-RED: Data Processing Engine"]:::processing
        NRFlows["Flows: SolaxPower SK-SU5000E"]:::processing
    end

    %% Docker Container: Data Storage
    subgraph "Docker Container: Data Storage"
        InfluxDB["InfluxDB 2.0"]:::database
        MySQL["MySQL (Alternative)"]:::database
    end

    %% Docker Container: Data Visualization
    subgraph "Docker Container: Data Visualization"
        Grafana["Grafana Dashboard"]:::visualization
    end

    %% Data Flow Arrows
    InverterLocal -->|"GET/api/realTimeData.html"| NR
    InverterCloud -->|"GET/api/historicalData.html"| NR
    NR -->|"ProcessesData"| NRFlows
    NR -->|"SendsData"| InfluxDB
    NR -->|"OptionalStorage"| MySQL
    InfluxDB -->|"QueryData"| Grafana

    %% Click Events for Component Mapping
    click NR "https://github.com/rubengameztorrijos/solaxpower-sk-su5000e/tree/main/Node-Red"
    click NRFlows "https://github.com/rubengameztorrijos/solaxpower-sk-su5000e/tree/main/Node-Red/flow-solaxpower-sk-su5000e"

    %% Styles
    classDef external fill:#d9ead3,stroke:#38761d,stroke-width:2px;
    classDef processing fill:#c9daf8,stroke:#1155cc,stroke-width:2px;
    classDef database fill:#ffe599,stroke:#bf9000,stroke-width:2px;
    classDef visualization fill:#ead1dc,stroke:#b854a3,stroke-width:2px;
```
