# aliorabi/dash-manufacture-spc-dashboard architecture

> Architecture diagram of the GitHub repository aliorabi/dash-manufacture-spc-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aliorabi/dash-manufacture-spc-dashboard
- Repository: https://github.com/aliorabi/dash-manufacture-spc-dashboard

## Overview

This repository is a Dash manufacturing statistical-process-control dashboard, with a separate flow-meter MQTT experiment. The main workflow is an operator viewing process metrics and trends, starting or stopping simulated measurements, inspecting control-chart/OOC status, and editing specification limits. The root and data/app.py contain dashboard implementations; the sampled excerpts do not establish that the MQTT data feeds either dashboard. Relationships for unsampled features rely on the README, and the two dashboard variants are shown separately.

Main entry points: [`app.py`](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py) (Live Metrics), [`flowmeter-reading/water_flow.py`](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/water_flow.py) (Pulse Publisher), [`flowmeter-reading/mqtt_subscriber.py`](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/mqtt_subscriber.py) (MQTT Subscriber), [`data/app.py`](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/app.py) (Data Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard UI"]
  node_root_app["Main Dashboard<br/>[app.py]"]
  node_variant_app["Data Dashboard<br/>[app.py]"]
  node_live_view["Live Metrics<br/>[app.py]"]
  node_setup_view["Station Setup<br/>[app.py]"]
end

subgraph group_spc["Process Control"]
  node_metric_state["Metric State<br/>[app.py]"]
  node_sparklines["Trend Sparklines<br/>[app.py]"]
  node_control_chart["Control Charts<br/>[app.py]"]
  node_ooc_status["OOC Status<br/>[app.py]"]
  node_spec_limits["Specification Limits<br/>[app.py]"]
  node_spc_data["SPC Sample Data<br/>[spc_data.csv]"]
  node_metrics_data["Metric Data<br/>[df.csv]"]
end

subgraph group_acquisition["Flow Meter Acquisition"]
  node_flow_sensor(("Flow Sensor"))
  node_water_flow["Pulse Publisher<br/>[water_flow.py]"]
  node_mqtt_broker["MQTT Broker"]
  node_mqtt_subscriber["MQTT Subscriber<br/>[mqtt_subscriber.py]"]
  node_flow_data["Flow Data CSV<br/>[data.csv]"]
end

subgraph group_support["Supporting Views"]
  node_converter["Unit Converter<br/>[RTD-Stream.py]"]
  node_converter_fragment["Setup UI Fragment<br/>[converter.py]"]
  node_stream_page["Stream Table Page<br/>[RTD-Stream.py]"]
  node_station_page["Station Page Stub<br/>[station-setting.py]"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_root_app
node_root_app -->|"renders"| node_live_view
node_root_app -->|"renders"| node_setup_view
node_root_app -->|"updates"| node_metric_state
node_metric_state -->|"reads"| node_spc_data
node_metric_state -->|"reads"| node_metrics_data
node_live_view -->|"shows"| node_sparklines
node_live_view -->|"shows"| node_control_chart
node_live_view -->|"signals"| node_ooc_status
node_setup_view -->|"edits"| node_spec_limits
node_operator -->|"starts or stops"| node_live_view
node_operator -->|"selects metrics"| node_setup_view
node_operator -.->|"uses"| node_variant_app
node_flow_sensor -->|"provides pulses"| node_water_flow
node_water_flow -->|"publishes"| node_mqtt_broker
node_mqtt_broker -->|"delivers messages"| node_mqtt_subscriber
node_mqtt_subscriber -->|"appends"| node_flow_data

click node_root_app "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_variant_app "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/app.py"
click node_live_view "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_setup_view "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_metric_state "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_sparklines "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_control_chart "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_ooc_status "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_spec_limits "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py"
click node_spc_data "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/spc_data.csv"
click node_metrics_data "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/df.csv"
click node_water_flow "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/water_flow.py"
click node_mqtt_subscriber "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/mqtt_subscriber.py"
click node_flow_data "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/data.csv"
click node_converter "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/RTD-Stream.py"
click node_converter_fragment "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/converter.py"
click node_stream_page "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/pages/RTD-Stream.py"
click node_station_page "https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/pages/station-setting.py"

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_root_app,node_variant_app,node_live_view,node_setup_view toneBlue
class node_metric_state,node_sparklines,node_control_chart,node_ooc_status,node_spec_limits,node_spc_data,node_metrics_data toneAmber
class node_flow_sensor,node_water_flow,node_mqtt_broker,node_mqtt_subscriber,node_flow_data toneMint
class node_converter,node_converter_fragment,node_stream_page,node_station_page toneRose
class node_operator toneIndigo
```

## Components

### Dashboard UI

- [Main Dashboard](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [Data Dashboard](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/app.py): `data/app.py`
- [Live Metrics](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [Station Setup](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`

### Process Control

- [Metric State](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [Trend Sparklines](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [Control Charts](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [OOC Status](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [Specification Limits](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/app.py): `app.py`
- [SPC Sample Data](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/spc_data.csv): `data/spc_data.csv`
- [Metric Data](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/df.csv): `data/df.csv`

### Flow Meter Acquisition

- **Flow Sensor**
- [Pulse Publisher](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/water_flow.py): `flowmeter-reading/water_flow.py`
- **MQTT Broker**
- [MQTT Subscriber](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/mqtt_subscriber.py): `flowmeter-reading/mqtt_subscriber.py`
- [Flow Data CSV](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/flowmeter-reading/data.csv): `flowmeter-reading/data.csv`

### Supporting Views

- [Unit Converter](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/data/RTD-Stream.py): `data/RTD-Stream.py`
- [Setup UI Fragment](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/converter.py): `converter.py`
- [Stream Table Page](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/pages/RTD-Stream.py): `pages/RTD-Stream.py`
- [Station Page Stub](https://github.com/aliorabi/dash-manufacture-spc-dashboard/blob/master/pages/station-setting.py): `pages/station-setting.py`

### Other components

- **Operator**

## Connections

- Operator → Main Dashboard: uses (evidence: `README.md`)
- Main Dashboard → Live Metrics: renders (evidence: `app.py`)
- Main Dashboard → Station Setup: renders (evidence: `app.py`)
- Main Dashboard → Metric State: updates (evidence: `app.py`)
- Metric State → SPC Sample Data: reads (evidence: `app.py`)
- Metric State → Metric Data: reads (evidence: `app.py`)
- Live Metrics → Trend Sparklines: shows (evidence: `README.md`)
- Live Metrics → Control Charts: shows (evidence: `README.md`)
- Live Metrics → OOC Status: signals (evidence: `README.md`)
- Station Setup → Specification Limits: edits (evidence: `README.md`)
- Operator → Live Metrics: starts or stops (evidence: `README.md`)
- Operator → Station Setup: selects metrics (evidence: `README.md`)
- Operator → Data Dashboard: uses
- Flow Sensor → Pulse Publisher: provides pulses (evidence: `flowmeter-reading/water_flow.py`)
- Pulse Publisher → MQTT Broker: publishes (evidence: `flowmeter-reading/water_flow.py`)
- MQTT Broker → MQTT Subscriber: delivers messages (evidence: `flowmeter-reading/mqtt_subscriber.py`)
- MQTT Subscriber → Flow Data CSV: appends (evidence: `flowmeter-reading/mqtt_subscriber.py`)
