# samsulpanjul/umamusume-auto-train architecture

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

- Interactive diagram: https://gitdiagram.com/samsulpanjul/umamusume-auto-train
- Repository: https://github.com/samsulpanjul/umamusume-auto-train

## Overview

Umamusume Auto Train automates a career run from the game lobby, using configured training priorities and game-state observations to choose actions. Users configure presets through the local web interface; the Python launcher starts both the bot and configuration server, while the bot interacts with the game through screen-based or ADB controls. The README also documents race scheduling, event choices, skill purchasing, hint hunting, and claw-machine play. Those capabilities are represented by their corresponding core modules, but their internal call wiring is not established by the sampled excerpts.

Main entry points: [`web/src/App.tsx`](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/App.tsx) (Web app), [`core/bot.py`](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/bot.py) (Career bot), [`server/main.py`](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/server/main.py) (Local API), [`main.py`](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/main.py) (Launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_launcher["Launcher<br/>[main.py]"]
  node_bot["Career bot<br/>[bot.py]"]
  node_config["Runtime config<br/>[config.py]"]
end

subgraph group_game["Game automation"]
  node_state["Game state<br/>[state.py]"]
  node_ocr["OCR<br/>[ocr.py]"]
  node_recognizer["Recognizer<br/>[recognizer.py]"]
  node_skeleton["Training logic<br/>[skeleton.py]"]
  node_strategies["Strategies<br/>[strategies.py]"]
  node_trainings["Training choices<br/>[trainings.py]"]
  node_events["Event choices<br/>[events.py]"]
  node_actions["Game actions<br/>[actions.py]"]
  node_claw["Claw machine<br/>[claw_machine.py]"]
  node_screen["Screen controls"]
  node_adb["ADB controls<br/>[adb_actions.py]"]
end

subgraph group_web["Configuration UI"]
  node_webapp["Web app<br/>[App.tsx]"]
  node_settings["Setup settings<br/>[SetUpSection.tsx]"]
  node_raceui["Race schedule"]
  node_eventui["Event selection<br/>[EventSection.tsx]"]
  node_trainingui["Training settings"]
  node_timelineui["Training timeline"]
  node_functionui["Function mods"]
  node_server["Local API<br/>[main.py]"]
  node_calculator["Score calculator"]
  node_presets[("Preset files")]
end

subgraph group_integrations["External integrations"]
  node_gameapp(("Umamusume"))
  node_browser(("Browser"))
  node_discord(("Discord webhook"))
end

node_user(("Player"))

node_user -->|"starts bot"| node_launcher
node_launcher -->|"starts career"| node_bot
node_launcher -->|"starts API"| node_server
node_user -->|"configures"| node_browser
node_browser -->|"opens UI"| node_webapp
node_webapp -->|"requests config"| node_server
node_webapp -->|"edits setup"| node_settings
node_webapp -->|"edits races"| node_raceui
node_webapp -->|"edits events"| node_eventui
node_webapp -->|"edits training"| node_trainingui
node_webapp -->|"edits timeline"| node_timelineui
node_webapp -->|"edits scoring"| node_functionui
node_server -->|"reads and writes"| node_presets
node_server -->|"calculates scores"| node_calculator
node_server -->|"updates webhook config"| node_bot
node_bot -->|"loads settings"| node_config
node_bot -->|"automates career"| node_gameapp
node_bot -->|"controls screen"| node_screen
node_bot -.->|"controls device"| node_adb
node_bot -.->|"sends updates"| node_discord

click node_launcher "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/main.py"
click node_bot "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/bot.py"
click node_config "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/config.py"
click node_state "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/state.py"
click node_ocr "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/ocr.py"
click node_recognizer "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/recognizer.py"
click node_skeleton "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/skeleton.py"
click node_strategies "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/strategies.py"
click node_trainings "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/trainings.py"
click node_events "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/events.py"
click node_actions "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/actions.py"
click node_claw "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/claw_machine.py"
click node_screen "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/utils/pyautogui_actions.py"
click node_adb "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/utils/adb_actions.py"
click node_webapp "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/App.tsx"
click node_settings "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/set-up/SetUpSection.tsx"
click node_raceui "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/race-schedule/RaceScheduleSection.tsx"
click node_eventui "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/event/EventSection.tsx"
click node_trainingui "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/training/TrainingSection.tsx"
click node_timelineui "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/skeleton/TimelineSection.tsx"
click node_functionui "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/function-mods/FunctionModsSection.tsx"
click node_server "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/server/main.py"
click node_calculator "https://github.com/samsulpanjul/umamusume-auto-train/blob/main/server/calculator_helpers.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_launcher,node_bot,node_config toneBlue
class node_state,node_ocr,node_recognizer,node_skeleton,node_strategies,node_trainings,node_events,node_actions,node_claw,node_screen,node_adb toneAmber
class node_webapp,node_settings,node_raceui,node_eventui,node_trainingui,node_timelineui,node_functionui,node_server,node_calculator,node_presets toneMint
class node_gameapp,node_browser,node_discord toneRose
class node_user toneIndigo
```

## Components

### Bot runtime

- [Launcher](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/main.py): `main.py`
- [Career bot](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/bot.py): `core/bot.py`
- [Runtime config](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/config.py): `core/config.py`

### Game automation

- [Game state](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/state.py): `core/state.py`
- [OCR](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/ocr.py): `core/ocr.py`
- [Recognizer](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/recognizer.py): `core/recognizer.py`
- [Training logic](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/skeleton.py): `core/skeleton.py`
- [Strategies](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/strategies.py): `core/strategies.py`
- [Training choices](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/trainings.py): `core/trainings.py`
- [Event choices](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/events.py): `core/events.py`
- [Game actions](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/actions.py): `core/actions.py`
- [Claw machine](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/core/claw_machine.py): `core/claw_machine.py`
- [Screen controls](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/utils/pyautogui_actions.py): `utils/pyautogui_actions.py`
- [ADB controls](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/utils/adb_actions.py): `utils/adb_actions.py`

### Configuration UI

- [Web app](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Setup settings](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/set-up/SetUpSection.tsx): `web/src/components/set-up/SetUpSection.tsx`
- [Race schedule](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/race-schedule/RaceScheduleSection.tsx): `web/src/components/race-schedule/RaceScheduleSection.tsx`
- [Event selection](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/event/EventSection.tsx): `web/src/components/event/EventSection.tsx`
- [Training settings](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/training/TrainingSection.tsx): `web/src/components/training/TrainingSection.tsx`
- [Training timeline](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/skeleton/TimelineSection.tsx): `web/src/components/skeleton/TimelineSection.tsx`
- [Function mods](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/web/src/components/function-mods/FunctionModsSection.tsx): `web/src/components/function-mods/FunctionModsSection.tsx`
- [Local API](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/server/main.py): `server/main.py`
- [Score calculator](https://github.com/samsulpanjul/umamusume-auto-train/blob/main/server/calculator_helpers.py): `server/calculator_helpers.py`
- **Preset files**

### External integrations

- **Umamusume**
- **Browser**
- **Discord webhook**

### Other components

- **Player**

## Connections

- Player → Launcher: starts bot
- Launcher → Career bot: starts career
- Launcher → Local API: starts API
- Player → Browser: configures
- Browser → Web app: opens UI
- Web app → Local API: requests config
- Web app → Setup settings: edits setup
- Web app → Race schedule: edits races
- Web app → Event selection: edits events
- Web app → Training settings: edits training
- Web app → Training timeline: edits timeline
- Web app → Function mods: edits scoring
- Local API → Preset files: reads and writes
- Local API → Score calculator: calculates scores
- Local API → Career bot: updates webhook config
- Career bot → Runtime config: loads settings
- Career bot → Umamusume: automates career
- Career bot → Screen controls: controls screen
- Career bot → ADB controls: controls device
- Career bot → Discord webhook: sends updates
