# milohzwahlen/starthack-tour-etherlaken-2026-my-twin architecture

> Architecture diagram of the GitHub repository milohzwahlen/starthack-tour-etherlaken-2026-my-twin, 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/milohzwahlen/starthack-tour-etherlaken-2026-my-twin
- Repository: https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin

## Overview

MyTwin is an Android personal-health-twin prototype: users onboard, connect Samsung Health, review and correct current readings, explore recent history and simulated health trajectories, then chat with a Claude-powered twin. The mobile app is the documented primary product; the tree also contains a separate FastAPI Claude/health service. Edges reflect sampled calls, indexed references, or README claims; unsampled UI and API wiring is left out where its direction is uncertain.

Main entry points: [`apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt`](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt) (Profile repository), [`apps/mytwin-api/app/routers/router_claudeai.py`](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/routers/router_claudeai.py) (Claude chat route), [`apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt) (Twin chat orchestration), [`apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt`](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt) (Health repository)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Android experience"]
  node_activity["App entry<br/>[MainActivity.kt]"]
  node_navigation["Navigation<br/>[AppNavGraph.kt]"]
  node_onboarding["Onboarding UI"]
  node_home["Home and history<br/>[HomeScreen.kt]"]
  node_food["Food scanner<br/>[FoodScanScreen.kt]"]
  node_homevm["Home state<br/>[HomeViewModel.kt]"]
  node_onboardvm["Onboarding state"]
  node_locator["Dependency wiring<br/>[ServiceLocator.kt]"]
end

subgraph group_health["Health and profile data"]
  node_profile["User profile<br/>[UserProfile.kt]"]
  node_profiledata[("Profile preferences")]
  node_profilerepo["Profile repository"]
  node_onboardrepo["Onboarding repository"]
  node_onboarddata[("Onboarding preferences")]
  node_healthrepo["Health repository"]
  node_samsung["Samsung Health reads"]
  node_wearables["Wearable history and signals"]
end

subgraph group_twin["Simulation and chat"]
  node_simulationrepo["Simulation inputs"]
  node_engine["Rule-based simulation"]
  node_chatrepo["Twin chat orchestration<br/>[ChatRepository.kt]"]
  node_context["Twin context builder"]
  node_claude["Streaming Claude client"]
end

subgraph group_api["FastAPI service"]
  node_api_main["API application<br/>[main.py]"]
  node_api_router["Claude chat route<br/>[router_claudeai.py]"]
  node_api_health["Health data service"]
  node_api_insights["Insight derivation<br/>[utils_insights.py]"]
  node_api_prompt["Prompt construction"]
  node_api_client["Claude API client"]
  node_api_safety["Response safety filter"]
end

node_user(("User"))
node_samsungservice[("Samsung Health")]
node_anthropic(("Anthropic Claude API"))

node_user -->|"opens app"| node_activity
node_activity -->|"starts navigation"| node_navigation
node_user -.->|"enters profile"| node_onboarding
node_user -.->|"views and edits"| node_home
node_user -.->|"opens placeholder"| node_food
node_home -.->|"uses state"| node_homevm
node_onboarding -->|"uses state"| node_onboardvm
node_homevm -->|"requests metrics"| node_healthrepo
node_homevm -->|"reads and updates"| node_profilerepo
node_onboardvm -.->|"saves completion"| node_onboardrepo
node_onboardvm -->|"updates profile"| node_profilerepo
node_profilerepo -->|"reads and writes"| node_profiledata
node_profilerepo -->|"exposes profile"| node_profile
node_onboardrepo -->|"reads and writes"| node_onboarddata
node_healthrepo -->|"delegates reads"| node_samsung
node_samsung -.->|"reads wearable data"| node_samsungservice
node_healthrepo -->|"returns histories"| node_wearables
node_simulationrepo -->|"reads profile"| node_profilerepo
node_simulationrepo -->|"reads histories"| node_healthrepo
node_simulationrepo -->|"evaluates scenarios"| node_engine
node_chatrepo -->|"reads profile"| node_profilerepo
node_chatrepo -->|"builds baseline"| node_simulationrepo
node_chatrepo -->|"reads histories"| node_healthrepo
node_chatrepo -->|"builds context"| node_context
node_chatrepo -->|"streams prompt"| node_claude
node_claude -->|"sends streaming request"| node_anthropic
node_locator -->|"constructs"| node_chatrepo
node_locator -->|"constructs"| node_simulationrepo
node_locator -->|"constructs"| node_healthrepo
node_locator -->|"constructs"| node_profilerepo
node_api_main -->|"registers route"| node_api_router
node_api_router -->|"fetches health data"| node_api_health
node_api_router -->|"derives insights"| node_api_insights
node_api_router -->|"builds prompt"| node_api_prompt
node_api_router -->|"requests response"| node_api_client
node_api_router -->|"filters response"| node_api_safety

click node_activity "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/MainActivity.kt"
click node_navigation "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/navigation/AppNavGraph.kt"
click node_onboarding "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/OnboardingScreen.kt"
click node_home "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/HomeScreen.kt"
click node_food "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/FoodScanScreen.kt"
click node_homevm "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/HomeViewModel.kt"
click node_onboardvm "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/OnboardingViewModel.kt"
click node_profile "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/model/UserProfile.kt"
click node_profiledata "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/UserProfileDataSource.kt"
click node_profilerepo "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt"
click node_onboardrepo "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/OnboardingRepository.kt"
click node_onboarddata "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/OnboardingDataSource.kt"
click node_healthrepo "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt"
click node_samsung "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/SamsungHealthDataSource.kt"
click node_wearables "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/model/WearableHistoryPoint.kt"
click node_simulationrepo "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationRepository.kt"
click node_engine "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationEngine.kt"
click node_chatrepo "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt"
click node_context "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeContextBuilder.kt"
click node_claude "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeApiService.kt"
click node_locator "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt"
click node_api_main "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/main.py"
click node_api_router "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/routers/router_claudeai.py"
click node_api_health "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_samsunghealth.py"
click node_api_insights "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/utils/utils_insights.py"
click node_api_prompt "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_promptclaudeai.py"
click node_api_client "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_apiclientclaudeai.py"
click node_api_safety "https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_safetyfilter.py"

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_navigation,node_onboarding,node_home,node_food,node_homevm,node_onboardvm,node_locator,node_user toneBlue
class node_profile,node_profiledata,node_profilerepo,node_onboardrepo,node_onboarddata,node_healthrepo,node_samsung,node_wearables,node_samsungservice toneAmber
class node_simulationrepo,node_engine,node_chatrepo,node_context,node_claude,node_anthropic toneMint
class node_api_main,node_api_router,node_api_health,node_api_insights,node_api_prompt,node_api_client,node_api_safety toneRose
```

## Components

### Android experience

- [App entry](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/MainActivity.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/MainActivity.kt`
- [Navigation](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/navigation/AppNavGraph.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/navigation/AppNavGraph.kt`
- [Onboarding UI](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/OnboardingScreen.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/OnboardingScreen.kt`
- [Home and history](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/HomeScreen.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/HomeScreen.kt`
- [Food scanner](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/FoodScanScreen.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/FoodScanScreen.kt`
- [Home state](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/HomeViewModel.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/HomeViewModel.kt`
- [Onboarding state](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/OnboardingViewModel.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/OnboardingViewModel.kt`
- [Dependency wiring](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt`

### Health and profile data

- [User profile](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/model/UserProfile.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/model/UserProfile.kt`
- [Profile preferences](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/UserProfileDataSource.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/UserProfileDataSource.kt`
- [Profile repository](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt`
- [Onboarding repository](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/OnboardingRepository.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/OnboardingRepository.kt`
- [Onboarding preferences](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/OnboardingDataSource.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/OnboardingDataSource.kt`
- [Health repository](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt`
- [Samsung Health reads](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/SamsungHealthDataSource.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/datasource/SamsungHealthDataSource.kt`
- [Wearable history and signals](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/model/WearableHistoryPoint.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/model/WearableHistoryPoint.kt`

### Simulation and chat

- [Simulation inputs](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationRepository.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationRepository.kt`
- [Rule-based simulation](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationEngine.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationEngine.kt`
- [Twin chat orchestration](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`
- [Twin context builder](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeContextBuilder.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeContextBuilder.kt`
- [Streaming Claude client](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeApiService.kt): `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeApiService.kt`

### FastAPI service

- [API application](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/main.py): `apps/mytwin-api/app/main.py`
- [Claude chat route](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/routers/router_claudeai.py): `apps/mytwin-api/app/routers/router_claudeai.py`
- [Health data service](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_samsunghealth.py): `apps/mytwin-api/app/services/service_samsunghealth.py`
- [Insight derivation](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/utils/utils_insights.py): `apps/mytwin-api/app/utils/utils_insights.py`
- [Prompt construction](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_promptclaudeai.py): `apps/mytwin-api/app/services/service_promptclaudeai.py`
- [Claude API client](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_apiclientclaudeai.py): `apps/mytwin-api/app/services/service_apiclientclaudeai.py`
- [Response safety filter](https://github.com/milohzwahlen/starthack-tour-etherlaken-2026-my-twin/blob/main/apps/mytwin-api/app/services/service_safetyfilter.py): `apps/mytwin-api/app/services/service_safetyfilter.py`

### Other components

- **User**
- **Samsung Health**
- **Anthropic Claude API**

## Connections

- User → App entry: opens app
- App entry → Navigation: starts navigation (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/MainActivity.kt`)
- User → Onboarding UI: enters profile
- User → Home and history: views and edits
- User → Food scanner: opens placeholder
- Home and history → Home state: uses state (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/HomeScreen.kt`)
- Onboarding UI → Onboarding state: uses state (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/screens/OnboardingScreen.kt`)
- Home state → Health repository: requests metrics (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/HomeViewModel.kt`)
- Home state → Profile repository: reads and updates (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/HomeViewModel.kt`)
- Onboarding state → Onboarding repository: saves completion (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/OnboardingViewModel.kt`)
- Onboarding state → Profile repository: updates profile (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/ui/viewmodels/OnboardingViewModel.kt`)
- Profile repository → Profile preferences: reads and writes (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt`)
- Profile repository → User profile: exposes profile (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/UserProfileRepository.kt`)
- Onboarding repository → Onboarding preferences: reads and writes (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/OnboardingRepository.kt`)
- Health repository → Samsung Health reads: delegates reads (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt`)
- Samsung Health reads → Samsung Health: reads wearable data
- Health repository → Wearable history and signals: returns histories (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/data/repository/HealthRepository.kt`)
- Simulation inputs → Profile repository: reads profile (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationRepository.kt`)
- Simulation inputs → Health repository: reads histories (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationRepository.kt`)
- Simulation inputs → Rule-based simulation: evaluates scenarios (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/simulation/SimulationRepository.kt`)
- Twin chat orchestration → Profile repository: reads profile (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`)
- Twin chat orchestration → Simulation inputs: builds baseline (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`)
- Twin chat orchestration → Health repository: reads histories (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`)
- Twin chat orchestration → Twin context builder: builds context (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`)
- Twin chat orchestration → Streaming Claude client: streams prompt (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ChatRepository.kt`)
- Streaming Claude client → Anthropic Claude API: sends streaming request (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/chat/ClaudeApiService.kt`)
- Dependency wiring → Twin chat orchestration: constructs (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt`)
- Dependency wiring → Simulation inputs: constructs (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt`)
- Dependency wiring → Health repository: constructs (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt`)
- Dependency wiring → Profile repository: constructs (evidence: `apps/mytwin-mobile/app/src/main/java/com/mzwprojects/mytwin/di/ServiceLocator.kt`)
- API application → Claude chat route: registers route (evidence: `apps/mytwin-api/app/main.py`)
- Claude chat route → Health data service: fetches health data (evidence: `apps/mytwin-api/app/routers/router_claudeai.py`)
- Claude chat route → Insight derivation: derives insights (evidence: `apps/mytwin-api/app/routers/router_claudeai.py`)
- Claude chat route → Prompt construction: builds prompt (evidence: `apps/mytwin-api/app/routers/router_claudeai.py`)
- Claude chat route → Claude API client: requests response (evidence: `apps/mytwin-api/app/routers/router_claudeai.py`)
- Claude chat route → Response safety filter: filters response (evidence: `apps/mytwin-api/app/routers/router_claudeai.py`)
