# myassistantapps/myassistant-flutter architecture

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

- Interactive diagram: https://gitdiagram.com/myassistantapps/myassistant-flutter
- Repository: https://github.com/myassistantapps/myassistant-flutter

## Overview

Hari is a Flutter voice-first assistant client: the user speaks, the app captures audio and sends requests to a backend that owns AI logic, then the client renders streamed responses and speaks them. README capabilities also include document memory, client case files, calls, reminders, settings, and updates. The tree omits several README-described live-screen files, and Dart implementation was not sampled; those paths are represented only by existing enclosing directories, and uncertain wiring is omitted. Android native components are included where sampled.

Main entry points: [`lib/services/voice_service.dart`](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/voice_service.dart) (Voice service), [`lib/core/network/assistant_api.dart`](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/core/network/assistant_api.dart) (Realtime SSE), [`lib/main.dart`](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/main.dart) (App shell), [`android/app/src/main/kotlin/com/myassistant/myassistant/MainActivity.kt`](https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/MainActivity.kt) (Android bridge)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App experience"]
  node_app_entry["App shell<br/>[main.dart]"]
  node_assistant_ui["Assistant UI"]
  node_auth["Authentication<br/>[auth_service.dart]"]
end

subgraph group_voice["Voice and assistant"]
  node_assistant_engine["Assistant engine"]
  node_voice_service["Voice service<br/>[voice_service.dart]"]
  node_assistant_api["Realtime SSE<br/>[assistant_api.dart]"]
  node_api_service["Backend REST<br/>[api_service.dart]"]
end

subgraph group_capabilities["Assistant capabilities"]
  node_documents["Document memory"]
  node_clients["Client case files"]
  node_calls["Calls and notes<br/>[call_service.dart]"]
  node_reminders["Reminders<br/>[reminder.dart]"]
end

subgraph group_platform["Platform services"]
  node_app_lock["Biometric lock<br/>[app_lock.dart]"]
  node_updates["App updates"]
  node_native_control["Android device control<br/>[DeviceControl.kt]"]
  node_native_activity["Android bridge<br/>[MainActivity.kt]"]
  node_task_widget["Quick-task widget"]
  node_apk_installer["APK installer<br/>[ApkInstaller.kt]"]
end

node_user(("User"))
node_backend{{"Assistant backend"}}

node_user -->|"opens app"| node_app_entry
node_app_entry -->|"shows assistant"| node_assistant_ui
node_user -->|"speaks request"| node_voice_service
node_voice_service -->|"streams voice"| node_assistant_api
node_assistant_api -->|"sends SSE"| node_backend
node_backend -->|"streams events"| node_assistant_api
node_voice_service -->|"requests TTS"| node_backend
node_api_service -->|"calls REST"| node_backend
node_user -->|"manages documents"| node_documents
node_user -->|"manages cases"| node_clients
node_user -->|"requests calls"| node_calls
node_user -->|"requests reminders"| node_reminders
node_user -->|"authenticates"| node_auth
node_user -->|"unlocks app"| node_app_lock
node_user -->|"receives updates"| node_updates
node_native_activity -->|"delegates controls"| node_native_control
node_task_widget -->|"opens quick task"| node_native_activity

click node_app_entry "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/main.dart"
click node_assistant_engine "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/features/assistant/state/assistant_engine.dart"
click node_assistant_ui "https://github.com/myassistantapps/myassistant-flutter/tree/main/lib/features/assistant"
click node_voice_service "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/voice_service.dart"
click node_assistant_api "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/core/network/assistant_api.dart"
click node_api_service "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/api_service.dart"
click node_documents "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/screens/documents_screen.dart"
click node_clients "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/screens/clients_screen.dart"
click node_calls "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/call_service.dart"
click node_reminders "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/models/reminder.dart"
click node_auth "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/auth_service.dart"
click node_app_lock "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/app_lock.dart"
click node_updates "https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/app_update_service.dart"
click node_native_control "https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/DeviceControl.kt"
click node_native_activity "https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/MainActivity.kt"
click node_task_widget "https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/TaskWidgetProvider.kt"
click node_apk_installer "https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/ApkInstaller.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_app_entry,node_assistant_ui,node_auth,node_user toneBlue
class node_assistant_engine,node_voice_service,node_assistant_api,node_api_service toneAmber
class node_documents,node_clients,node_calls,node_reminders toneMint
class node_app_lock,node_updates,node_native_control,node_native_activity,node_task_widget,node_apk_installer toneRose
class node_backend toneIndigo
```

## Components

### App experience

- [App shell](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/main.dart): `lib/main.dart`
- [Assistant UI](https://github.com/myassistantapps/myassistant-flutter/tree/main/lib/features/assistant): `lib/features/assistant`
- [Authentication](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`

### Voice and assistant

- [Assistant engine](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/features/assistant/state/assistant_engine.dart): `lib/features/assistant/state/assistant_engine.dart`
- [Voice service](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/voice_service.dart): `lib/services/voice_service.dart`
- [Realtime SSE](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/core/network/assistant_api.dart): `lib/core/network/assistant_api.dart`
- [Backend REST](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/api_service.dart): `lib/services/api_service.dart`

### Assistant capabilities

- [Document memory](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/screens/documents_screen.dart): `lib/screens/documents_screen.dart`
- [Client case files](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/screens/clients_screen.dart): `lib/screens/clients_screen.dart`
- [Calls and notes](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/call_service.dart): `lib/services/call_service.dart`
- [Reminders](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/models/reminder.dart): `lib/models/reminder.dart`

### Platform services

- [Biometric lock](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/app_lock.dart): `lib/services/app_lock.dart`
- [App updates](https://github.com/myassistantapps/myassistant-flutter/blob/main/lib/services/app_update_service.dart): `lib/services/app_update_service.dart`
- [Android device control](https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/DeviceControl.kt): `android/app/src/main/kotlin/com/myassistant/myassistant/DeviceControl.kt`
- [Android bridge](https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/MainActivity.kt): `android/app/src/main/kotlin/com/myassistant/myassistant/MainActivity.kt`
- [Quick-task widget](https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/TaskWidgetProvider.kt): `android/app/src/main/kotlin/com/myassistant/myassistant/TaskWidgetProvider.kt`
- [APK installer](https://github.com/myassistantapps/myassistant-flutter/blob/main/android/app/src/main/kotlin/com/myassistant/myassistant/ApkInstaller.kt): `android/app/src/main/kotlin/com/myassistant/myassistant/ApkInstaller.kt`

### Other components

- **User**
- **Assistant backend**

## Connections

- User → App shell: opens app (evidence: `README.md`)
- App shell → Assistant UI: shows assistant (evidence: `README.md`)
- User → Voice service: speaks request (evidence: `README.md`)
- Voice service → Realtime SSE: streams voice (evidence: `README.md`)
- Realtime SSE → Assistant backend: sends SSE (evidence: `README.md`)
- Assistant backend → Realtime SSE: streams events (evidence: `README.md`)
- Voice service → Assistant backend: requests TTS (evidence: `README.md`)
- Backend REST → Assistant backend: calls REST (evidence: `README.md`)
- User → Document memory: manages documents (evidence: `README.md`)
- User → Client case files: manages cases (evidence: `README.md`)
- User → Calls and notes: requests calls (evidence: `README.md`)
- User → Reminders: requests reminders (evidence: `README.md`)
- User → Authentication: authenticates (evidence: `README.md`)
- User → Biometric lock: unlocks app (evidence: `README.md`)
- User → App updates: receives updates (evidence: `README.md`)
- Android bridge → Android device control: delegates controls (evidence: `android/app/src/main/kotlin/com/myassistant/myassistant/MainActivity.kt`)
- Quick-task widget → Android bridge: opens quick task (evidence: `android/app/src/main/kotlin/com/myassistant/myassistant/TaskWidgetProvider.kt`)
