# ruqaiyasattar/digitalstethoecopeai architecture

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

- Interactive diagram: https://gitdiagram.com/ruqaiyasattar/digitalstethoecopeai
- Repository: https://github.com/ruqaiyasattar/digitalstethoecopeai

## Overview

#### Purpose and Runtime
Mboathoscope is a Flutter digital-stethoscope mobile app for recording, visualizing, playing, sharing, and managing heart/lung audio. The README describes future or intended ML-based abnormality analysis, but no dedicated model, inference, or backend code is present in the tree. Primary runtime target is Android, with Flutter web scaffolding also included.

#### Application Entry and Platform Bootstrap
Flutter starts from `lib/main.dart`, which initializes the app and routes into its screen flow. Android launches the Flutter host activity at `android/app/src/main/kotlin/com/mboalab/community/opensource/outreachy/mboathoscope/MainActivity.kt`, governed by `android/app/src/main/AndroidManifest.xml`. Web packaging is represented by `web/index.html` and `web/manifest.json`.

#### User Navigation and Screen Layer
The UI is organized as a linear onboarding-to-recording experience:
- `lib/screens/StartPage.dart` provides the initial/splash-facing entry.
- `lib/screens/RolePage.dart` implements the boarding/role selection stage.
- `lib/screens/HomePage.dart` is the main recording and recorded-audio workspace.

This screen boundary separates user navigation from reusable recording controls and device-facing services.

#### Recording and Audio Interaction Components
The `lib/buttons/` area contains the main recording workflow UI:
- `lib/buttons/app_body.dart` and `lib/buttons/headerHalf.dart` compose the primary home content.
- `lib/buttons/CustomButton.dart` and `lib/buttons/SaveButton.dart` represent recording and persistence actions.
- `lib/buttons/RecordingList.dart` manages presentation of saved recordings.
- `lib/buttons/WaveformButton.dart` exposes waveform-oriented playback/visualization interaction.

Control flow is user action → recording/playback UI state → permission or storage service → updated recording list. The repository has no separate domain/model layer, so UI components likely own much of this orchestration.

#### Device and Persistence Boundary
Native device access is abstracted into Flutter services:
- `lib/services/permission_management.dart` handles microphone or storage permission flow.
- `lib/services/storage_management.dart` encapsulates local recording storage and retrieval.
- `lib/services/toast_services.dart` centralizes user-visible operation feedback.

These services form the boundary between Dart UI code and platform/file-system capabilities. Audio recordings appear designed for local-device lifecycle management rather than remote upload or server synchronization.

#### Supporting UI and Feedback
Reusable controls and dialogs support the primary workflow:
- `lib/CustomButton.dart` and `lib/buttons/textButton.dart` provide shared interaction elements.
- `lib/Dialogue/alert_dialog_model.dart` supports confirmation/error dialogs, likely for destructive recording actions.
- `assets/images` holds packaged visual assets.

#### Infrastructure and External Services
The application is dependency-managed through `pubspec.yaml` and runs with Flutter 2.5.3+. Android builds use Gradle under `android/app/build.gradle`; no cloud infrastructure, API client, database, authentication provider, or ML model artifact is represented. The only explicit external destination mentioned in product behavior is recording sharing, whose implementation is expected to be dependency/platform mediated rather than a repository-hosted service.

Main entry points: [`lib/buttons/app_body.dart`](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/app_body.dart) (Home content composition), [`lib/buttons/CustomButton.dart`](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/CustomButton.dart) (Recording controls), [`lib/main.dart`](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/main.dart) (Flutter entry), [`lib/buttons/SaveButton.dart`](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/SaveButton.dart) (Save recording)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_platform["Platform Bootstrap"]
  node_flutter_entry["Flutter entry<br/>Dart entrypoint<br/>[main.dart]"]
  node_android_host["Android host activity<br/>Kotlin activity<br/>[MainActivity.kt]"]
  node_android_manifest["Android manifest<br/>Android config"]
  node_web_shell["Web package shell<br/>Web bootstrap<br/>[index.html]"]
  node_web_manifest["Web manifest<br/>Web metadata<br/>[manifest.json]"]
  node_dependencies["Flutter dependencies<br/>Package manifest<br/>[pubspec.yaml]"]
  node_android_build["Android build<br/>Gradle build<br/>[build.gradle]"]
end

subgraph group_ui["Flutter UI Flow"]
  node_start_page["Start page<br/>Flutter screen<br/>[StartPage.dart]"]
  node_role_page["Role selection<br/>Flutter screen<br/>[RolePage.dart]"]
  node_home_page["Home workspace<br/>Flutter screen<br/>[HomePage.dart]"]
  node_assets["Packaged images<br/>UI assets"]
end

subgraph group_workflow["Recording Workflow"]
  node_home_composition["Home content composition<br/>UI composition<br/>[app_body.dart]"]
  node_record_controls["Recording controls<br/>Recording UI<br/>[CustomButton.dart]"]
  node_save_action["Save recording<br/>Persistence UI<br/>[SaveButton.dart]"]
  node_recording_list["Saved recordings list<br/>Recording UI<br/>[RecordingList.dart]"]
  node_waveform_playback["Waveform playback<br/>Audio UI"]
  node_dialogs["Confirmation dialogs<br/>Dialog UI"]
end

subgraph group_services["Device Services"]
  node_permission_service{{"Permission management<br/>Device permission service"}}
  node_storage_service[("Local recording storage<br/>Device storage service")]
  node_toast_service["Operation feedback<br/>Toast service"]
end

node_android_manifest -->|"launches"| node_android_host
node_android_host -->|"hosts"| node_flutter_entry
node_web_shell -->|"bootstraps"| node_flutter_entry
node_web_manifest -.->|"metadata for"| node_web_shell
node_flutter_entry -->|"starts"| node_start_page
node_start_page -->|"continues to"| node_role_page
node_role_page -->|"enters"| node_home_page
node_home_page -->|"composes"| node_home_composition
node_home_composition -->|"includes"| node_record_controls
node_home_composition -->|"includes"| node_save_action
node_home_composition -->|"shows"| node_recording_list
node_home_composition -->|"provides"| node_waveform_playback
node_record_controls -->|"requests access"| node_permission_service
node_record_controls -->|"records via"| node_storage_service
node_save_action -->|"persists"| node_storage_service
node_storage_service -->|"loads recordings"| node_recording_list
node_recording_list -->|"selects audio"| node_waveform_playback
node_record_controls -.->|"reports status"| node_toast_service
node_save_action -.->|"may confirm"| node_dialogs
node_dependencies -.->|"supplies packages"| node_flutter_entry
node_android_build -.->|"builds"| node_android_host
node_assets -.->|"supports UI"| node_home_page

click node_flutter_entry "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/main.dart"
click node_android_host "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/android/app/src/main/kotlin/com/mboalab/community/opensource/outreachy/mboathoscope/MainActivity.kt"
click node_android_manifest "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/android/app/src/main/AndroidManifest.xml"
click node_web_shell "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/web/index.html"
click node_web_manifest "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/web/manifest.json"
click node_start_page "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/screens/StartPage.dart"
click node_role_page "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/screens/RolePage.dart"
click node_home_page "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/screens/HomePage.dart"
click node_home_composition "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/app_body.dart"
click node_record_controls "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/CustomButton.dart"
click node_save_action "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/SaveButton.dart"
click node_recording_list "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/RecordingList.dart"
click node_waveform_playback "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/WaveformButton.dart"
click node_permission_service "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/services/permission_management.dart"
click node_storage_service "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/services/storage_management.dart"
click node_toast_service "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/services/toast_services.dart"
click node_dialogs "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/Dialogue/alert_dialog_model.dart"
click node_dependencies "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/pubspec.yaml"
click node_android_build "https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/android/app/build.gradle"
click node_assets "https://github.com/ruqaiyasattar/digitalstethoecopeai/tree/master/assets/images"

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_flutter_entry,node_android_host,node_android_manifest,node_web_shell,node_web_manifest,node_dependencies,node_android_build toneBlue
class node_start_page,node_role_page,node_home_page,node_assets toneAmber
class node_home_composition,node_record_controls,node_save_action,node_recording_list,node_waveform_playback,node_dialogs toneMint
class node_permission_service,node_storage_service,node_toast_service toneRose
```

## Components

### Platform Bootstrap

- [Flutter entry](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/main.dart): Dart entrypoint · Initializes the app and screen flow. · `lib/main.dart`
- [Android host activity](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/android/app/src/main/kotlin/com/mboalab/community/opensource/outreachy/mboathoscope/MainActivity.kt): Kotlin activity · `android/app/src/main/kotlin/com/mboalab/community/opensource/outreachy/mboathoscope/MainActivity.kt`
- [Android manifest](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/android/app/src/main/AndroidManifest.xml): Android config · `android/app/src/main/AndroidManifest.xml`
- [Web package shell](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/web/index.html): Web bootstrap · `web/index.html`
- [Web manifest](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/web/manifest.json): Web metadata · `web/manifest.json`
- [Flutter dependencies](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/pubspec.yaml): Package manifest · Defines Flutter and platform-mediated capabilities. · `pubspec.yaml`
- [Android build](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/android/app/build.gradle): Gradle build · `android/app/build.gradle`

### Flutter UI Flow

- [Start page](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/screens/StartPage.dart): Flutter screen · `lib/screens/StartPage.dart`
- [Role selection](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/screens/RolePage.dart): Flutter screen · `lib/screens/RolePage.dart`
- [Home workspace](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/screens/HomePage.dart): Flutter screen · Main recording and saved-audio workspace. · `lib/screens/HomePage.dart`
- [Packaged images](https://github.com/ruqaiyasattar/digitalstethoecopeai/tree/master/assets/images): UI assets · `assets/images`

### Recording Workflow

- [Home content composition](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/app_body.dart): UI composition · `lib/buttons/app_body.dart`
- [Recording controls](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/CustomButton.dart): Recording UI · `lib/buttons/CustomButton.dart`
- [Save recording](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/SaveButton.dart): Persistence UI · `lib/buttons/SaveButton.dart`
- [Saved recordings list](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/RecordingList.dart): Recording UI · `lib/buttons/RecordingList.dart`
- [Waveform playback](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/buttons/WaveformButton.dart): Audio UI · `lib/buttons/WaveformButton.dart`
- [Confirmation dialogs](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/Dialogue/alert_dialog_model.dart): Dialog UI · `lib/Dialogue/alert_dialog_model.dart`

### Device Services

- [Permission management](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/services/permission_management.dart): Device permission service · Handles microphone or storage permission flow. · `lib/services/permission_management.dart`
- [Local recording storage](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/services/storage_management.dart): Device storage service · Stores and retrieves recordings on-device. · `lib/services/storage_management.dart`
- [Operation feedback](https://github.com/ruqaiyasattar/digitalstethoecopeai/blob/master/lib/services/toast_services.dart): Toast service · `lib/services/toast_services.dart`

## Connections

- Android manifest → Android host activity: launches
- Android host activity → Flutter entry: hosts
- Web package shell → Flutter entry: bootstraps
- Web manifest → Web package shell: metadata for
- Flutter entry → Start page: starts
- Start page → Role selection: continues to
- Role selection → Home workspace: enters
- Home workspace → Home content composition: composes
- Home content composition → Recording controls: includes
- Home content composition → Save recording: includes
- Home content composition → Saved recordings list: shows
- Home content composition → Waveform playback: provides
- Recording controls → Permission management: requests access
- Recording controls → Local recording storage: records via
- Save recording → Local recording storage: persists
- Local recording storage → Saved recordings list: loads recordings
- Saved recordings list → Waveform playback: selects audio
- Recording controls → Operation feedback: reports status
- Save recording → Confirmation dialogs: may confirm
- Flutter dependencies → Flutter entry: supplies packages
- Android build → Android host activity: builds
- Packaged images → Home workspace: supports UI
