# yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai architecture

> Architecture diagram of the GitHub repository yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai
- Repository: https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai

## Overview

1. **Project shape**
   - RhythmAI is a single Android app module built with Kotlin, Jetpack Compose, and TensorFlow Lite.
   - There is no backend or cloud service in this repo; the core architecture is fully on-device.

2. **App shell**
   - `MainActivity` is the entry point and hosts the Compose navigation shell.
   - `AppNavGraph` and `BottomBar` define a three-tab user flow: **Connect**, **Monitor**, and **Stats**.

3. **Primary UI boundaries**
   - The UI is split into feature screens under `presentation/`.
   - Each screen has its own ViewModel and composable widgets, keeping monitoring, connection, and analytics concerns separated.

4. **ECG input source**
   - The app reads ECG data from bundled CSV assets such as `ecg_sample.csv`, `100_ekg.csv`, and `200_ekg.csv`.
   - `EcgAssetLoader` is the ingestion boundary from packaged data into the runtime pipeline; it appears to simulate or replay ECG streams rather than consume a live sensor in the current repo.

5. **Real-time monitoring pipeline**
   - `MonitorViewModel` is the orchestration layer for ECG processing.
   - It maintains the live signal window, heart-rate calculation, signal-quality status, and current prediction state that drive the monitor screen.

6. **On-device ML inference**
   - `EcgTFLiteClassifier` is the inference boundary around the bundled TFLite models.
   - The app ships multiple models in `app/src/main/assets/`: `sqi_model.tflite`, `stage1_model.tflite`, `stage2_model.tflite`, plus `ecg_multiclass_compat.tflite` for compatibility or alternative classification.
   - The intended inference flow is: **SQI quality check → Stage 1 abnormal/normal screening → Stage 2 arrhythmia type classification**.

7. **Monitor screen composition**
   - `MonitorScreen` combines live waveform rendering, signal-quality feedback, and prediction output.
   - Reusable UI pieces like `EcgWaveform`, `SignalQualityCard`, and `PredictionCard` visualize the current stream state and model result.

8. **Alert and safety behavior**
   - The README describes alerting based on consecutive abnormal detections, quality gating, vibration, and SOS access.
   - In architecture terms, this is an application-layer response driven by ViewModel state and Android platform actions rather than a separate service.

9. **Stats and event history**
   - `StatsViewModel` and the stats composables present arrhythmia event history and detailed prediction information.
   - `ArrhythmiaEventCard`, `ArrhythmiaEventItem`, and `DetailedPredictionView` suggest the stats screen is an analytics/readout layer over logged detection events, likely maintained locally in app state.

10. **Connect flow**
   - `ConnectScreen` and `ConnectViewModel` represent the device-connection boundary.
   - Based on the current file set, this looks like the UI and state layer for selecting or pairing a source device, but the actual Bluetooth/sensor integration is not shown in this repo.

11. **Architecture style**
   - The repo follows a clean feature split: **data/inference**, **presentation/state**, **navigation**, and **UI components**.
   - There is no visible persistence layer such as Room, network client, or repository abstraction; the app is centered on streaming ECG data into local inference and rendering the results immediately.

12. **Supporting structure**
   - `ui/theme` contains the Compose theme system, and `res/` holds the Android resources and manifest configuration.
   - Tests exist in `androidTest` and `test`, but they are peripheral to the runtime architecture.

13. **ML deployment boundary**
   - The model-training workflow is described in `README.md` and `ML_implementation.md`, but the Android app itself only consumes exported TFLite artifacts.
   - That makes the repo’s runtime boundary clear: training happens offline, inference happens inside the app, and all predictions remain on device.

Main entry points: [`app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModel.kt`](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModel.kt) (MonitorViewModel), [`app/src/main/java/com/example/rhythmai/navigation/AppNavGraph.kt`](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/AppNavGraph.kt) (AppNavGraph), [`app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorScreen.kt`](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorScreen.kt) (MonitorScreen), [`app/src/main/java/com/example/rhythmai/presentation/stats/StatsScreen.kt`](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/StatsScreen.kt) (StatsScreen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app_shell["App shell"]
  node_main_activity["MainActivity<br/>android entry<br/>[MainActivity.kt]"]
  node_app_nav_graph["AppNavGraph<br/>nav graph<br/>[AppNavGraph.kt]"]
  node_bottom_bar["BottomBar<br/>navigation ui<br/>[BottomBar.kt]"]
  node_bottom_nav_item["BottomNavItem<br/>nav model<br/>[BottomNavItem.kt]"]
end

subgraph group_ecg_pipeline["ECG pipeline"]
  node_ecg_asset_loader["EcgAssetLoader<br/>data ingress<br/>[EcgAssetLoader.kt]"]
  node_ecg_classifier["EcgTFLiteClassifier<br/>tflite inference"]
end

subgraph group_presentation["Presentation"]
end

subgraph group_monitoring["Monitoring"]
  node_monitor_screen["MonitorScreen<br/>[MonitorScreen.kt]"]
  node_monitor_vm["MonitorViewModel<br/>orchestrator"]
  node_monitor_vm_factory["MonitorViewModelFactory<br/>vm factory"]
  node_ecg_waveform["EcgWaveform<br/>widget<br/>[EcgWaveform.kt]"]
  node_signal_quality_card["SignalQualityCard<br/>widget"]
  node_prediction_card["PredictionCard<br/>widget<br/>[PredictionCard.kt]"]
end

subgraph group_stats["Stats"]
  node_stats_screen["StatsScreen<br/>[StatsScreen.kt]"]
  node_stats_vm["StatsViewModel<br/>state holder<br/>[StatsViewModel.kt]"]
  node_event_card["ArrhythmiaEventCard<br/>widget"]
  node_event_item["ArrhythmiaEventItem<br/>widget"]
  node_detailed_prediction["DetailedPredictionView<br/>widget"]
end

subgraph group_connect["Connect"]
  node_connect_screen["ConnectScreen<br/>[ConnectScreen.kt]"]
  node_connect_vm["ConnectViewModel<br/>state holder"]
end

subgraph group_theme["Theme"]
  node_app_theme["Theme<br/>[Theme.kt]"]
  node_color_palette["Color<br/>theme tokens<br/>[Color.kt]"]
  node_type_scale["Type<br/>theme tokens<br/>[Type.kt]"]
end

node_main_activity -->|"hosts"| node_app_nav_graph
node_app_nav_graph -->|"uses"| node_bottom_bar
node_bottom_bar -->|"reads"| node_bottom_nav_item
node_app_nav_graph -->|"routes"| node_connect_screen
node_app_nav_graph -->|"routes"| node_monitor_screen
node_app_nav_graph -->|"routes"| node_stats_screen
node_connect_screen -->|"binds"| node_connect_vm
node_monitor_screen -->|"binds"| node_monitor_vm
node_monitor_vm -->|"created by"| node_monitor_vm_factory
node_monitor_vm -->|"ingests"| node_ecg_asset_loader
node_monitor_vm -->|"infers"| node_ecg_classifier
node_monitor_screen -->|"renders"| node_ecg_waveform
node_monitor_screen -->|"renders"| node_signal_quality_card
node_monitor_screen -->|"renders"| node_prediction_card
node_stats_screen -->|"binds"| node_stats_vm
node_stats_screen -->|"renders"| node_event_card
node_stats_screen -->|"renders"| node_event_item
node_stats_screen -->|"renders"| node_detailed_prediction
node_main_activity -->|"wraps"| node_app_theme
node_app_theme -->|"uses"| node_color_palette
node_app_theme -->|"uses"| node_type_scale
node_monitor_vm -->|"drives"| node_prediction_card
node_monitor_vm -->|"drives"| node_signal_quality_card
node_monitor_vm -->|"drives"| node_ecg_waveform

click node_main_activity "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/MainActivity.kt"
click node_app_nav_graph "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/AppNavGraph.kt"
click node_bottom_bar "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/BottomBar.kt"
click node_bottom_nav_item "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/BottomNavItem.kt"
click node_ecg_asset_loader "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/data/EcgAssetLoader.kt"
click node_ecg_classifier "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/data/EcgTFLiteClassifier.kt"
click node_connect_screen "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/connect/ConnectScreen.kt"
click node_connect_vm "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/connect/ConnectViewModel.kt"
click node_monitor_screen "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorScreen.kt"
click node_monitor_vm "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModel.kt"
click node_monitor_vm_factory "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModelFactory.kt"
click node_ecg_waveform "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/EcgWaveform.kt"
click node_signal_quality_card "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/SignalQualityCard.kt"
click node_prediction_card "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/PredictionCard.kt"
click node_stats_screen "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/StatsScreen.kt"
click node_stats_vm "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/StatsViewModel.kt"
click node_event_card "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/ArrhythmiaEventCard.kt"
click node_event_item "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/ArrhythmiaEventItem.kt"
click node_detailed_prediction "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/DetailedPredictionView.kt"
click node_app_theme "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/ui/theme/Theme.kt"
click node_color_palette "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/ui/theme/Color.kt"
click node_type_scale "https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/ui/theme/Type.kt"

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_main_activity,node_app_nav_graph,node_bottom_bar,node_bottom_nav_item,node_app_theme,node_color_palette,node_type_scale toneBlue
class node_ecg_asset_loader,node_ecg_classifier toneAmber
class node_monitor_screen,node_monitor_vm,node_monitor_vm_factory,node_ecg_waveform,node_signal_quality_card,node_prediction_card toneRose
class node_stats_screen,node_stats_vm,node_event_card,node_event_item,node_detailed_prediction toneIndigo
class node_connect_screen,node_connect_vm toneTeal
```

## Components

### App shell

Activity entry point and navigation scaffolding.

- [MainActivity](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/MainActivity.kt): android entry · App entry point that hosts the Compose UI shell. · `app/src/main/java/com/example/rhythmai/MainActivity.kt`
- [AppNavGraph](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/AppNavGraph.kt): nav graph · Defines the top-level Compose navigation flow. · `app/src/main/java/com/example/rhythmai/navigation/AppNavGraph.kt`
- [BottomBar](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/BottomBar.kt): navigation ui · Bottom navigation for the three main tabs. · `app/src/main/java/com/example/rhythmai/navigation/BottomBar.kt`
- [BottomNavItem](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/navigation/BottomNavItem.kt): nav model · Tab definitions used by the bottom navigation. · `app/src/main/java/com/example/rhythmai/navigation/BottomNavItem.kt`

### ECG pipeline

On-device data ingestion and inference.

- [EcgAssetLoader](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/data/EcgAssetLoader.kt): data ingress · Loads packaged ECG CSV assets into the runtime pipeline. · `app/src/main/java/com/example/rhythmai/data/EcgAssetLoader.kt`
- [EcgTFLiteClassifier](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/data/EcgTFLiteClassifier.kt): tflite inference · Wraps the on-device TensorFlow Lite models for ECG classification. · `app/src/main/java/com/example/rhythmai/data/EcgTFLiteClassifier.kt`

### Monitoring

Live ECG monitoring screen and widgets.

- [MonitorScreen](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorScreen.kt): screen · Composes live waveform, quality, and prediction panels. · `app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorScreen.kt`
- [MonitorViewModel](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModel.kt): orchestrator · Coordinates ECG windowing, heart rate, quality, and prediction state. · `app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModel.kt`
- [MonitorViewModelFactory](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModelFactory.kt): vm factory · Creates the monitor ViewModel with its dependencies. · `app/src/main/java/com/example/rhythmai/presentation/monitor/MonitorViewModelFactory.kt`
- [EcgWaveform](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/EcgWaveform.kt): widget · Renders the live ECG waveform. · `app/src/main/java/com/example/rhythmai/presentation/monitor/EcgWaveform.kt`
- [SignalQualityCard](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/SignalQualityCard.kt): widget · Shows signal quality and gating feedback. · `app/src/main/java/com/example/rhythmai/presentation/monitor/SignalQualityCard.kt`
- [PredictionCard](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/monitor/PredictionCard.kt): widget · Displays the current model prediction and status. · `app/src/main/java/com/example/rhythmai/presentation/monitor/PredictionCard.kt`

### Stats

Event history and prediction readout.

- [StatsScreen](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/StatsScreen.kt): screen · Screen for arrhythmia event history and prediction details. · `app/src/main/java/com/example/rhythmai/presentation/stats/StatsScreen.kt`
- [StatsViewModel](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/StatsViewModel.kt): state holder · Provides stats data and detailed prediction history. · `app/src/main/java/com/example/rhythmai/presentation/stats/StatsViewModel.kt`
- [ArrhythmiaEventCard](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/ArrhythmiaEventCard.kt): widget · Card view for arrhythmia event summaries. · `app/src/main/java/com/example/rhythmai/presentation/stats/ArrhythmiaEventCard.kt`
- [ArrhythmiaEventItem](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/ArrhythmiaEventItem.kt): widget · List item for individual arrhythmia events. · `app/src/main/java/com/example/rhythmai/presentation/stats/ArrhythmiaEventItem.kt`
- [DetailedPredictionView](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/stats/DetailedPredictionView.kt): widget · Expanded view of prediction details and context. · `app/src/main/java/com/example/rhythmai/presentation/stats/DetailedPredictionView.kt`

### Connect

Source/device connection flow.

- [ConnectScreen](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/connect/ConnectScreen.kt): screen · UI for selecting or pairing an ECG source device. · `app/src/main/java/com/example/rhythmai/presentation/connect/ConnectScreen.kt`
- [ConnectViewModel](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/presentation/connect/ConnectViewModel.kt): state holder · Owns connect-screen state and device selection flow. · `app/src/main/java/com/example/rhythmai/presentation/connect/ConnectViewModel.kt`

### Theme

Compose theme system.

- [Theme](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/ui/theme/Theme.kt): compose theme · App-wide Material theme entry point. · `app/src/main/java/com/example/rhythmai/ui/theme/Theme.kt`
- [Color](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/ui/theme/Color.kt): theme tokens · Color definitions for the Compose theme. · `app/src/main/java/com/example/rhythmai/ui/theme/Color.kt`
- [Type](https://github.com/yesshreyes/real-time-ecg-monitoring-and-arrhythmia-detection-using-edge-ai/blob/main/app/src/main/java/com/example/rhythmai/ui/theme/Type.kt): theme tokens · Typography definitions for the Compose theme. · `app/src/main/java/com/example/rhythmai/ui/theme/Type.kt`

## Connections

- MainActivity → AppNavGraph: hosts · Activity launches the Compose navigation shell.
- AppNavGraph → BottomBar: uses · Navigation shell includes the bottom tab bar.
- BottomBar → BottomNavItem: reads · Bottom bar is driven by tab definitions.
- AppNavGraph → ConnectScreen: routes · Navigation exposes the Connect tab.
- AppNavGraph → MonitorScreen: routes · Navigation exposes the Monitor tab.
- AppNavGraph → StatsScreen: routes · Navigation exposes the Stats tab.
- ConnectScreen → ConnectViewModel: binds · Connect UI is state-driven.
- MonitorScreen → MonitorViewModel: binds · Monitor UI is state-driven.
- MonitorViewModel → MonitorViewModelFactory: created by · Factory constructs the monitor ViewModel.
- MonitorViewModel → EcgAssetLoader: ingests · Monitor logic consumes ECG data from packaged assets.
- MonitorViewModel → EcgTFLiteClassifier: infers · Monitor logic runs on-device model inference.
- MonitorScreen → EcgWaveform: renders · Waveform widget visualizes the live stream.
- MonitorScreen → SignalQualityCard: renders · Quality card shows signal gating status.
- MonitorScreen → PredictionCard: renders · Prediction card shows the current classification.
- StatsScreen → StatsViewModel: binds · Stats UI is state-driven.
- StatsScreen → ArrhythmiaEventCard: renders · Stats screen shows event summaries.
- StatsScreen → ArrhythmiaEventItem: renders · Stats screen lists individual events.
- StatsScreen → DetailedPredictionView: renders · Stats screen exposes detailed prediction context.
- MainActivity → Theme: wraps · Root UI is wrapped in the app theme.
- Theme → Color: uses · Theme is built from shared color tokens.
- Theme → Type: uses · Theme is built from shared typography tokens.
- MonitorViewModel → PredictionCard: drives · Prediction state feeds the monitor output card.
- MonitorViewModel → SignalQualityCard: drives · Quality state feeds gating feedback.
- MonitorViewModel → EcgWaveform: drives · Live signal window feeds waveform rendering.
