# yoru0/maidata architecture

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

- Interactive diagram: https://gitdiagram.com/yoru0/maidata
- Repository: https://github.com/yoru0/maidata

## Overview

maidata is an early-WIP terminal tool intended to curate a personal maimai chart library. The current executable starts a Bubble Tea menu, but the README explicitly says its batch operations are not wired up and the chart parser is empty; the processing stages below therefore describe the documented target workflow, not implemented calls. Drive and zetaraku clients exist as separate integrations, but sampled source shows no connection from the menu to them.

Main entry points: [`internal/tui/model.go`](https://github.com/yoru0/maidata/blob/main/internal/tui/model.go) (TUI menu), [`internal`](https://github.com/yoru0/maidata/tree/main/internal) (Archive extraction), [`internal/zetaraku/client.go`](https://github.com/yoru0/maidata/blob/main/internal/zetaraku/client.go) (Zetaraku client), [`cmd/maidata/main.go`](https://github.com/yoru0/maidata/blob/main/cmd/maidata/main.go) (CLI entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Terminal interface"]
  node_entry["CLI entry<br/>[main.go]"]
  node_menu["TUI menu<br/>[model.go]"]
end

subgraph group_workflow["Chart curation workflow"]
  node_download["Pack download"]
  node_extract["Archive extraction"]
  node_clean["Chart cleanup"]
  node_validate["Chart validation"]
  node_browse["Chart browsing"]
end

subgraph group_integrations["External data"]
  node_driveclient["Drive client<br/>[client.go]"]
  node_zetaclient["Zetaraku client<br/>[client.go]"]
  node_zetadb[("Song constants<br/>[db.go]")]
end

subgraph group_support["Configuration and chart data"]
  node_config["Configuration<br/>[config.go]"]
  node_level["Level types<br/>[level.go]"]
end

node_user(("Library curator"))
node_drive["Google Drive"]
node_zetaraku["Zetaraku data"]

node_user -->|"starts"| node_entry
node_entry -->|"runs"| node_menu
node_menu -->|"lists choice"| node_download
node_menu -->|"lists choice"| node_extract
node_menu -->|"lists choices"| node_clean
node_menu -->|"lists choice"| node_validate
node_menu -->|"lists choice"| node_browse
node_download -->|"followed by"| node_extract
node_extract -->|"followed by"| node_clean
node_driveclient -->|"lists and downloads"| node_drive
node_zetaclient -->|"fetches data"| node_zetaraku
node_zetaclient -->|"builds database"| node_zetadb
node_zetadb -->|"matches levels"| node_level

click node_entry "https://github.com/yoru0/maidata/blob/main/cmd/maidata/main.go"
click node_menu "https://github.com/yoru0/maidata/blob/main/internal/tui/model.go"
click node_download "https://github.com/yoru0/maidata/tree/main/internal"
click node_extract "https://github.com/yoru0/maidata/tree/main/internal"
click node_clean "https://github.com/yoru0/maidata/tree/main/internal"
click node_validate "https://github.com/yoru0/maidata/tree/main/internal"
click node_browse "https://github.com/yoru0/maidata/tree/main/internal"
click node_driveclient "https://github.com/yoru0/maidata/blob/main/internal/drive/client.go"
click node_zetaclient "https://github.com/yoru0/maidata/blob/main/internal/zetaraku/client.go"
click node_zetadb "https://github.com/yoru0/maidata/blob/main/internal/zetaraku/db.go"
click node_config "https://github.com/yoru0/maidata/blob/main/internal/config/config.go"
click node_level "https://github.com/yoru0/maidata/blob/main/internal/chart/level.go"

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_entry,node_menu toneBlue
class node_download,node_extract,node_clean,node_validate,node_browse toneAmber
class node_driveclient,node_zetaclient,node_zetadb toneMint
class node_config,node_level toneRose
class node_user,node_drive,node_zetaraku toneIndigo
```

## Components

### Terminal interface

- [CLI entry](https://github.com/yoru0/maidata/blob/main/cmd/maidata/main.go): `cmd/maidata/main.go`
- [TUI menu](https://github.com/yoru0/maidata/blob/main/internal/tui/model.go): `internal/tui/model.go`

### Chart curation workflow

- [Pack download](https://github.com/yoru0/maidata/tree/main/internal): `internal`
- [Archive extraction](https://github.com/yoru0/maidata/tree/main/internal): `internal`
- [Chart cleanup](https://github.com/yoru0/maidata/tree/main/internal): `internal`
- [Chart validation](https://github.com/yoru0/maidata/tree/main/internal): `internal`
- [Chart browsing](https://github.com/yoru0/maidata/tree/main/internal): `internal`

### External data

- [Drive client](https://github.com/yoru0/maidata/blob/main/internal/drive/client.go): `internal/drive/client.go`
- [Zetaraku client](https://github.com/yoru0/maidata/blob/main/internal/zetaraku/client.go): `internal/zetaraku/client.go`
- [Song constants](https://github.com/yoru0/maidata/blob/main/internal/zetaraku/db.go): `internal/zetaraku/db.go`

### Configuration and chart data

- [Configuration](https://github.com/yoru0/maidata/blob/main/internal/config/config.go): `internal/config/config.go`
- [Level types](https://github.com/yoru0/maidata/blob/main/internal/chart/level.go): `internal/chart/level.go`

### Other components

- **Library curator**
- **Google Drive**
- **Zetaraku data**

## Connections

- Library curator → CLI entry: starts (evidence: `cmd/maidata/main.go`)
- CLI entry → TUI menu: runs (evidence: `cmd/maidata/main.go`)
- TUI menu → Pack download: lists choice (evidence: `internal/tui/model.go`)
- TUI menu → Archive extraction: lists choice (evidence: `internal/tui/model.go`)
- TUI menu → Chart cleanup: lists choices (evidence: `internal/tui/model.go`)
- TUI menu → Chart validation: lists choice (evidence: `internal/tui/model.go`)
- TUI menu → Chart browsing: lists choice (evidence: `internal/tui/model.go`)
- Pack download → Archive extraction: followed by (evidence: `README.md`)
- Archive extraction → Chart cleanup: followed by (evidence: `README.md`)
- Drive client → Google Drive: lists and downloads (evidence: `internal/drive/client.go`)
- Zetaraku client → Zetaraku data: fetches data (evidence: `internal/zetaraku/client.go`)
- Zetaraku client → Song constants: builds database (evidence: `internal/zetaraku/client.go`)
- Song constants → Level types: matches levels (evidence: `internal/zetaraku/db.go`)
