# xob0t/gotohp architecture

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

- Interactive diagram: https://gitdiagram.com/xob0t/gotohp
- Repository: https://github.com/xob0t/gotohp

## Overview

gotohp is a Google Photos desktop uploader with both a Wails GUI and a standalone CLI. The user configures credentials and upload preferences, selects or drops files/directories, then follows threaded progress and per-file results. The backend also supports albums, duplicate skipping, quota/quality choices, live photos, filename dates, and token binding. The graph distinguishes documented product stages from implementation links: several Go modules were indexed but not excerpted, so uncertain internal calls are omitted or marked unverified.

Main entry points: [`core/upload.go`](https://github.com/xob0t/gotohp/blob/main/core/upload.go) (Media uploader), [`frontend/src/App.vue`](https://github.com/xob0t/gotohp/blob/main/frontend/src/App.vue) (Desktop app), [`core/configmanager.go`](https://github.com/xob0t/gotohp/blob/main/core/configmanager.go) (Config API), [`frontend/src/Upload.vue`](https://github.com/xob0t/gotohp/blob/main/frontend/src/Upload.vue) (Upload view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User interfaces"]
  node_gui["Desktop app<br/>[App.vue]"]
  node_upload_view["Upload view<br/>[Upload.vue]"]
  node_progress["Thread progress<br/>[ThreadProgress.vue]"]
  node_cli["CLI commands<br/>[cli.go]"]
  node_cli_upload["CLI upload<br/>[upload.go]"]
end

subgraph group_account["Accounts and settings"]
  node_auth_ui["Account setup"]
  node_account_select["Account selection"]
  node_settings_ui["Upload settings<br/>[SettingsPanel.vue]"]
  node_config_api["Config API<br/>[configmanager.go]"]
  node_credentials["Google credentials<br/>[googleauth.go]"]
  node_config_store[("Persistent settings<br/>[configmanager.go]")]
end

subgraph group_transfer["Upload workflow"]
  node_upload_manager["Upload state manager<br/>[UploadManager.ts]"]
  node_results["Upload results<br/>[uploadResults.ts]"]
  node_reporter["Progress reporting<br/>[wails_reporter.go]"]
end

subgraph group_engine["Upload engine"]
  node_file_scan["File preparation<br/>[filename_parser.go]"]
  node_upload_engine["Media uploader<br/>[upload.go]"]
  node_media_items["Media item creation"]
  node_photos_api["Photos API<br/>[api.go]"]
  node_albums["Album support<br/>[album.go]"]
  node_live_photo["Live photo support"]
end

node_user(("User"))

node_user -->|"uses"| node_gui
node_user -->|"runs"| node_cli
node_gui -->|"opens setup"| node_auth_ui
node_auth_ui -->|"adds credentials"| node_config_api
node_gui -->|"loads accounts"| node_config_api
node_gui -->|"shows settings"| node_settings_ui
node_settings_ui -->|"updates preferences"| node_config_api
node_cli -->|"dispatches"| node_cli_upload
node_gui -.->|"presents upload"| node_upload_view
node_upload_view -->|"tracks uploads"| node_upload_manager
node_upload_manager -->|"records results"| node_results
node_upload_view -->|"renders progress"| node_progress
node_upload_manager -.->|"receives events"| node_reporter
node_cli_upload -.->|"starts upload"| node_upload_engine
node_upload_engine -.->|"prepares files"| node_file_scan
node_upload_engine -.->|"creates items"| node_media_items
node_upload_engine -.->|"calls API"| node_photos_api
node_upload_engine -.->|"supports albums"| node_albums
node_upload_engine -.->|"uploads pairs"| node_live_photo
node_config_api -.->|"persists settings"| node_config_store
node_config_api -.->|"manages accounts"| node_credentials

click node_gui "https://github.com/xob0t/gotohp/blob/main/frontend/src/App.vue"
click node_upload_view "https://github.com/xob0t/gotohp/blob/main/frontend/src/Upload.vue"
click node_progress "https://github.com/xob0t/gotohp/blob/main/frontend/src/components/ThreadProgress.vue"
click node_cli "https://github.com/xob0t/gotohp/blob/main/internal/cli/cli.go"
click node_cli_upload "https://github.com/xob0t/gotohp/blob/main/internal/cli/upload.go"
click node_auth_ui "https://github.com/xob0t/gotohp/blob/main/frontend/src/components/GoogleAuthSetup.vue"
click node_account_select "https://github.com/xob0t/gotohp/blob/main/frontend/src/components/GoogleAccountSelect.vue"
click node_settings_ui "https://github.com/xob0t/gotohp/blob/main/frontend/src/SettingsPanel.vue"
click node_config_api "https://github.com/xob0t/gotohp/blob/main/core/configmanager.go"
click node_credentials "https://github.com/xob0t/gotohp/blob/main/core/googleauth.go"
click node_upload_manager "https://github.com/xob0t/gotohp/blob/main/frontend/src/utils/UploadManager.ts"
click node_results "https://github.com/xob0t/gotohp/blob/main/frontend/src/utils/uploadResults.ts"
click node_reporter "https://github.com/xob0t/gotohp/blob/main/internal/gui/wails_reporter.go"
click node_file_scan "https://github.com/xob0t/gotohp/blob/main/core/filename_parser.go"
click node_upload_engine "https://github.com/xob0t/gotohp/blob/main/core/upload.go"
click node_media_items "https://github.com/xob0t/gotohp/blob/main/core/create_media_items.go"
click node_photos_api "https://github.com/xob0t/gotohp/blob/main/core/api.go"
click node_albums "https://github.com/xob0t/gotohp/blob/main/core/album.go"
click node_live_photo "https://github.com/xob0t/gotohp/blob/main/core/livephoto_upload.go"
click node_config_store "https://github.com/xob0t/gotohp/blob/main/core/configmanager.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_gui,node_upload_view,node_progress,node_cli,node_cli_upload,node_user toneBlue
class node_auth_ui,node_account_select,node_settings_ui,node_config_api,node_credentials,node_config_store toneAmber
class node_upload_manager,node_results,node_reporter toneMint
class node_file_scan,node_upload_engine,node_media_items,node_photos_api,node_albums,node_live_photo toneRose
```

## Components

### User interfaces

- [Desktop app](https://github.com/xob0t/gotohp/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Upload view](https://github.com/xob0t/gotohp/blob/main/frontend/src/Upload.vue): `frontend/src/Upload.vue`
- [Thread progress](https://github.com/xob0t/gotohp/blob/main/frontend/src/components/ThreadProgress.vue): `frontend/src/components/ThreadProgress.vue`
- [CLI commands](https://github.com/xob0t/gotohp/blob/main/internal/cli/cli.go): `internal/cli/cli.go`
- [CLI upload](https://github.com/xob0t/gotohp/blob/main/internal/cli/upload.go): `internal/cli/upload.go`

### Accounts and settings

- [Account setup](https://github.com/xob0t/gotohp/blob/main/frontend/src/components/GoogleAuthSetup.vue): `frontend/src/components/GoogleAuthSetup.vue`
- [Account selection](https://github.com/xob0t/gotohp/blob/main/frontend/src/components/GoogleAccountSelect.vue): `frontend/src/components/GoogleAccountSelect.vue`
- [Upload settings](https://github.com/xob0t/gotohp/blob/main/frontend/src/SettingsPanel.vue): `frontend/src/SettingsPanel.vue`
- [Config API](https://github.com/xob0t/gotohp/blob/main/core/configmanager.go): `core/configmanager.go`
- [Google credentials](https://github.com/xob0t/gotohp/blob/main/core/googleauth.go): `core/googleauth.go`
- [Persistent settings](https://github.com/xob0t/gotohp/blob/main/core/configmanager.go): `core/configmanager.go`

### Upload workflow

- [Upload state manager](https://github.com/xob0t/gotohp/blob/main/frontend/src/utils/UploadManager.ts): `frontend/src/utils/UploadManager.ts`
- [Upload results](https://github.com/xob0t/gotohp/blob/main/frontend/src/utils/uploadResults.ts): `frontend/src/utils/uploadResults.ts`
- [Progress reporting](https://github.com/xob0t/gotohp/blob/main/internal/gui/wails_reporter.go): `internal/gui/wails_reporter.go`

### Upload engine

- [File preparation](https://github.com/xob0t/gotohp/blob/main/core/filename_parser.go): `core/filename_parser.go`
- [Media uploader](https://github.com/xob0t/gotohp/blob/main/core/upload.go): `core/upload.go`
- [Media item creation](https://github.com/xob0t/gotohp/blob/main/core/create_media_items.go): `core/create_media_items.go`
- [Photos API](https://github.com/xob0t/gotohp/blob/main/core/api.go): `core/api.go`
- [Album support](https://github.com/xob0t/gotohp/blob/main/core/album.go): `core/album.go`
- [Live photo support](https://github.com/xob0t/gotohp/blob/main/core/livephoto_upload.go): `core/livephoto_upload.go`

### Other components

- **User**

## Connections

- User → Desktop app: uses
- User → CLI commands: runs
- Desktop app → Account setup: opens setup (evidence: `frontend/src/App.vue`)
- Account setup → Config API: adds credentials (evidence: `frontend/src/components/GoogleAuthSetup.vue`)
- Desktop app → Config API: loads accounts (evidence: `frontend/src/App.vue`)
- Desktop app → Upload settings: shows settings (evidence: `frontend/src/App.vue`)
- Upload settings → Config API: updates preferences (evidence: `frontend/src/SettingsPanel.vue`)
- CLI commands → CLI upload: dispatches
- Desktop app → Upload view: presents upload (evidence: `frontend/src/App.vue`)
- Upload view → Upload state manager: tracks uploads (evidence: `frontend/src/Upload.vue`)
- Upload state manager → Upload results: records results (evidence: `frontend/src/utils/UploadManager.ts`)
- Upload view → Thread progress: renders progress (evidence: `frontend/src/Upload.vue`)
- Upload state manager → Progress reporting: receives events
- CLI upload → Media uploader: starts upload
- Media uploader → File preparation: prepares files
- Media uploader → Media item creation: creates items
- Media uploader → Photos API: calls API
- Media uploader → Album support: supports albums
- Media uploader → Live photo support: uploads pairs
- Config API → Persistent settings: persists settings (evidence: `core/configmanager.go`)
- Config API → Google credentials: manages accounts
