# dheison0/ps2-game-manager architecture

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

- Interactive diagram: https://gitdiagram.com/dheison0/ps2-game-manager
- Repository: https://github.com/dheison0/ps2-game-manager

## Overview

PS2 Game Manager is a command-line terminal application for managing Open PS2 Loader games in a user-supplied directory. Its principal workflow is to load the OPL catalog, present games in a terminal UI, and let users install, rename, delete, or export them; cover downloading is another documented capability. The manager maintains the catalog and game-part files, while utilities read ISO contents and resize images. The README and sampled files establish the major capabilities, but install, cover, and cleanup UI wiring is not fully evidenced, so uncertain connections are omitted.

Main entry points: [`manager/manager.go`](https://github.com/dheison0/ps2-game-manager/blob/main/manager/manager.go) (Manager), [`manager/game.go`](https://github.com/dheison0/ps2-game-manager/blob/main/manager/game.go) (Game model), [`tui/actions.go`](https://github.com/dheison0/ps2-game-manager/blob/main/tui/actions.go) (Game actions), [`main.go`](https://github.com/dheison0/ps2-game-manager/blob/main/main.go) (Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Application"]
  node_entry["Startup<br/>[main.go]"]
end

subgraph group_interface["Terminal interface"]
  node_terminal["Terminal UI<br/>[init.go]"]
  node_menu["Game list<br/>[menu.go]"]
  node_actions["Game actions<br/>[actions.go]"]
  node_installer["Install screen<br/>[install.go]"]
  node_selector["File selector<br/>[fileSelector.go]"]
  node_exporter["Export screen<br/>[gameExporter.go]"]
  node_coversui["Cover screen<br/>[covers.go]"]
  node_cleanerui["Cleanup screen<br/>[cleaner.go]"]
  node_errors["Error dialog<br/>[errorDialog.go]"]
end

subgraph group_management["Game management"]
  node_manager["Manager<br/>[manager.go]"]
  node_catalog[("OPL catalog<br/>[manager.go]")]
  node_game["Game model<br/>[game.go]"]
end

subgraph group_assets["Game assets"]
  node_iso["ISO reader<br/>[byteWorks.go]"]
  node_images["Image resizing<br/>[images.go]"]
  node_cleanup["Orphan cleanup<br/>[cleaner.go]"]
end

node_user(("Operator"))
node_cover_service(("Cover repository"))

node_user -->|"starts"| node_entry
node_entry -->|"initializes"| node_manager
node_entry -->|"starts UI"| node_terminal
node_terminal -->|"presents"| node_menu
node_menu -->|"opens actions"| node_actions
node_actions -->|"renames or deletes"| node_manager
node_actions -->|"opens export"| node_exporter
node_exporter -->|"selects folder"| node_selector
node_exporter -->|"exports ISO"| node_game
node_manager -->|"reads and writes"| node_catalog
node_manager -->|"creates games"| node_game
node_manager -->|"reads ISO metadata"| node_iso
node_game -->|"serializes config"| node_catalog
node_installer -->|"selects ISO"| node_selector
node_coversui -->|"manages covers"| node_game
node_game -.->|"downloads cover"| node_cover_service
node_game -->|"resizes cover"| node_images
node_cleanerui -->|"cleans unused files"| node_cleanup
node_cleanup -->|"checks installed files"| node_manager
node_actions -->|"reports errors"| node_errors

click node_entry "https://github.com/dheison0/ps2-game-manager/blob/main/main.go"
click node_manager "https://github.com/dheison0/ps2-game-manager/blob/main/manager/manager.go"
click node_catalog "https://github.com/dheison0/ps2-game-manager/blob/main/manager/manager.go"
click node_game "https://github.com/dheison0/ps2-game-manager/blob/main/manager/game.go"
click node_terminal "https://github.com/dheison0/ps2-game-manager/blob/main/tui/init.go"
click node_menu "https://github.com/dheison0/ps2-game-manager/blob/main/tui/menu.go"
click node_actions "https://github.com/dheison0/ps2-game-manager/blob/main/tui/actions.go"
click node_installer "https://github.com/dheison0/ps2-game-manager/blob/main/tui/install.go"
click node_selector "https://github.com/dheison0/ps2-game-manager/blob/main/tui/fileSelector.go"
click node_exporter "https://github.com/dheison0/ps2-game-manager/blob/main/tui/gameExporter.go"
click node_coversui "https://github.com/dheison0/ps2-game-manager/blob/main/tui/covers.go"
click node_cleanerui "https://github.com/dheison0/ps2-game-manager/blob/main/tui/cleaner.go"
click node_errors "https://github.com/dheison0/ps2-game-manager/blob/main/tui/errorDialog.go"
click node_iso "https://github.com/dheison0/ps2-game-manager/blob/main/utils/byteWorks.go"
click node_images "https://github.com/dheison0/ps2-game-manager/blob/main/utils/images.go"
click node_cleanup "https://github.com/dheison0/ps2-game-manager/blob/main/cleaner/cleaner.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 toneBlue
class node_terminal,node_menu,node_actions,node_installer,node_selector,node_exporter,node_coversui,node_cleanerui,node_errors toneAmber
class node_manager,node_catalog,node_game toneMint
class node_iso,node_images,node_cleanup toneRose
class node_user,node_cover_service toneIndigo
```

## Components

### Application

- [Startup](https://github.com/dheison0/ps2-game-manager/blob/main/main.go): `main.go`

### Terminal interface

- [Terminal UI](https://github.com/dheison0/ps2-game-manager/blob/main/tui/init.go): `tui/init.go`
- [Game list](https://github.com/dheison0/ps2-game-manager/blob/main/tui/menu.go): `tui/menu.go`
- [Game actions](https://github.com/dheison0/ps2-game-manager/blob/main/tui/actions.go): `tui/actions.go`
- [Install screen](https://github.com/dheison0/ps2-game-manager/blob/main/tui/install.go): `tui/install.go`
- [File selector](https://github.com/dheison0/ps2-game-manager/blob/main/tui/fileSelector.go): `tui/fileSelector.go`
- [Export screen](https://github.com/dheison0/ps2-game-manager/blob/main/tui/gameExporter.go): `tui/gameExporter.go`
- [Cover screen](https://github.com/dheison0/ps2-game-manager/blob/main/tui/covers.go): `tui/covers.go`
- [Cleanup screen](https://github.com/dheison0/ps2-game-manager/blob/main/tui/cleaner.go): `tui/cleaner.go`
- [Error dialog](https://github.com/dheison0/ps2-game-manager/blob/main/tui/errorDialog.go): `tui/errorDialog.go`

### Game management

- [Manager](https://github.com/dheison0/ps2-game-manager/blob/main/manager/manager.go): `manager/manager.go`
- [OPL catalog](https://github.com/dheison0/ps2-game-manager/blob/main/manager/manager.go): `manager/manager.go`
- [Game model](https://github.com/dheison0/ps2-game-manager/blob/main/manager/game.go): `manager/game.go`

### Game assets

- [ISO reader](https://github.com/dheison0/ps2-game-manager/blob/main/utils/byteWorks.go): `utils/byteWorks.go`
- [Image resizing](https://github.com/dheison0/ps2-game-manager/blob/main/utils/images.go): `utils/images.go`
- [Orphan cleanup](https://github.com/dheison0/ps2-game-manager/blob/main/cleaner/cleaner.go): `cleaner/cleaner.go`

### Other components

- **Operator**
- **Cover repository**

## Connections

- Operator → Startup: starts
- Startup → Manager: initializes
- Startup → Terminal UI: starts UI
- Terminal UI → Game list: presents
- Game list → Game actions: opens actions
- Game actions → Manager: renames or deletes
- Game actions → Export screen: opens export
- Export screen → File selector: selects folder
- Export screen → Game model: exports ISO
- Manager → OPL catalog: reads and writes
- Manager → Game model: creates games
- Manager → ISO reader: reads ISO metadata
- Game model → OPL catalog: serializes config
- Install screen → File selector: selects ISO
- Cover screen → Game model: manages covers
- Game model → Cover repository: downloads cover
- Game model → Image resizing: resizes cover
- Cleanup screen → Orphan cleanup: cleans unused files
- Orphan cleanup → Manager: checks installed files
- Game actions → Error dialog: reports errors
