# hanselak/seniordesign_safeware architecture

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

- Interactive diagram: https://gitdiagram.com/hanselak/seniordesign_safeware
- Repository: https://github.com/hanselak/seniordesign_safeware

## Overview

SafeWare is a senior-design worker-safety system: camera-based PPE checks and wearable motion sensing feed dashboards and alerts. The clearest end-to-end paths are the root camera uploader and the live-camera project’s USB fall detector; the repository also contains a broader Raspberry Pi sensor-dashboard implementation. README documentation is sparse, and several listed hardware and integration files were not sampled, so uncertain links are omitted or marked unverified.

Main entry points: [`PPE_Safety_Dashboard_Live_Camera/server_dashboard.py`](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/server_dashboard.py) (Live-camera dashboard API), [`PPE_Safety_Dashboard_Live_Camera/static/dashboard.js`](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/static/dashboard.js) (Dashboard interface), [`PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py`](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py) (Fall detector and logger), [`camera_to_dashboard.py`](https://github.com/hanselak/seniordesign_safeware/blob/main/camera_to_dashboard.py) (CSI camera pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_vision["PPE vision"]
  node_camera["CSI camera pipeline"]
  node_model["YOLO PPE detection"]
  node_safety_camera["Live-camera pipeline"]
end

subgraph group_wearable["Wearable sensing"]
  node_motion["ESP32 motion device<br/>[esp32_mpu6050.ino]"]
  node_fall_detector["Fall detector and logger"]
  node_fall_log[("Fall event log<br/>[fall_log.csv]")]
  node_standalone_fall["Standalone fall detector<br/>[fall_detection.py]"]
end

subgraph group_dashboard["Dashboard and alerts"]
  node_main_server["PPE dashboard API"]
  node_live_server["Live-camera dashboard API"]
  node_dashboard_ui["Dashboard interface<br/>[dashboard.js]"]
  node_dashboard_page["Dashboard page<br/>[dashboard.html]"]
  node_dashboard_style["Dashboard styling<br/>[dashboard.css]"]
end

subgraph group_sensors["Sensor dashboard"]
  node_raspberry_pi["Raspberry Pi sensor suite<br/>[ppe_sim2.py]"]
end

node_operator(("Safety operator"))
node_viewer(("Dashboard viewer"))

node_camera -->|"runs inference"| node_model
node_camera -->|"posts frames"| node_main_server
node_motion -.->|"streams serial data"| node_fall_detector
node_fall_detector -->|"posts motion"| node_live_server
node_fall_detector -->|"appends events"| node_fall_log
node_operator -.->|"views dashboard"| node_live_server
node_dashboard_ui -->|"polls state"| node_live_server
node_dashboard_ui -->|"triggers alerts"| node_live_server
node_live_server -.->|"serves state"| node_dashboard_ui
node_dashboard_page -.->|"loads script"| node_dashboard_ui
node_dashboard_style -.->|"styles page"| node_dashboard_page
node_raspberry_pi -.->|"serves dashboard"| node_viewer
node_standalone_fall -->|"logs samples"| node_fall_log
node_safety_camera -->|"posts frames"| node_live_server

click node_camera "https://github.com/hanselak/seniordesign_safeware/blob/main/camera_to_dashboard.py"
click node_model "https://github.com/hanselak/seniordesign_safeware/blob/main/camera_to_dashboard.py"
click node_motion "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/esp32_mpu6050/esp32_mpu6050.ino"
click node_fall_detector "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py"
click node_fall_log "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/fall_log.csv"
click node_main_server "https://github.com/hanselak/seniordesign_safeware/blob/main/server_dashboard.py"
click node_live_server "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/server_dashboard.py"
click node_dashboard_ui "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/static/dashboard.js"
click node_dashboard_page "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/templates/dashboard.html"
click node_dashboard_style "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/static/dashboard.css"
click node_raspberry_pi "https://github.com/hanselak/seniordesign_safeware/blob/main/ppe_sim2.py"
click node_standalone_fall "https://github.com/hanselak/seniordesign_safeware/blob/main/fall_detection.py"
click node_safety_camera "https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/camera_to_dashboard.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_camera,node_model,node_safety_camera,node_viewer toneBlue
class node_motion,node_fall_detector,node_fall_log,node_standalone_fall toneAmber
class node_main_server,node_live_server,node_dashboard_ui,node_dashboard_page,node_dashboard_style toneMint
class node_raspberry_pi toneRose
class node_operator toneIndigo
```

## Components

### PPE vision

- [CSI camera pipeline](https://github.com/hanselak/seniordesign_safeware/blob/main/camera_to_dashboard.py): `camera_to_dashboard.py`
- [YOLO PPE detection](https://github.com/hanselak/seniordesign_safeware/blob/main/camera_to_dashboard.py): `camera_to_dashboard.py`
- [Live-camera pipeline](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/camera_to_dashboard.py): `PPE_Safety_Dashboard_Live_Camera/camera_to_dashboard.py`

### Wearable sensing

- [ESP32 motion device](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/esp32_mpu6050/esp32_mpu6050.ino): `PPE_Safety_Dashboard_Live_Camera/esp32_mpu6050/esp32_mpu6050.ino`
- [Fall detector and logger](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py): `PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py`
- [Fall event log](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/fall_log.csv): `PPE_Safety_Dashboard_Live_Camera/fall_log.csv`
- [Standalone fall detector](https://github.com/hanselak/seniordesign_safeware/blob/main/fall_detection.py): `fall_detection.py`

### Dashboard and alerts

- [PPE dashboard API](https://github.com/hanselak/seniordesign_safeware/blob/main/server_dashboard.py): `server_dashboard.py`
- [Live-camera dashboard API](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/server_dashboard.py): `PPE_Safety_Dashboard_Live_Camera/server_dashboard.py`
- [Dashboard interface](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/static/dashboard.js): `PPE_Safety_Dashboard_Live_Camera/static/dashboard.js`
- [Dashboard page](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/templates/dashboard.html): `PPE_Safety_Dashboard_Live_Camera/templates/dashboard.html`
- [Dashboard styling](https://github.com/hanselak/seniordesign_safeware/blob/main/PPE_Safety_Dashboard_Live_Camera/static/dashboard.css): `PPE_Safety_Dashboard_Live_Camera/static/dashboard.css`

### Sensor dashboard

- [Raspberry Pi sensor suite](https://github.com/hanselak/seniordesign_safeware/blob/main/ppe_sim2.py): `ppe_sim2.py`

### Other components

- **Safety operator**
- **Dashboard viewer**

## Connections

- CSI camera pipeline → YOLO PPE detection: runs inference (evidence: `camera_to_dashboard.py`)
- CSI camera pipeline → PPE dashboard API: posts frames (evidence: `camera_to_dashboard.py`)
- ESP32 motion device → Fall detector and logger: streams serial data
- Fall detector and logger → Live-camera dashboard API: posts motion (evidence: `PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py`)
- Fall detector and logger → Fall event log: appends events (evidence: `PPE_Safety_Dashboard_Live_Camera/fall_to_dashboard.py`)
- Safety operator → Live-camera dashboard API: views dashboard
- Dashboard interface → Live-camera dashboard API: polls state (evidence: `PPE_Safety_Dashboard_Live_Camera/static/dashboard.js`)
- Dashboard interface → Live-camera dashboard API: triggers alerts (evidence: `PPE_Safety_Dashboard_Live_Camera/static/dashboard.js`)
- Live-camera dashboard API → Dashboard interface: serves state
- Dashboard page → Dashboard interface: loads script
- Dashboard styling → Dashboard page: styles page
- Raspberry Pi sensor suite → Dashboard viewer: serves dashboard
- Standalone fall detector → Fall event log: logs samples (evidence: `fall_detection.py`)
- Live-camera pipeline → Live-camera dashboard API: posts frames (evidence: `PPE_Safety_Dashboard_Live_Camera/camera_to_dashboard.py`)
