# maheswar-sah00/goldenhour architecture

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

- Interactive diagram: https://gitdiagram.com/maheswar-sah00/goldenhour
- Repository: https://github.com/maheswar-sah00/goldenhour

## Overview

GoldenHour is an offline Android stroke-screening aid for families: setup and measured face, speech, and arm checks lead to a fixed-rule warning decision, saved check history, and help-seeking alerts. The README documents the principal orchestration and major capabilities; source excerpts confirm representative sensor, storage, and location behavior. Some screen, repository, and alert wiring is therefore represented at documented subsystem level rather than inferred from unsampled implementations.

Main entry points: [`app/src/main/java/com/goldenhour/app/ui/screens/check/CheckFlowViewModel.kt`](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/screens/check/CheckFlowViewModel.kt) (Check Flow), [`app/src/main/java/com/goldenhour/app/ui/navigation/GoldenHourRoot.kt`](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/navigation/GoldenHourRoot.kt) (Navigation Root), [`app/src/main/java/com/goldenhour/app/data/Repositories.kt`](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/data/Repositories.kt) (Repositories), [`app/src/main/java/com/goldenhour/app/checks/CheckModule.kt`](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/CheckModule.kt) (Check Module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App Entry"]
  node_activity["Main Activity<br/>[MainActivity.kt]"]
end

subgraph group_experience["User Experience"]
  node_navigation["Navigation Root<br/>[GoldenHourRoot.kt]"]
  node_setup["Setup &amp; Contacts"]
  node_home["Home &amp; History"]
  node_checkui["Check Screens"]
  node_alertui["Alert &amp; Result"]
  node_baselineui["Baseline Screens"]
end

subgraph group_screening["Screening"]
  node_checkvm["Check Flow"]
  node_baselinevm["Baseline Flow"]
  node_checks["Check Module<br/>[CheckModule.kt]"]
  node_face["Smile Measurement<br/>[FaceCheck.kt]"]
  node_speech["Speech Measurement<br/>[SpeechCheck.kt]"]
  node_arm["Arm Measurement<br/>[ArmCheck.kt]"]
end

subgraph group_domain["Decision Domain"]
  node_decision["Rules &amp; Decision<br/>[Decide.kt]"]
  node_metrics["Test Mathematics"]
  node_models["Session Models<br/>[Session.kt]"]
end

subgraph group_state["Local State"]
  node_repositories["Repositories<br/>[Repositories.kt]"]
  node_jsonstore[("JSON Store<br/>[JsonStore.kt]")]
end

subgraph group_response["Emergency Response"]
  node_location["Location Finder<br/>[LocationFinder.kt]"]
  node_caller["Emergency Caller<br/>[EmergencyCaller.kt]"]
  node_familyalert["Family Alerter<br/>[FamilyAlerter.kt]"]
end

node_helper(("Family Helper"))
node_phone{{"Phone Dialer"}}
node_messaging{{"SMS / WhatsApp"}}
node_locationservice{{"Device Location"}}
node_sensors{{"Phone Sensors"}}

node_helper -->|"opens app"| node_activity
node_activity -->|"shows root"| node_navigation
node_navigation -->|"routes setup"| node_setup
node_navigation -->|"routes home"| node_home
node_navigation -->|"routes check"| node_checkui
node_navigation -->|"routes outcome"| node_alertui
node_navigation -->|"routes baseline"| node_baselineui
node_checkui -->|"sends actions"| node_checkvm
node_baselineui -->|"sends actions"| node_baselinevm
node_checkvm -->|"runs checks"| node_checks
node_checks -->|"dispatches face"| node_face
node_checks -->|"dispatches speech"| node_speech
node_checks -->|"dispatches arm"| node_arm
node_face -->|"measures features"| node_metrics
node_speech -->|"measures speech"| node_metrics
node_arm -->|"measures motion"| node_metrics
node_arm -->|"reads motion"| node_sensors
node_checkvm -->|"decides once"| node_decision
node_decision -->|"returns verdict"| node_models
node_checkvm -->|"creates and saves"| node_repositories
node_baselinevm -->|"saves baseline"| node_repositories
node_home -->|"loads records"| node_repositories
node_setup -->|"saves profile"| node_repositories
node_repositories -->|"reads and writes"| node_jsonstore
node_checkvm -->|"finds location"| node_location
node_location -->|"requests fixes"| node_locationservice
node_location -->|"stores last fix"| node_repositories
node_checkvm -->|"starts call"| node_caller
node_checkvm -->|"dispatches alert"| node_familyalert
node_caller -->|"opens dialer"| node_phone
node_familyalert -->|"sends messages"| node_messaging
node_alertui -->|"triggers alert action"| node_checkvm

click node_activity "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/MainActivity.kt"
click node_navigation "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/navigation/GoldenHourRoot.kt"
click node_setup "https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens"
click node_home "https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens"
click node_checkui "https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens/check"
click node_alertui "https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens/alert"
click node_baselineui "https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens/baseline"
click node_checkvm "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/screens/check/CheckFlowViewModel.kt"
click node_baselinevm "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/screens/baseline/BaselineViewModel.kt"
click node_checks "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/CheckModule.kt"
click node_face "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/face/FaceCheck.kt"
click node_speech "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/speech/SpeechCheck.kt"
click node_arm "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/arm/ArmCheck.kt"
click node_decision "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/domain/Decide.kt"
click node_metrics "https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/domain"
click node_models "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/domain/Session.kt"
click node_repositories "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/data/Repositories.kt"
click node_jsonstore "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/data/JsonStore.kt"
click node_location "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/alerts/LocationFinder.kt"
click node_caller "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/alerts/EmergencyCaller.kt"
click node_familyalert "https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/alerts/FamilyAlerter.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 toneBlue
class node_navigation,node_setup,node_home,node_checkui,node_alertui,node_baselineui toneAmber
class node_checkvm,node_baselinevm,node_checks,node_face,node_speech,node_arm toneMint
class node_decision,node_metrics,node_models toneRose
class node_repositories,node_jsonstore,node_helper,node_phone,node_messaging,node_locationservice,node_sensors toneIndigo
class node_location,node_caller,node_familyalert toneTeal
```

## Components

### App Entry

- [Main Activity](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/MainActivity.kt): `app/src/main/java/com/goldenhour/app/MainActivity.kt`

### User Experience

- [Navigation Root](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/navigation/GoldenHourRoot.kt): `app/src/main/java/com/goldenhour/app/ui/navigation/GoldenHourRoot.kt`
- [Setup & Contacts](https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens): `app/src/main/java/com/goldenhour/app/ui/screens`
- [Home & History](https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens): `app/src/main/java/com/goldenhour/app/ui/screens`
- [Check Screens](https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens/check): `app/src/main/java/com/goldenhour/app/ui/screens/check`
- [Alert & Result](https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens/alert): `app/src/main/java/com/goldenhour/app/ui/screens/alert`
- [Baseline Screens](https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/ui/screens/baseline): `app/src/main/java/com/goldenhour/app/ui/screens/baseline`

### Screening

- [Check Flow](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/screens/check/CheckFlowViewModel.kt): `app/src/main/java/com/goldenhour/app/ui/screens/check/CheckFlowViewModel.kt`
- [Baseline Flow](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/ui/screens/baseline/BaselineViewModel.kt): `app/src/main/java/com/goldenhour/app/ui/screens/baseline/BaselineViewModel.kt`
- [Check Module](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/CheckModule.kt): `app/src/main/java/com/goldenhour/app/checks/CheckModule.kt`
- [Smile Measurement](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/face/FaceCheck.kt): `app/src/main/java/com/goldenhour/app/checks/face/FaceCheck.kt`
- [Speech Measurement](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/speech/SpeechCheck.kt): `app/src/main/java/com/goldenhour/app/checks/speech/SpeechCheck.kt`
- [Arm Measurement](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/checks/arm/ArmCheck.kt): `app/src/main/java/com/goldenhour/app/checks/arm/ArmCheck.kt`

### Decision Domain

- [Rules & Decision](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/domain/Decide.kt): `app/src/main/java/com/goldenhour/app/domain/Decide.kt`
- [Test Mathematics](https://github.com/maheswar-sah00/goldenhour/tree/main/app/src/main/java/com/goldenhour/app/domain): `app/src/main/java/com/goldenhour/app/domain`
- [Session Models](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/domain/Session.kt): `app/src/main/java/com/goldenhour/app/domain/Session.kt`

### Local State

- [Repositories](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/data/Repositories.kt): `app/src/main/java/com/goldenhour/app/data/Repositories.kt`
- [JSON Store](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/data/JsonStore.kt): `app/src/main/java/com/goldenhour/app/data/JsonStore.kt`

### Emergency Response

- [Location Finder](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/alerts/LocationFinder.kt): `app/src/main/java/com/goldenhour/app/alerts/LocationFinder.kt`
- [Emergency Caller](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/alerts/EmergencyCaller.kt): `app/src/main/java/com/goldenhour/app/alerts/EmergencyCaller.kt`
- [Family Alerter](https://github.com/maheswar-sah00/goldenhour/blob/main/app/src/main/java/com/goldenhour/app/alerts/FamilyAlerter.kt): `app/src/main/java/com/goldenhour/app/alerts/FamilyAlerter.kt`

### Other components

- **Family Helper**
- **Phone Dialer**
- **SMS / WhatsApp**
- **Device Location**
- **Phone Sensors**

## Connections

- Family Helper → Main Activity: opens app
- Main Activity → Navigation Root: shows root
- Navigation Root → Setup & Contacts: routes setup
- Navigation Root → Home & History: routes home
- Navigation Root → Check Screens: routes check
- Navigation Root → Alert & Result: routes outcome
- Navigation Root → Baseline Screens: routes baseline
- Check Screens → Check Flow: sends actions
- Baseline Screens → Baseline Flow: sends actions
- Check Flow → Check Module: runs checks
- Check Module → Smile Measurement: dispatches face
- Check Module → Speech Measurement: dispatches speech
- Check Module → Arm Measurement: dispatches arm
- Smile Measurement → Test Mathematics: measures features
- Speech Measurement → Test Mathematics: measures speech
- Arm Measurement → Test Mathematics: measures motion
- Arm Measurement → Phone Sensors: reads motion
- Check Flow → Rules & Decision: decides once
- Rules & Decision → Session Models: returns verdict
- Check Flow → Repositories: creates and saves
- Baseline Flow → Repositories: saves baseline
- Home & History → Repositories: loads records
- Setup & Contacts → Repositories: saves profile
- Repositories → JSON Store: reads and writes
- Check Flow → Location Finder: finds location
- Location Finder → Device Location: requests fixes
- Location Finder → Repositories: stores last fix
- Check Flow → Emergency Caller: starts call
- Check Flow → Family Alerter: dispatches alert
- Emergency Caller → Phone Dialer: opens dialer
- Family Alerter → SMS / WhatsApp: sends messages
- Alert & Result → Check Flow: triggers alert action
