# steve1316/uma-android-automation architecture

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

- Interactive diagram: https://gitdiagram.com/steve1316/uma-android-automation
- Repository: https://github.com/steve1316/uma-android-automation

## Overview

Uma Musume Automation is an Android app that automates a game run using configurable React Native screens and a Kotlin automation backend. The main workflow is to configure a scenario and training/racing preferences, start the Android automation with required permissions, and let the bot observe and act through the run. The graph also preserves documented computer-vision, race-planning, settings/profile, and optional offline-chat capabilities. Some links reflect README-level documentation rather than inspected implementation; unsampled modules are represented only where the tree or README supports them.

Main entry points: [`android/app/src/main/java/com/steve1316/uma_android_automation/bot/Game.kt`](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/Game.kt) (Game controller), [`src/pages`](https://github.com/steve1316/uma-android-automation/tree/master/src/pages) (Settings screens), [`src/App.tsx`](https://github.com/steve1316/uma-android-automation/blob/master/src/App.tsx) (App navigation), [`src/hooks/useSettingsManager.tsx`](https://github.com/steve1316/uma-android-automation/blob/master/src/hooks/useSettingsManager.tsx) (Settings manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["App UI"]
  node_app["App navigation<br/>[App.tsx]"]
  node_ui_controls["UI components"]
  node_contexts["App contexts"]
end

subgraph group_config["Settings and planning"]
  node_settings_pages["Settings screens"]
  node_settings_state["Bot settings state"]
  node_settings_manager["Settings manager"]
  node_profile_manager["Profile manager"]
  node_schedule["Schedule and race planning"]
  node_solver["Race solver"]
  node_training["Training strategy<br/>[Training.kt]"]
end

subgraph group_automation["Game automation"]
  node_scenario_logic["Scenario logic"]
  node_start["Automation start<br/>[StartModule.kt]"]
  node_android_activity["Android activity<br/>[MainActivity.kt]"]
  node_game["Game controller<br/>[Game.kt]"]
  node_dialog["Dialog handling<br/>[DialogHandler.kt]"]
  node_vision["Screen recognition"]
  node_skill_buying["Skill buying<br/>[SkillDatabase.kt]"]
end

subgraph group_services["Platform and services"]
  node_storage[("SQLite settings store<br/>[database.ts]")]
  node_native_storage["Native storage bridge"]
  node_llm["Offline docs chat"]
  node_log_service["Remote log viewer<br/>[LogStreamServer.kt]"]
  node_metrics["Performance logging"]
end

node_user(("User"))

node_user -->|"configures and starts"| node_app
node_app -->|"navigates to"| node_settings_pages
node_settings_pages -->|"updates settings"| node_settings_state
node_settings_pages -.->|"configures schedule"| node_schedule
node_settings_pages -.->|"previews races"| node_solver
node_settings_pages -.->|"sets priorities"| node_training
node_settings_state -->|"persists settings"| node_settings_manager
node_settings_manager -->|"saves settings"| node_storage
node_profile_manager -->|"loads profiles"| node_storage
node_user -->|"taps start"| node_start
node_start -.->|"starts automation"| node_android_activity
node_android_activity -.->|"runs bot"| node_game
node_game -.->|"reads screen"| node_vision
node_game -->|"handles choices"| node_dialog
node_game -.->|"applies scenario rules"| node_scenario_logic
node_game -.->|"chooses training"| node_training
node_game -.->|"schedules races"| node_solver
node_game -->|"buys skills"| node_skill_buying
node_app -->|"renders screens"| node_ui_controls
node_app -->|"provides state"| node_contexts
node_settings_manager -->|"loads and updates"| node_settings_state
node_native_storage -.->|"bridges storage"| node_storage
node_user -.->|"asks docs"| node_llm
node_android_activity -.->|"streams logs"| node_log_service
node_settings_manager -->|"records timings"| node_metrics

click node_app "https://github.com/steve1316/uma-android-automation/blob/master/src/App.tsx"
click node_ui_controls "https://github.com/steve1316/uma-android-automation/tree/master/src/components/ui"
click node_contexts "https://github.com/steve1316/uma-android-automation/tree/master/src/context"
click node_settings_pages "https://github.com/steve1316/uma-android-automation/tree/master/src/pages"
click node_settings_state "https://github.com/steve1316/uma-android-automation/blob/master/src/context/BotStateContext.tsx"
click node_settings_manager "https://github.com/steve1316/uma-android-automation/blob/master/src/hooks/useSettingsManager.tsx"
click node_profile_manager "https://github.com/steve1316/uma-android-automation/blob/master/src/hooks/useProfileManager.tsx"
click node_schedule "https://github.com/steve1316/uma-android-automation/tree/master/src/lib/schedule"
click node_solver "https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/solver"
click node_training "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/Training.kt"
click node_scenario_logic "https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/campaigns"
click node_start "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/StartModule.kt"
click node_android_activity "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/MainActivity.kt"
click node_game "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/Game.kt"
click node_dialog "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/DialogHandler.kt"
click node_vision "https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/utils"
click node_skill_buying "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/SkillDatabase.kt"
click node_storage "https://github.com/steve1316/uma-android-automation/blob/master/src/lib/database.ts"
click node_native_storage "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/StorageBridgeModule.kt"
click node_llm "https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/llm"
click node_log_service "https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/utils/LogStreamServer.kt"
click node_metrics "https://github.com/steve1316/uma-android-automation/blob/master/src/lib/performanceLogger.ts"

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,node_ui_controls,node_contexts,node_user toneBlue
class node_settings_pages,node_settings_state,node_settings_manager,node_profile_manager,node_schedule,node_solver,node_training toneAmber
class node_scenario_logic,node_start,node_android_activity,node_game,node_dialog,node_vision,node_skill_buying toneMint
class node_storage,node_native_storage,node_llm,node_log_service,node_metrics toneRose
```

## Components

### App UI

- [App navigation](https://github.com/steve1316/uma-android-automation/blob/master/src/App.tsx): `src/App.tsx`
- [UI components](https://github.com/steve1316/uma-android-automation/tree/master/src/components/ui): `src/components/ui`
- [App contexts](https://github.com/steve1316/uma-android-automation/tree/master/src/context): `src/context`

### Settings and planning

- [Settings screens](https://github.com/steve1316/uma-android-automation/tree/master/src/pages): `src/pages`
- [Bot settings state](https://github.com/steve1316/uma-android-automation/blob/master/src/context/BotStateContext.tsx): `src/context/BotStateContext.tsx`
- [Settings manager](https://github.com/steve1316/uma-android-automation/blob/master/src/hooks/useSettingsManager.tsx): `src/hooks/useSettingsManager.tsx`
- [Profile manager](https://github.com/steve1316/uma-android-automation/blob/master/src/hooks/useProfileManager.tsx): `src/hooks/useProfileManager.tsx`
- [Schedule and race planning](https://github.com/steve1316/uma-android-automation/tree/master/src/lib/schedule): `src/lib/schedule`
- [Race solver](https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/solver): `android/app/src/main/java/com/steve1316/uma_android_automation/bot/solver`
- [Training strategy](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/Training.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/bot/Training.kt`

### Game automation

- [Scenario logic](https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/campaigns): `android/app/src/main/java/com/steve1316/uma_android_automation/bot/campaigns`
- [Automation start](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/StartModule.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/StartModule.kt`
- [Android activity](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/MainActivity.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/MainActivity.kt`
- [Game controller](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/Game.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/bot/Game.kt`
- [Dialog handling](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/DialogHandler.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/bot/DialogHandler.kt`
- [Screen recognition](https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/utils): `android/app/src/main/java/com/steve1316/uma_android_automation/utils`
- [Skill buying](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/bot/SkillDatabase.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/bot/SkillDatabase.kt`

### Platform and services

- [SQLite settings store](https://github.com/steve1316/uma-android-automation/blob/master/src/lib/database.ts): `src/lib/database.ts`
- [Native storage bridge](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/StorageBridgeModule.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/StorageBridgeModule.kt`
- [Offline docs chat](https://github.com/steve1316/uma-android-automation/tree/master/android/app/src/main/java/com/steve1316/uma_android_automation/llm): `android/app/src/main/java/com/steve1316/uma_android_automation/llm`
- [Remote log viewer](https://github.com/steve1316/uma-android-automation/blob/master/android/app/src/main/java/com/steve1316/uma_android_automation/utils/LogStreamServer.kt): `android/app/src/main/java/com/steve1316/uma_android_automation/utils/LogStreamServer.kt`
- [Performance logging](https://github.com/steve1316/uma-android-automation/blob/master/src/lib/performanceLogger.ts): `src/lib/performanceLogger.ts`

### Other components

- **User**

## Connections

- User → App navigation: configures and starts (evidence: `README.md`)
- App navigation → Settings screens: navigates to (evidence: `src/App.tsx`)
- Settings screens → Bot settings state: updates settings (evidence: `src/pages/ScenarioOverridesSettings/index.tsx`)
- Settings screens → Schedule and race planning: configures schedule (evidence: `README.md`)
- Settings screens → Race solver: previews races (evidence: `README.md`)
- Settings screens → Training strategy: sets priorities (evidence: `README.md`)
- Bot settings state → Settings manager: persists settings (evidence: `src/hooks/useSettingsManager.tsx`)
- Settings manager → SQLite settings store: saves settings (evidence: `src/hooks/useSettingsManager.tsx`)
- Profile manager → SQLite settings store: loads profiles (evidence: `src/hooks/useProfileManager.tsx`)
- User → Automation start: taps start (evidence: `README.md`)
- Automation start → Android activity: starts automation (evidence: `README.md`)
- Android activity → Game controller: runs bot (evidence: `README.md`)
- Game controller → Screen recognition: reads screen (evidence: `README.md`)
- Game controller → Dialog handling: handles choices (evidence: `android/app/src/main/java/com/steve1316/uma_android_automation/bot/DialogHandler.kt`)
- Game controller → Scenario logic: applies scenario rules (evidence: `README.md`)
- Game controller → Training strategy: chooses training (evidence: `README.md`)
- Game controller → Race solver: schedules races (evidence: `README.md`)
- Game controller → Skill buying: buys skills (evidence: `android/app/src/main/java/com/steve1316/uma_android_automation/bot/SkillDatabase.kt`)
- App navigation → UI components: renders screens (evidence: `src/App.tsx`)
- App navigation → App contexts: provides state (evidence: `src/App.tsx`)
- Settings manager → Bot settings state: loads and updates (evidence: `src/hooks/useSettingsManager.tsx`)
- Native storage bridge → SQLite settings store: bridges storage
- User → Offline docs chat: asks docs (evidence: `README.md`)
- Android activity → Remote log viewer: streams logs (evidence: `README.md`)
- Settings manager → Performance logging: records timings (evidence: `src/hooks/useSettingsManager.tsx`)
