# chbk1348/gatcha-log architecture

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

- Interactive diagram: https://gitdiagram.com/chbk1348/gatcha-log
- Repository: https://github.com/chbk1348/gatcha-log

## Overview

Gatcha LOG is a Kotlin Multiplatform Android/iOS tracker for gacha spending and game information. The user journey is to onboard or sign in, record and review spending, then use game-account data for live notes, attendance, characters, schedules, and gacha reports; alerts and cloud sync support that experience across devices. The graph also preserves the documented HoYoLAND guide and savings/challenge features. Connections reflect README statements or the supplied source index; unsampled internals and external API wiring are not inferred.

Main entry points: [`Gatcha Log IOS/GL_IOS/ContentView.swift`](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/ContentView.swift) (iOS app), [`Gatcha Log Android/src/main/java/com/gatcha/log/ui/game/GachaDashboardScreen.kt`](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Android/src/main/java/com/gatcha/log/ui/game/GachaDashboardScreen.kt) (Game information UI), [`Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt`](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt) (Spending view model), [`Gatcha Log Android/src/main/java/com/gatcha/log/MainActivity.kt`](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Android/src/main/java/com/gatcha/log/MainActivity.kt) (Android app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_apps["Platform apps"]
  node_android["Android app<br/>[MainActivity.kt]"]
  node_ios["iOS app<br/>[ContentView.swift]"]
  node_iosbridge["iOS state bridge"]
  node_spendingui["Spending screens"]
  node_onboarding["Onboarding"]
  node_gameui["Game information UI"]
end

subgraph group_domain["Shared domain"]
  node_spendingvm["Spending view model"]
  node_repository["Account data repository"]
  node_spending["Spending records<br/>[Spending.kt]"]
  node_reports["Gacha reports<br/>[GachaReport.kt]"]
end

subgraph group_game["Game features"]
  node_gameinfo["Game data<br/>[GameData.kt]"]
  node_hoyolab["HoYoLAB API<br/>[HoyolabApi.kt]"]
  node_hoyoland["HoYoLAND API<br/>[HoyolandApi.kt]"]
end

subgraph group_services["Persistence and services"]
  node_auth["Account and auth<br/>[AuthManager.kt]"]
  node_settings["App settings<br/>[AppSettings.kt]"]
  node_localstore[("Local key-value store<br/>[KeyValueStore.kt]")]
  node_cloudsync["Cloud sync<br/>[CloudSync.kt]"]
  node_notifications["Notification planning"]
  node_scheduled["Scheduled alerts<br/>[ScheduledAlerts.kt]"]
  node_osalerts["OS notifications"]
end

node_user(("Player"))
node_firebase[("Firebase / Firestore")]
node_gameplatform["HoYoLAB services"]

node_user -->|"uses"| node_android
node_user -->|"uses"| node_ios
node_android -->|"uses shared logic"| node_spendingvm
node_ios -->|"hosts SwiftUI"| node_iosbridge
node_iosbridge -->|"bridges state"| node_spendingvm
node_ios -->|"routes to"| node_onboarding
node_ios -->|"routes to"| node_spendingui
node_ios -.->|"routes to"| node_gameui
node_spendingui -->|"reads state"| node_iosbridge
node_spendingvm -.->|"manages data"| node_repository
node_repository -->|"stores records"| node_spending
node_repository -->|"stores reports"| node_reports
node_spending -->|"uses game definitions"| node_gameinfo
node_gameui -.->|"shows game data"| node_gameinfo
node_gameui -.->|"shows linked data"| node_hoyolab
node_gameui -.->|"shows event guide"| node_hoyoland
node_auth -->|"persists account"| node_localstore
node_auth -->|"syncs account"| node_cloudsync
node_spendingvm -->|"syncs snapshots"| node_cloudsync
node_cloudsync -->|"reads and writes"| node_firebase
node_settings -->|"stores preferences"| node_localstore
node_android -->|"triggers checks"| node_notifications
node_notifications -->|"replans alerts"| node_scheduled
node_scheduled -->|"schedules"| node_osalerts
node_hoyolab -.->|"requests game data"| node_gameplatform

click node_android "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Android/src/main/java/com/gatcha/log/MainActivity.kt"
click node_ios "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/ContentView.swift"
click node_iosbridge "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/Bridge/SpendingStore.swift"
click node_spendingui "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/Screens/Spending/SpendingDetailView.swift"
click node_onboarding "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/Screens/Onboarding/OnboardingView.swift"
click node_gameui "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Android/src/main/java/com/gatcha/log/ui/game/GachaDashboardScreen.kt"
click node_spendingvm "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt"
click node_repository "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/GatchaRepository.kt"
click node_spending "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/Spending.kt"
click node_reports "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/GachaReport.kt"
click node_gameinfo "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/GameData.kt"
click node_hoyolab "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/api/HoyolabApi.kt"
click node_hoyoland "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/api/HoyolandApi.kt"
click node_auth "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/AuthManager.kt"
click node_settings "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/AppSettings.kt"
click node_localstore "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/storage/KeyValueStore.kt"
click node_cloudsync "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/CloudSync.kt"
click node_notifications "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/work/NotificationChecker.kt"
click node_scheduled "https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/work/ScheduledAlerts.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_android,node_ios,node_iosbridge,node_spendingui,node_onboarding,node_gameui toneBlue
class node_spendingvm,node_repository,node_spending,node_reports,node_firebase toneAmber
class node_gameinfo,node_hoyolab,node_hoyoland toneMint
class node_auth,node_settings,node_localstore,node_cloudsync,node_notifications,node_scheduled,node_osalerts toneRose
class node_user,node_gameplatform toneIndigo
```

## Components

### Platform apps

- [Android app](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Android/src/main/java/com/gatcha/log/MainActivity.kt): `Gatcha Log Android/src/main/java/com/gatcha/log/MainActivity.kt`
- [iOS app](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/ContentView.swift): `Gatcha Log IOS/GL_IOS/ContentView.swift`
- [iOS state bridge](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/Bridge/SpendingStore.swift): `Gatcha Log IOS/GL_IOS/Bridge/SpendingStore.swift`
- [Spending screens](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/Screens/Spending/SpendingDetailView.swift): `Gatcha Log IOS/GL_IOS/Screens/Spending/SpendingDetailView.swift`
- [Onboarding](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20IOS/GL_IOS/Screens/Onboarding/OnboardingView.swift): `Gatcha Log IOS/GL_IOS/Screens/Onboarding/OnboardingView.swift`
- [Game information UI](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Android/src/main/java/com/gatcha/log/ui/game/GachaDashboardScreen.kt): `Gatcha Log Android/src/main/java/com/gatcha/log/ui/game/GachaDashboardScreen.kt`

### Shared domain

- [Spending view model](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt`
- [Account data repository](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/GatchaRepository.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/GatchaRepository.kt`
- [Spending records](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/Spending.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/Spending.kt`
- [Gacha reports](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/GachaReport.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/GachaReport.kt`

### Game features

- [Game data](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/GameData.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/GameData.kt`
- [HoYoLAB API](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/api/HoyolabApi.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/api/HoyolabApi.kt`
- [HoYoLAND API](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/api/HoyolandApi.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/api/HoyolandApi.kt`

### Persistence and services

- [Account and auth](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/AuthManager.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/AuthManager.kt`
- [App settings](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/AppSettings.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/AppSettings.kt`
- [Local key-value store](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/storage/KeyValueStore.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/storage/KeyValueStore.kt`
- [Cloud sync](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/CloudSync.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/CloudSync.kt`
- [Notification planning](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/work/NotificationChecker.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/work/NotificationChecker.kt`
- [Scheduled alerts](https://github.com/chbk1348/gatcha-log/blob/main/Gatcha%20Log%20Shared/src/commonMain/kotlin/com/gatcha/log/data/work/ScheduledAlerts.kt): `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/work/ScheduledAlerts.kt`
- **OS notifications**

### Other components

- **Player**
- **Firebase / Firestore**
- **HoYoLAB services**

## Connections

- Player → Android app: uses
- Player → iOS app: uses
- Android app → Spending view model: uses shared logic (evidence: `Gatcha Log Android/src/main/java/com/gatcha/log/MainActivity.kt`)
- iOS app → iOS state bridge: hosts SwiftUI (evidence: `Gatcha Log IOS/GL_IOS/ContentView.swift`)
- iOS state bridge → Spending view model: bridges state
- iOS app → Onboarding: routes to (evidence: `Gatcha Log IOS/GL_IOS/ContentView.swift`)
- iOS app → Spending screens: routes to (evidence: `Gatcha Log IOS/GL_IOS/ContentView.swift`)
- iOS app → Game information UI: routes to
- Spending screens → iOS state bridge: reads state (evidence: `Gatcha Log IOS/GL_IOS/Screens/Spending/SpendingDetailView.swift`)
- Spending view model → Account data repository: manages data (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt`)
- Account data repository → Spending records: stores records (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/GatchaRepository.kt`)
- Account data repository → Gacha reports: stores reports (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/GatchaRepository.kt`)
- Spending records → Game data: uses game definitions (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/Spending.kt`)
- Game information UI → Game data: shows game data
- Game information UI → HoYoLAB API: shows linked data
- Game information UI → HoYoLAND API: shows event guide
- Account and auth → Local key-value store: persists account (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/AuthManager.kt`)
- Account and auth → Cloud sync: syncs account (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/AuthManager.kt`)
- Spending view model → Cloud sync: syncs snapshots (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/SpendingViewModel.kt`)
- Cloud sync → Firebase / Firestore: reads and writes
- App settings → Local key-value store: stores preferences (evidence: `Gatcha Log Shared/src/commonMain/kotlin/com/gatcha/log/data/AppSettings.kt`)
- Android app → Notification planning: triggers checks (evidence: `Gatcha Log Android/src/main/java/com/gatcha/log/MainActivity.kt`)
- Notification planning → Scheduled alerts: replans alerts (evidence: `Gatcha Log Android/src/main/java/com/gatcha/log/data/work/GatchaWorker.kt`)
- Scheduled alerts → OS notifications: schedules
- HoYoLAB API → HoYoLAB services: requests game data
