# devmj007/healthmind architecture

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

- Interactive diagram: https://gitdiagram.com/devmj007/healthmind
- Repository: https://github.com/devmj007/healthmind

## Overview

HealthMind AI is presented as an Android app, but the README provides setup instructions rather than a product or runtime walkthrough. The tree suggests health tracking, AI insights, authentication, syncing, and SOS features; those are represented as subsystem components, not asserted as a verified user journey. Source excerpts cover only build configuration, so runtime connections below are dashed and unverified.

Main entry points: [`app/src/main/java/com/example/MainActivity.kt`](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/MainActivity.kt) (App entry), [`app/src/main/java/com/example/ui/HealthMindViewModel.kt`](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/HealthMindViewModel.kt) (Health view model), [`app/src/main/java/com/example/data/repository/HealthRepository.kt`](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/repository/HealthRepository.kt) (Health repository), [`app/src/main/java/com/example/healthconnect/HealthConnectBridge.kt`](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/HealthConnectBridge.kt) (Health Connect)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android app"]
  node_activity["App entry<br/>[MainActivity.kt]"]
  node_application["Application setup"]
  node_healthvm["Health view model"]
  node_authvm["Auth view model<br/>[AuthViewModel.kt]"]
end

subgraph group_health["Health data"]
  node_healthrepo["Health repository"]
  node_database[("Local database<br/>[AppDatabase.kt]")]
  node_entities["Health records<br/>[Entities.kt]"]
  node_models["Health models<br/>[HealthModels.kt]"]
  node_healthconnect["Health Connect"]
  node_syncresult["Sync result"]
  node_sensor["Step sensor"]
  node_settings["User settings"]
end

subgraph group_intelligence["Intelligence and SOS"]
  node_ai["Health intelligence"]
  node_sosmanager["SOS manager<br/>[SosManager.kt]"]
  node_sosservice["SOS location service"]
end

subgraph group_identity["Identity and sync"]
  node_auth["Authentication<br/>[AuthManager.kt]"]
  node_firestore["Cloud sync"]
end

subgraph group_interface["User interface"]
  node_screens["Health and insights"]
  node_authscreens["Sign-in screens<br/>[AuthScreen.kt]"]
  node_sosscreen["Emergency screen"]
  node_onboarding["Permission onboarding"]
  node_healthonboarding["Health onboarding"]
end

node_user(("User"))
node_gemini{{"Gemini service"}}
node_firebase{{"Firebase services"}}
node_healthplatform{{"Health Connect platform"}}
node_android{{"Android device"}}

node_user -.->|"opens"| node_activity
node_activity -.->|"shows"| node_screens
node_activity -.->|"shows"| node_authscreens
node_activity -.->|"shows"| node_sosscreen
node_activity -.->|"shows"| node_onboarding
node_activity -.->|"shows"| node_healthonboarding
node_screens -.->|"uses"| node_healthvm
node_healthvm -.->|"uses"| node_healthrepo
node_healthrepo -.->|"stores"| node_database
node_healthrepo -.->|"uses"| node_entities
node_healthrepo -.->|"uses"| node_models
node_healthrepo -.->|"syncs"| node_healthconnect
node_healthconnect -.->|"returns"| node_syncresult
node_healthconnect -.->|"reads"| node_healthplatform
node_sensor -.->|"reads"| node_android
node_healthonboarding -.->|"configures"| node_healthconnect
node_onboarding -.->|"requests permissions"| node_android
node_healthvm -.->|"uses"| node_settings
node_healthvm -.->|"requests analysis"| node_ai
node_ai -.->|"queries"| node_gemini
node_authscreens -.->|"uses"| node_authvm
node_authvm -.->|"authenticates"| node_auth
node_auth -.->|"uses"| node_firebase
node_healthvm -.->|"syncs"| node_firestore
node_firestore -.->|"connects"| node_firebase
node_sosscreen -.->|"uses"| node_sosmanager
node_sosmanager -.->|"starts"| node_sosservice
node_sosservice -.->|"gets location"| node_android

click node_activity "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/MainActivity.kt"
click node_application "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/HealthMindApplication.kt"
click node_healthvm "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/HealthMindViewModel.kt"
click node_authvm "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/AuthViewModel.kt"
click node_healthrepo "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/repository/HealthRepository.kt"
click node_database "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/local/AppDatabase.kt"
click node_entities "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/local/Entities.kt"
click node_models "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/domain/model/HealthModels.kt"
click node_healthconnect "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/HealthConnectBridge.kt"
click node_syncresult "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/HealthSyncResult.kt"
click node_sensor "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/StepCounterSensorBridge.kt"
click node_settings "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/settings/SettingsRepository.kt"
click node_ai "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ai/HealthIntelligenceEngine.kt"
click node_sosmanager "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/sos/SosManager.kt"
click node_sosservice "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/sos/SosLocationService.kt"
click node_auth "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/auth/AuthManager.kt"
click node_firestore "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/firebase/FirestoreSyncManager.kt"
click node_screens "https://github.com/devmj007/healthmind/tree/master/app/src/main/java/com/example/ui/screens"
click node_authscreens "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/AuthScreen.kt"
click node_sosscreen "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/EmergencySosScreen.kt"
click node_onboarding "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/PermissionOnboardingScreens.kt"
click node_healthonboarding "https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/HealthConnectOnboardingScreen.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_activity,node_application,node_healthvm,node_authvm,node_user toneBlue
class node_healthrepo,node_database,node_entities,node_models,node_healthconnect,node_syncresult,node_sensor,node_settings toneAmber
class node_ai,node_sosmanager,node_sosservice toneMint
class node_auth,node_firestore toneRose
class node_screens,node_authscreens,node_sosscreen,node_onboarding,node_healthonboarding,node_gemini,node_firebase,node_healthplatform,node_android toneIndigo
```

## Components

### Android app

- [App entry](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/MainActivity.kt): `app/src/main/java/com/example/MainActivity.kt`
- [Application setup](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/HealthMindApplication.kt): `app/src/main/java/com/example/HealthMindApplication.kt`
- [Health view model](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/HealthMindViewModel.kt): `app/src/main/java/com/example/ui/HealthMindViewModel.kt`
- [Auth view model](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/AuthViewModel.kt): `app/src/main/java/com/example/ui/AuthViewModel.kt`

### Health data

- [Health repository](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/repository/HealthRepository.kt): `app/src/main/java/com/example/data/repository/HealthRepository.kt`
- [Local database](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/local/AppDatabase.kt): `app/src/main/java/com/example/data/local/AppDatabase.kt`
- [Health records](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/local/Entities.kt): `app/src/main/java/com/example/data/local/Entities.kt`
- [Health models](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/domain/model/HealthModels.kt): `app/src/main/java/com/example/domain/model/HealthModels.kt`
- [Health Connect](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/HealthConnectBridge.kt): `app/src/main/java/com/example/healthconnect/HealthConnectBridge.kt`
- [Sync result](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/HealthSyncResult.kt): `app/src/main/java/com/example/healthconnect/HealthSyncResult.kt`
- [Step sensor](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/healthconnect/StepCounterSensorBridge.kt): `app/src/main/java/com/example/healthconnect/StepCounterSensorBridge.kt`
- [User settings](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/data/settings/SettingsRepository.kt): `app/src/main/java/com/example/data/settings/SettingsRepository.kt`

### Intelligence and SOS

- [Health intelligence](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ai/HealthIntelligenceEngine.kt): `app/src/main/java/com/example/ai/HealthIntelligenceEngine.kt`
- [SOS manager](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/sos/SosManager.kt): `app/src/main/java/com/example/sos/SosManager.kt`
- [SOS location service](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/sos/SosLocationService.kt): `app/src/main/java/com/example/sos/SosLocationService.kt`

### Identity and sync

- [Authentication](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/auth/AuthManager.kt): `app/src/main/java/com/example/auth/AuthManager.kt`
- [Cloud sync](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/firebase/FirestoreSyncManager.kt): `app/src/main/java/com/example/firebase/FirestoreSyncManager.kt`

### User interface

- [Health and insights](https://github.com/devmj007/healthmind/tree/master/app/src/main/java/com/example/ui/screens): `app/src/main/java/com/example/ui/screens`
- [Sign-in screens](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/AuthScreen.kt): `app/src/main/java/com/example/ui/screens/AuthScreen.kt`
- [Emergency screen](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/EmergencySosScreen.kt): `app/src/main/java/com/example/ui/screens/EmergencySosScreen.kt`
- [Permission onboarding](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/PermissionOnboardingScreens.kt): `app/src/main/java/com/example/ui/screens/PermissionOnboardingScreens.kt`
- [Health onboarding](https://github.com/devmj007/healthmind/blob/master/app/src/main/java/com/example/ui/screens/HealthConnectOnboardingScreen.kt): `app/src/main/java/com/example/ui/screens/HealthConnectOnboardingScreen.kt`

### Other components

- **User**
- **Gemini service**
- **Firebase services**
- **Health Connect platform**
- **Android device**

## Connections

- User → App entry: opens
- App entry → Health and insights: shows
- App entry → Sign-in screens: shows
- App entry → Emergency screen: shows
- App entry → Permission onboarding: shows
- App entry → Health onboarding: shows
- Health and insights → Health view model: uses
- Health view model → Health repository: uses
- Health repository → Local database: stores
- Health repository → Health records: uses
- Health repository → Health models: uses
- Health repository → Health Connect: syncs
- Health Connect → Sync result: returns
- Health Connect → Health Connect platform: reads
- Step sensor → Android device: reads
- Health onboarding → Health Connect: configures
- Permission onboarding → Android device: requests permissions
- Health view model → User settings: uses
- Health view model → Health intelligence: requests analysis
- Health intelligence → Gemini service: queries
- Sign-in screens → Auth view model: uses
- Auth view model → Authentication: authenticates
- Authentication → Firebase services: uses
- Health view model → Cloud sync: syncs
- Cloud sync → Firebase services: connects
- Emergency screen → SOS manager: uses
- SOS manager → SOS location service: starts
- SOS location service → Android device: gets location
