# goodee-aim/cnc-wearpoint-frontend architecture

> Architecture diagram of the GitHub repository goodee-aim/cnc-wearpoint-frontend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/goodee-aim/cnc-wearpoint-frontend
- Repository: https://github.com/goodee-aim/cnc-wearpoint-frontend

## Overview

AIM is a React dashboard for replaying MATWI tool images and sensor data, displaying server-mediated AI wear predictions, and managing alerts. The main workflow is browser → dashboard state and shared-monitoring polling → backend-provided playback, measurements and sensor data → dashboard visualization; Set test uploads image/CSV files for inference through the backend. Alert history and acknowledgement form a separate branch. Edges are limited to relationships shown in excerpts, the source index, or README; unsampled implementation details are not asserted.

Main entry points: [`src/hooks/useDashboard.js`](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useDashboard.js) (Dashboard state), [`src/App.jsx`](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/App.jsx) (App composition), [`src/hooks/useSharedMonitoring.js`](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useSharedMonitoring.js) (Shared playback state), [`src/aim-ui/components/AimUI.jsx`](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/AimUI.jsx) (Screen routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_app["App composition<br/>[App.jsx]"]
  node_ui["Screen routing<br/>[AimUI.jsx]"]
  node_shared_components["Shared display components<br/>[shared.jsx]"]
  node_i18n["Korean and English<br/>[index.js]"]
end

subgraph group_monitoring["Shared Monitoring"]
  node_dashboard["Monitoring view<br/>[DashboardPage.jsx]"]
  node_dashboard_state["Dashboard state<br/>[useDashboard.js]"]
  node_shared_state["Shared playback state"]
  node_sensor_charts["Sensor charts<br/>[SensorCharts.jsx]"]
end

subgraph group_manual["Set Test"]
  node_manual_page["Upload and replay"]
  node_manual_controls["File and replay controls"]
  node_manual_icon["Manual control icon"]
end

subgraph group_alerts["Alerts"]
  node_alerts_page["Alert history<br/>[AlertsPage.jsx]"]
  node_alerts_state["Alert data and acknowledgement<br/>[useAlerts.js]"]
  node_alert_history["Alert history requests<br/>[alertHistory.js]"]
  node_alert_preview["Historical alert preview<br/>[alertPreview.js]"]
end

subgraph group_domain["Data and Presentation"]
  node_adapters["UI data adapters<br/>[adapters.js]"]
  node_sensor_cache["Sensor parsing and cache<br/>[csv.js]"]
  node_cutting_markers["Cutting markers"]
  node_monitoring_projection["Playback projection"]
  node_wear_rules["Wear status rules<br/>[wear.js]"]
  node_wear_advice["Wear guidance<br/>[wearAdvice.js]"]
  node_set_names["Set display names<br/>[setDisplay.js]"]
  node_playback_rate["Playback rate rules<br/>[playbackRate.js]"]
  node_config["Sets and thresholds<br/>[dashboardConfig.js]"]
end

node_operator(("Dashboard user"))
node_backend{{"FastAPI backend"}}
node_serving{{"AI model serving"}}

node_operator -->|"uses dashboard"| node_app
node_app -->|"loads state hook"| node_dashboard_state
node_app -->|"renders interface"| node_ui
node_ui -->|"routes monitoring"| node_dashboard
node_ui -->|"routes Set test"| node_manual_page
node_ui -->|"routes alerts"| node_alerts_page
node_dashboard_state -->|"uses playback hook"| node_shared_state
node_dashboard_state -->|"uses alert hook"| node_alerts_state
node_shared_state -->|"polls playback and inference"| node_backend
node_dashboard_state -->|"loads images and measurements"| node_backend
node_shared_state -->|"projects server state"| node_monitoring_projection
node_monitoring_projection -->|"applies playback rate"| node_playback_rate
node_shared_state -->|"parses sensor data"| node_sensor_cache
node_shared_state -->|"loads cut markers"| node_cutting_markers
node_dashboard -->|"renders waveforms"| node_sensor_charts
node_dashboard -->|"renders dashboard cards"| node_shared_components
node_app -->|"converts display data"| node_adapters
node_adapters -->|"uses waveform markers"| node_cutting_markers
node_manual_page -->|"uploads and requests inference"| node_backend
node_backend -.->|"requests inference"| node_serving
node_manual_page -->|"uses file picker"| node_manual_controls
node_manual_controls -->|"renders control icon"| node_manual_icon
node_alerts_page -->|"displays alert history"| node_alerts_state
node_alerts_state -->|"loads shared history"| node_alert_history
node_alert_history -->|"reads and acknowledges alerts"| node_backend
node_app -->|"applies historical preview"| node_alert_preview
node_shared_components -->|"shows wear guidance"| node_wear_advice
node_shared_components -->|"formats Set names"| node_set_names
node_alerts_state -->|"classifies wear levels"| node_wear_rules
node_dashboard_state -->|"parses imported tables"| node_sensor_cache
node_dashboard_state -->|"uses API and Set config"| node_config
node_i18n -->|"provides translated UI"| node_operator

click node_app "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/App.jsx"
click node_ui "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/AimUI.jsx"
click node_dashboard "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/pages/DashboardPage.jsx"
click node_dashboard_state "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useDashboard.js"
click node_shared_state "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useSharedMonitoring.js"
click node_manual_page "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/pages/ManualInputPage.jsx"
click node_manual_controls "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/ManualFilePicker.jsx"
click node_manual_icon "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/ManualControlIcon.jsx"
click node_alerts_page "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/pages/AlertsPage.jsx"
click node_alerts_state "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useAlerts.js"
click node_alert_history "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/alertHistory.js"
click node_alert_preview "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/alertPreview.js"
click node_sensor_charts "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/SensorCharts.jsx"
click node_shared_components "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/shared.jsx"
click node_adapters "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/adapters.js"
click node_sensor_cache "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/csv.js"
click node_cutting_markers "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/cuttingSegmentMarkers.js"
click node_monitoring_projection "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/sharedMonitoring.js"
click node_wear_rules "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/wear.js"
click node_wear_advice "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/wearAdvice.js"
click node_set_names "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/setDisplay.js"
click node_playback_rate "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/playbackRate.js"
click node_config "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/dashboardConfig.js"
click node_i18n "https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/i18n/index.js"

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_app,node_ui,node_shared_components,node_i18n,node_operator toneBlue
class node_dashboard,node_dashboard_state,node_shared_state,node_sensor_charts toneAmber
class node_manual_page,node_manual_controls,node_manual_icon,node_backend toneMint
class node_alerts_page,node_alerts_state,node_alert_history,node_alert_preview toneRose
class node_adapters,node_sensor_cache,node_cutting_markers,node_monitoring_projection,node_wear_rules,node_wear_advice,node_set_names,node_playback_rate,node_config,node_serving toneIndigo
```

## Components

### Application UI

- [App composition](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/App.jsx): `src/App.jsx`
- [Screen routing](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/AimUI.jsx): `src/aim-ui/components/AimUI.jsx`
- [Shared display components](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/shared.jsx): `src/aim-ui/components/shared.jsx`
- [Korean and English](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/i18n/index.js): `src/i18n/index.js`

### Shared Monitoring

- [Monitoring view](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/pages/DashboardPage.jsx): `src/aim-ui/pages/DashboardPage.jsx`
- [Dashboard state](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useDashboard.js): `src/hooks/useDashboard.js`
- [Shared playback state](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useSharedMonitoring.js): `src/hooks/useSharedMonitoring.js`
- [Sensor charts](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/SensorCharts.jsx): `src/aim-ui/components/SensorCharts.jsx`

### Set Test

- [Upload and replay](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/pages/ManualInputPage.jsx): `src/aim-ui/pages/ManualInputPage.jsx`
- [File and replay controls](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/ManualFilePicker.jsx): `src/aim-ui/components/ManualFilePicker.jsx`
- [Manual control icon](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/components/ManualControlIcon.jsx): `src/aim-ui/components/ManualControlIcon.jsx`

### Alerts

- [Alert history](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/pages/AlertsPage.jsx): `src/aim-ui/pages/AlertsPage.jsx`
- [Alert data and acknowledgement](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/hooks/useAlerts.js): `src/hooks/useAlerts.js`
- [Alert history requests](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/alertHistory.js): `src/utils/alertHistory.js`
- [Historical alert preview](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/alertPreview.js): `src/utils/alertPreview.js`

### Data and Presentation

- [UI data adapters](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/aim-ui/adapters.js): `src/aim-ui/adapters.js`
- [Sensor parsing and cache](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/csv.js): `src/utils/csv.js`
- [Cutting markers](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/cuttingSegmentMarkers.js): `src/utils/cuttingSegmentMarkers.js`
- [Playback projection](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/sharedMonitoring.js): `src/utils/sharedMonitoring.js`
- [Wear status rules](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/wear.js): `src/utils/wear.js`
- [Wear guidance](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/wearAdvice.js): `src/utils/wearAdvice.js`
- [Set display names](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/setDisplay.js): `src/utils/setDisplay.js`
- [Playback rate rules](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/utils/playbackRate.js): `src/utils/playbackRate.js`
- [Sets and thresholds](https://github.com/goodee-aim/cnc-wearpoint-frontend/blob/main/src/dashboardConfig.js): `src/dashboardConfig.js`

### Other components

- **Dashboard user**
- **FastAPI backend**
- **AI model serving**

## Connections

- Dashboard user → App composition: uses dashboard (evidence: `README.md`)
- App composition → Dashboard state: loads state hook (evidence: `src/App.jsx`)
- App composition → Screen routing: renders interface (evidence: `src/App.jsx`)
- Screen routing → Monitoring view: routes monitoring (evidence: `src/aim-ui/components/AimUI.jsx`)
- Screen routing → Upload and replay: routes Set test (evidence: `src/aim-ui/components/AimUI.jsx`)
- Screen routing → Alert history: routes alerts (evidence: `src/aim-ui/components/AimUI.jsx`)
- Dashboard state → Shared playback state: uses playback hook (evidence: `src/hooks/useDashboard.js`)
- Dashboard state → Alert data and acknowledgement: uses alert hook (evidence: `src/hooks/useDashboard.js`)
- Shared playback state → FastAPI backend: polls playback and inference (evidence: `src/hooks/useSharedMonitoring.js`)
- Dashboard state → FastAPI backend: loads images and measurements
- Shared playback state → Playback projection: projects server state (evidence: `src/hooks/useSharedMonitoring.js`)
- Playback projection → Playback rate rules: applies playback rate (evidence: `src/utils/sharedMonitoring.js`)
- Shared playback state → Sensor parsing and cache: parses sensor data (evidence: `src/hooks/useSharedMonitoring.js`)
- Shared playback state → Cutting markers: loads cut markers (evidence: `src/hooks/useSharedMonitoring.js`)
- Monitoring view → Sensor charts: renders waveforms (evidence: `src/aim-ui/pages/DashboardPage.jsx`)
- Monitoring view → Shared display components: renders dashboard cards (evidence: `src/aim-ui/pages/DashboardPage.jsx`)
- App composition → UI data adapters: converts display data (evidence: `src/App.jsx`)
- UI data adapters → Cutting markers: uses waveform markers (evidence: `src/aim-ui/adapters.js`)
- Upload and replay → FastAPI backend: uploads and requests inference (evidence: `src/aim-ui/pages/ManualInputPage.jsx`)
- FastAPI backend → AI model serving: requests inference (evidence: `README.md`)
- Upload and replay → File and replay controls: uses file picker (evidence: `src/aim-ui/pages/ManualInputPage.jsx`)
- File and replay controls → Manual control icon: renders control icon (evidence: `src/aim-ui/components/ManualFilePicker.jsx`)
- Alert history → Alert data and acknowledgement: displays alert history (evidence: `src/aim-ui/pages/AlertsPage.jsx`)
- Alert data and acknowledgement → Alert history requests: loads shared history (evidence: `src/hooks/useAlerts.js`)
- Alert history requests → FastAPI backend: reads and acknowledges alerts
- App composition → Historical alert preview: applies historical preview (evidence: `src/App.jsx`)
- Shared display components → Wear guidance: shows wear guidance (evidence: `src/aim-ui/components/shared.jsx`)
- Shared display components → Set display names: formats Set names (evidence: `src/aim-ui/components/shared.jsx`)
- Alert data and acknowledgement → Wear status rules: classifies wear levels (evidence: `src/hooks/useAlerts.js`)
- Dashboard state → Sensor parsing and cache: parses imported tables (evidence: `src/hooks/useDashboard.js`)
- Dashboard state → Sets and thresholds: uses API and Set config (evidence: `src/hooks/useDashboard.js`)
- Korean and English → Dashboard user: provides translated UI (evidence: `src/i18n/index.js`)
