# zukewandile/st10448895-smartsensor architecture

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

- Interactive diagram: https://gitdiagram.com/zukewandile/st10448895-smartsensor
- Repository: https://github.com/zukewandile/st10448895-smartsensor

## Overview

SensorX is a WPF smart-sensor management application, alongside a small ASP.NET status API. The visible workflows cover account registration/login, gateway connectivity checks, sensor profiles and attachments, and simulated motion scanning with path analysis, hierarchy validation, metrics, and replay. Telemetry and dashboard views are present in the tree, but their implementation was not sampled; their connections are therefore omitted. Edges reflect shown calls or indexed references, not assumed navigation.

Main entry points: [`sensorX/Views/MotionScannerWindow.xaml.cs`](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/MotionScannerWindow.xaml.cs) (Motion scanner), [`sensorX/Views/SignUpWindow.xaml.cs`](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SignUpWindow.xaml.cs) (Sign up), [`sensorX/Services/FirebaseAuthService.cs`](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/FirebaseAuthService.cs) (Firebase auth), [`sensorX/Views/LoginWindow.xaml.cs`](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/LoginWindow.xaml.cs) (Login)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and gateway"]
  node_signup["Sign up"]
  node_login["Login"]
  node_auth["Firebase auth"]
  node_gateway["Gateway"]
  node_api_client["API client<br/>[ApiClient.cs]"]
end

subgraph group_sensor["Sensor management"]
  node_sensor_views["Sensor profiles"]
  node_sensor_store[("Sensor collection<br/>[SensorStore.cs]")]
  node_sensor_model["Sensor record<br/>[Sensor.cs]"]
  node_attachment_view["Attachments view"]
  node_attachment_service["Attachment storage"]
  node_attachment_model["Attachment metadata"]
  node_telemetry["Telemetry view"]
  node_dashboard["Dashboard"]
end

subgraph group_motion["Motion scanning"]
  node_motion_view["Motion scanner"]
  node_motion_point["Motion points<br/>[MotionPoint.cs]"]
  node_motion_node["Motion hierarchy<br/>[MotionNode.cs]"]
  node_path_analyzer["Path analysis"]
  node_hierarchy_validator["Hierarchy validation"]
end

subgraph group_api["Status API"]
  node_api_program["Status endpoints<br/>[Program.cs]"]
end

node_user(("User"))
node_firebase["Firebase"]

node_user -->|"enters details"| node_signup
node_signup -->|"creates account"| node_auth
node_auth -->|"sends auth requests"| node_firebase
node_signup -->|"requests verification"| node_auth
node_user -->|"submits credentials"| node_login
node_login -->|"authenticates"| node_auth
node_signup -->|"opens"| node_gateway
node_gateway -->|"checks availability"| node_api_client
node_api_client -->|"requests scanner status"| node_api_program
node_user -.->|"manages sensors"| node_sensor_views
node_sensor_views -->|"reads and updates"| node_sensor_store
node_sensor_store -->|"holds records"| node_sensor_model
node_user -.->|"manages files"| node_attachment_view
node_attachment_view -->|"saves files"| node_attachment_service
node_attachment_service -->|"returns metadata"| node_attachment_model
node_user -.->|"starts scan"| node_motion_view
node_motion_view -->|"measures path"| node_path_analyzer
node_motion_view -->|"records points"| node_motion_point
node_motion_view -->|"builds hierarchy"| node_motion_node
node_motion_view -->|"validates hierarchy"| node_hierarchy_validator

click node_signup "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SignUpWindow.xaml.cs"
click node_login "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/LoginWindow.xaml.cs"
click node_auth "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/FirebaseAuthService.cs"
click node_gateway "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/GatewayWindow.xaml.cs"
click node_api_client "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/ApiClient.cs"
click node_api_program "https://github.com/zukewandile/st10448895-smartsensor/blob/main/API-X/Program.cs"
click node_sensor_views "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SensorWindow.xaml.cs"
click node_sensor_store "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/SensorStore.cs"
click node_sensor_model "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/Sensor.cs"
click node_attachment_view "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SensorAttachmentsWindow.xaml.cs"
click node_attachment_service "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/AttachmentStorageService.cs"
click node_attachment_model "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/SensorAttachment.cs"
click node_motion_view "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/MotionScannerWindow.xaml.cs"
click node_motion_point "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/MotionPoint.cs"
click node_motion_node "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/MotionNode.cs"
click node_path_analyzer "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/MotionPathAnalyzer.cs"
click node_hierarchy_validator "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/MotionHierarchyValidator.cs"
click node_telemetry "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/TelemetryWindow.xaml.cs"
click node_dashboard "https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SensorDashBoard.xaml.cs"

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_signup,node_login,node_auth,node_gateway,node_api_client,node_user toneBlue
class node_sensor_views,node_sensor_store,node_sensor_model,node_attachment_view,node_attachment_service,node_attachment_model,node_telemetry,node_dashboard toneAmber
class node_motion_view,node_motion_point,node_motion_node,node_path_analyzer,node_hierarchy_validator toneMint
class node_api_program toneRose
class node_firebase toneIndigo
```

## Components

### Access and gateway

- [Sign up](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SignUpWindow.xaml.cs): `sensorX/Views/SignUpWindow.xaml.cs`
- [Login](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/LoginWindow.xaml.cs): `sensorX/Views/LoginWindow.xaml.cs`
- [Firebase auth](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/FirebaseAuthService.cs): `sensorX/Services/FirebaseAuthService.cs`
- [Gateway](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/GatewayWindow.xaml.cs): `sensorX/Views/GatewayWindow.xaml.cs`
- [API client](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/ApiClient.cs): `sensorX/Services/ApiClient.cs`

### Sensor management

- [Sensor profiles](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SensorWindow.xaml.cs): `sensorX/Views/SensorWindow.xaml.cs`
- [Sensor collection](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/SensorStore.cs): `sensorX/Models/SensorStore.cs`
- [Sensor record](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/Sensor.cs): `sensorX/Models/Sensor.cs`
- [Attachments view](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SensorAttachmentsWindow.xaml.cs): `sensorX/Views/SensorAttachmentsWindow.xaml.cs`
- [Attachment storage](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/AttachmentStorageService.cs): `sensorX/Services/AttachmentStorageService.cs`
- [Attachment metadata](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/SensorAttachment.cs): `sensorX/Models/SensorAttachment.cs`
- [Telemetry view](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/TelemetryWindow.xaml.cs): `sensorX/Views/TelemetryWindow.xaml.cs`
- [Dashboard](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/SensorDashBoard.xaml.cs): `sensorX/Views/SensorDashBoard.xaml.cs`

### Motion scanning

- [Motion scanner](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Views/MotionScannerWindow.xaml.cs): `sensorX/Views/MotionScannerWindow.xaml.cs`
- [Motion points](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/MotionPoint.cs): `sensorX/Models/MotionPoint.cs`
- [Motion hierarchy](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Models/MotionNode.cs): `sensorX/Models/MotionNode.cs`
- [Path analysis](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/MotionPathAnalyzer.cs): `sensorX/Services/MotionPathAnalyzer.cs`
- [Hierarchy validation](https://github.com/zukewandile/st10448895-smartsensor/blob/main/sensorX/Services/MotionHierarchyValidator.cs): `sensorX/Services/MotionHierarchyValidator.cs`

### Status API

- [Status endpoints](https://github.com/zukewandile/st10448895-smartsensor/blob/main/API-X/Program.cs): `API-X/Program.cs`

### Other components

- **User**
- **Firebase**

## Connections

- User → Sign up: enters details (evidence: `sensorX/Views/SignUpWindow.xaml.cs`)
- Sign up → Firebase auth: creates account (evidence: `sensorX/Views/SignUpWindow.xaml.cs`)
- Firebase auth → Firebase: sends auth requests (evidence: `sensorX/Services/FirebaseAuthService.cs`)
- Sign up → Firebase auth: requests verification (evidence: `sensorX/Views/SignUpWindow.xaml.cs`)
- User → Login: submits credentials (evidence: `sensorX/Views/LoginWindow.xaml.cs`)
- Login → Firebase auth: authenticates (evidence: `sensorX/Views/LoginWindow.xaml.cs`)
- Sign up → Gateway: opens (evidence: `sensorX/Views/SignUpWindow.xaml.cs`)
- Gateway → API client: checks availability (evidence: `sensorX/Views/GatewayWindow.xaml.cs`)
- API client → Status endpoints: requests scanner status (evidence: `sensorX/Services/ApiClient.cs`)
- User → Sensor profiles: manages sensors
- Sensor profiles → Sensor collection: reads and updates (evidence: `sensorX/Views/SensorWindow.xaml.cs`)
- Sensor collection → Sensor record: holds records (evidence: `sensorX/Models/SensorStore.cs`)
- User → Attachments view: manages files
- Attachments view → Attachment storage: saves files (evidence: `sensorX/Views/SensorAttachmentsWindow.xaml.cs`)
- Attachment storage → Attachment metadata: returns metadata (evidence: `sensorX/Services/AttachmentStorageService.cs`)
- User → Motion scanner: starts scan
- Motion scanner → Path analysis: measures path (evidence: `sensorX/Views/MotionScannerWindow.xaml.cs`)
- Motion scanner → Motion points: records points (evidence: `sensorX/Views/MotionScannerWindow.xaml.cs`)
- Motion scanner → Motion hierarchy: builds hierarchy (evidence: `sensorX/Views/MotionScannerWindow.xaml.cs`)
- Motion scanner → Hierarchy validation: validates hierarchy (evidence: `sensorX/Views/MotionScannerWindow.xaml.cs`)
