# tahawey/dpm-scada architecture

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

- Interactive diagram: https://gitdiagram.com/tahawey/dpm-scada
- Repository: https://github.com/tahawey/dpm-scada

## Overview

##### Main Components
- Node-RED Environment: Represented by the “node-red-flow.json”, this is the engine of the system where all logic flows are defined.
- DPM Dashboard (HMI): The visual interface generated by Node-RED to display real-time data from digital power meters.
- Digital Power Meter Interface: While not directly visible as code, the README mentions integration with digital meters (e.g., Schneider PM710). It should be represented as the data source.

##### Component Interactions and Relationships
- The Node-RED flows (from node-red-flow.json) handle data acquisition from the DPM (digital power meter) and pass this information to the dashboard.
- An external connection or interface (denoted as the Digital Power Meter) should be connected to Node-RED, indicating data flow from the hardware (like the Schneider PM710) to the software platform.

##### Architectural Patterns and Design Principles
- Minimalism in design—no traditional SCADA server is used; instead, a single lightweight Node-RED-based system drives the entire application.
- Stress how the dashboard is generated in real-time from flows, which act as the middleware between the hardware (digital meter) and the visualization layer.

## Diagram (Mermaid)

```mermaid
graph TD
    Meter["Digital Power Meter (Schneider PM710)"]:::device
    RED["Node-RED Engine (Flow Controller)"]:::backend
    Dashboard["DPM Dashboard (HMI)"]:::dashboard
    Assets["Asset Repository (Static UI resources)"]:::assets

    Meter -->|"dataFlow"| RED
    RED -->|"flowsData"| Dashboard
    Dashboard -->|"loadsAssets"| Assets

    click RED "https://github.com/tahawey/dpm-scada/blob/main/node-red-flow.json"
    click Dashboard "https://github.com/tahawey/dpm-scada/blob/main/node-red-flow.json"
    click Assets "https://github.com/tahawey/dpm-scada/tree/main/imges"

    classDef backend fill:#A0C4FF,stroke:#333,stroke-width:2px;
    classDef dashboard fill:#BDE0FE,stroke:#333,stroke-width:2px;
    classDef device fill:#FFA500,stroke:#333,stroke-width:2px;
    classDef assets fill:#CAFFBF,stroke:#333,stroke-width:2px;
```
