# laink/cotwgoldchallenge architecture

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

- Interactive diagram: https://gitdiagram.com/laink/cotwgoldchallenge
- Repository: https://github.com/laink/cotwgoldchallenge

## Overview

COTWGoldChallenge is a desktop companion and game mod for tracking a hunting-medal challenge. The player installs and configures it, keeps it running during play, and views harvest progress in an in-game overlay and browser dashboard. The graph preserves the documented trophy, map, timer, and rare-fur capabilities. Several connections are documented in the README; unsampled implementation details are not inferred beyond the source index.

Main entry points: [`cmd/cotwgoldchallenge/main.go`](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/main.go) (App and installer), [`internal/harvest/harvest.go`](https://github.com/laink/cotwgoldchallenge/blob/main/internal/harvest/harvest.go) (Harvest history), [`cmd/cotwgoldchallenge/history.go`](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go) (Dashboard and APIs), [`internal/apex/archive.go`](https://github.com/laink/cotwgoldchallenge/blob/main/internal/apex/archive.go) (Game archives)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop companion"]
  node_main["App and installer<br/>[main.go]"]
  node_settings_ui["Settings page<br/>[settings.go]"]
  node_shortcut["Desktop shortcut<br/>[shortcut.go]"]
  node_hotkeys["Overlay hotkeys<br/>[hotkey.go]"]
end

subgraph group_game_data["Game data"]
  node_species_data["Species and medals<br/>[species.go]"]
  node_reserve_data["Reserves and codex<br/>[reserves.go]"]
  node_maps_data["Reserve maps<br/>[zones.go]"]
  node_game_archives["Game archives<br/>[archive.go]"]
end

subgraph group_challenge["Challenge tracking"]
  node_history[("Harvest history<br/>[harvest.go]")]
  node_history_ui["Progress and statistics<br/>[history.go]"]
  node_timer["Challenge timer<br/>[timer.go]"]
  node_settings_store[("Challenge settings<br/>[settings.go]")]
end

subgraph group_mod["In-game mod"]
  node_mod_data["Mod data files<br/>[moddata.go]"]
  node_patcher["Movie patching<br/>[patch.go]"]
  node_mod_class["Overlay runtime<br/>[modclass.go]"]
end

subgraph group_dashboard["Browser dashboard"]
  node_dashboard["Dashboard and APIs<br/>[history.go]"]
  node_map_tiles["Detailed map tiles<br/>[history.go]"]
  node_icons["Species icon extraction<br/>[icons.go]"]
end

node_player(("Player"))
node_game["theHunter game"]
node_game_files[("Game files")]
node_save_log[("Hunting log")]
node_browser(("Browser user"))

node_player -->|"runs"| node_main
node_main -->|"reads archives"| node_game_archives
node_game_archives -->|"reads"| node_game_files
node_main -->|"loads species"| node_species_data
node_species_data -->|"reads archive data"| node_game_archives
node_main -->|"patches movies"| node_patcher
node_main -->|"writes mod data"| node_mod_data
node_mod_data -->|"serializes species"| node_species_data
node_mod_data -->|"serializes reserves"| node_reserve_data
node_main -->|"adds runtime classes"| node_mod_class
node_mod_class -->|"provides ActionScript"| node_patcher
node_patcher -->|"installs patched movies"| node_game
node_game -->|"records harvests"| node_save_log
node_history_ui -->|"reads hunting log"| node_save_log
node_history_ui -->|"merges harvests"| node_history
node_history -->|"filters by start date"| node_settings_store
node_player -->|"edits settings"| node_settings_ui
node_settings_ui -->|"saves settings"| node_settings_store
node_settings_store -->|"mod rereads settings"| node_game
node_player -->|"launches together"| node_shortcut
node_shortcut -->|"starts companion"| node_main
node_main -->|"enables overlay keys"| node_hotkeys
node_hotkeys -->|"toggles overlay"| node_game
node_main -->|"tracks play time"| node_timer
node_timer -->|"estimates from harvest times"| node_history
node_player -->|"opens dashboard"| node_browser
node_browser -->|"requests reports"| node_dashboard
node_dashboard -->|"summarizes harvests"| node_history
node_dashboard -->|"serves reserve maps"| node_maps_data
node_maps_data -->|"reads map regions"| node_game_archives
node_dashboard -->|"serves detailed tiles"| node_map_tiles
node_map_tiles -->|"reads archive tiles"| node_game_archives
node_dashboard -.->|"uses species icons"| node_icons
node_icons -->|"extracts game icons"| node_game
node_game -->|"reads challenge data"| node_mod_data
node_game -->|"reads harvest history"| node_history
node_history_ui -->|"adds manual trophies"| node_history

click node_main "https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/main.go"
click node_settings_ui "https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/settings.go"
click node_shortcut "https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/shortcut.go"
click node_hotkeys "https://github.com/laink/cotwgoldchallenge/blob/main/internal/hotkey/hotkey.go"
click node_species_data "https://github.com/laink/cotwgoldchallenge/blob/main/internal/game/species.go"
click node_reserve_data "https://github.com/laink/cotwgoldchallenge/blob/main/internal/game/reserves.go"
click node_maps_data "https://github.com/laink/cotwgoldchallenge/blob/main/internal/maps/zones.go"
click node_game_archives "https://github.com/laink/cotwgoldchallenge/blob/main/internal/apex/archive.go"
click node_mod_data "https://github.com/laink/cotwgoldchallenge/blob/main/internal/moddata/moddata.go"
click node_patcher "https://github.com/laink/cotwgoldchallenge/blob/main/internal/patch/patch.go"
click node_mod_class "https://github.com/laink/cotwgoldchallenge/blob/main/internal/modclass/modclass.go"
click node_history "https://github.com/laink/cotwgoldchallenge/blob/main/internal/harvest/harvest.go"
click node_history_ui "https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go"
click node_timer "https://github.com/laink/cotwgoldchallenge/blob/main/internal/timer/timer.go"
click node_settings_store "https://github.com/laink/cotwgoldchallenge/blob/main/internal/settings/settings.go"
click node_dashboard "https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go"
click node_map_tiles "https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go"
click node_icons "https://github.com/laink/cotwgoldchallenge/blob/main/internal/icons/icons.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_main,node_settings_ui,node_shortcut,node_hotkeys,node_browser toneBlue
class node_species_data,node_reserve_data,node_maps_data,node_game_archives,node_game_files,node_save_log toneAmber
class node_history,node_history_ui,node_timer,node_settings_store toneMint
class node_mod_data,node_patcher,node_mod_class toneRose
class node_dashboard,node_map_tiles,node_icons,node_player,node_game toneIndigo
```

## Components

### Desktop companion

- [App and installer](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/main.go): `cmd/cotwgoldchallenge/main.go`
- [Settings page](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/settings.go): `cmd/cotwgoldchallenge/settings.go`
- [Desktop shortcut](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/shortcut.go): `cmd/cotwgoldchallenge/shortcut.go`
- [Overlay hotkeys](https://github.com/laink/cotwgoldchallenge/blob/main/internal/hotkey/hotkey.go): `internal/hotkey/hotkey.go`

### Game data

- [Species and medals](https://github.com/laink/cotwgoldchallenge/blob/main/internal/game/species.go): `internal/game/species.go`
- [Reserves and codex](https://github.com/laink/cotwgoldchallenge/blob/main/internal/game/reserves.go): `internal/game/reserves.go`
- [Reserve maps](https://github.com/laink/cotwgoldchallenge/blob/main/internal/maps/zones.go): `internal/maps/zones.go`
- [Game archives](https://github.com/laink/cotwgoldchallenge/blob/main/internal/apex/archive.go): `internal/apex/archive.go`

### Challenge tracking

- [Harvest history](https://github.com/laink/cotwgoldchallenge/blob/main/internal/harvest/harvest.go): `internal/harvest/harvest.go`
- [Progress and statistics](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go): `cmd/cotwgoldchallenge/history.go`
- [Challenge timer](https://github.com/laink/cotwgoldchallenge/blob/main/internal/timer/timer.go): `internal/timer/timer.go`
- [Challenge settings](https://github.com/laink/cotwgoldchallenge/blob/main/internal/settings/settings.go): `internal/settings/settings.go`

### In-game mod

- [Mod data files](https://github.com/laink/cotwgoldchallenge/blob/main/internal/moddata/moddata.go): `internal/moddata/moddata.go`
- [Movie patching](https://github.com/laink/cotwgoldchallenge/blob/main/internal/patch/patch.go): `internal/patch/patch.go`
- [Overlay runtime](https://github.com/laink/cotwgoldchallenge/blob/main/internal/modclass/modclass.go): `internal/modclass/modclass.go`

### Browser dashboard

- [Dashboard and APIs](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go): `cmd/cotwgoldchallenge/history.go`
- [Detailed map tiles](https://github.com/laink/cotwgoldchallenge/blob/main/cmd/cotwgoldchallenge/history.go): `cmd/cotwgoldchallenge/history.go`
- [Species icon extraction](https://github.com/laink/cotwgoldchallenge/blob/main/internal/icons/icons.go): `internal/icons/icons.go`

### Other components

- **Player**
- **theHunter game**
- **Game files**
- **Hunting log**
- **Browser user**

## Connections

- Player → App and installer: runs
- App and installer → Game archives: reads archives (evidence: `cmd/cotwgoldchallenge/main.go`)
- Game archives → Game files: reads
- App and installer → Species and medals: loads species (evidence: `cmd/cotwgoldchallenge/main.go`)
- Species and medals → Game archives: reads archive data (evidence: `internal/game/species.go`)
- App and installer → Movie patching: patches movies (evidence: `cmd/cotwgoldchallenge/main.go`)
- App and installer → Mod data files: writes mod data (evidence: `cmd/cotwgoldchallenge/main.go`)
- Mod data files → Species and medals: serializes species (evidence: `internal/moddata/moddata.go`)
- Mod data files → Reserves and codex: serializes reserves (evidence: `internal/moddata/moddata.go`)
- App and installer → Overlay runtime: adds runtime classes (evidence: `cmd/cotwgoldchallenge/main.go`)
- Overlay runtime → Movie patching: provides ActionScript (evidence: `internal/modclass/modclass.go`)
- Movie patching → theHunter game: installs patched movies
- theHunter game → Hunting log: records harvests
- Progress and statistics → Hunting log: reads hunting log (evidence: `cmd/cotwgoldchallenge/history.go`)
- Progress and statistics → Harvest history: merges harvests (evidence: `cmd/cotwgoldchallenge/history.go`)
- Harvest history → Challenge settings: filters by start date (evidence: `internal/harvest/harvest.go`)
- Player → Settings page: edits settings
- Settings page → Challenge settings: saves settings
- Challenge settings → theHunter game: mod rereads settings
- Player → Desktop shortcut: launches together
- Desktop shortcut → App and installer: starts companion
- App and installer → Overlay hotkeys: enables overlay keys
- Overlay hotkeys → theHunter game: toggles overlay
- App and installer → Challenge timer: tracks play time
- Challenge timer → Harvest history: estimates from harvest times (evidence: `internal/timer/timer.go`)
- Player → Browser user: opens dashboard
- Browser user → Dashboard and APIs: requests reports
- Dashboard and APIs → Harvest history: summarizes harvests (evidence: `cmd/cotwgoldchallenge/history.go`)
- Dashboard and APIs → Reserve maps: serves reserve maps (evidence: `cmd/cotwgoldchallenge/history.go`)
- Reserve maps → Game archives: reads map regions (evidence: `internal/maps/zones.go`)
- Dashboard and APIs → Detailed map tiles: serves detailed tiles (evidence: `cmd/cotwgoldchallenge/history.go`)
- Detailed map tiles → Game archives: reads archive tiles (evidence: `cmd/cotwgoldchallenge/history.go`)
- Dashboard and APIs → Species icon extraction: uses species icons
- Species icon extraction → theHunter game: extracts game icons (evidence: `internal/icons/icons.go`)
- theHunter game → Mod data files: reads challenge data
- theHunter game → Harvest history: reads harvest history
- Progress and statistics → Harvest history: adds manual trophies
