# admiral-billy/pokerogue-app architecture

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

- Interactive diagram: https://gitdiagram.com/admiral-billy/pokerogue-app
- Repository: https://github.com/admiral-billy/pokerogue-app

## Overview

PokeRogue App is an Electron desktop wrapper for playing Pokerogue.net, with optional local offline game files. The main workflow launches a window into the online or downloaded game; users can change modes and presentation settings, download game releases for offline play, and open companion reference tools. The graph shows the main-process orchestration, menu-driven product features, and selected integrations. Some utility-window implementations and settings helpers were only partially sampled, so uncertain internal wiring is omitted.

Main entry points: [`src/utils.js`](https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils.js) (Window and app services), [`src/main.js`](https://github.com/admiral-billy/pokerogue-app/blob/main/src/main.js) (Window orchestration), [`src/file_tab.js`](https://github.com/admiral-billy/pokerogue-app/blob/main/src/file_tab.js) (File actions), [`src/settings_tab.js`](https://github.com/admiral-billy/pokerogue-app/blob/main/src/settings_tab.js) (Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["App runtime"]
  node_main["Window orchestration<br/>[main.js]"]
  node_globals["Shared state<br/>[globals.js]"]
  node_preload["Renderer bridge<br/>[utils_preload.js]"]
  node_utils["Window and app services<br/>[utils.js]"]
  node_shortcuts["Local shortcuts<br/>[local_shortcuts.js]"]
end

subgraph group_menus["Menu features"]
  node_filemenu["File actions<br/>[file_tab.js]"]
  node_settingsmenu["Settings<br/>[settings_tab.js]"]
  node_utilities["Reference utilities<br/>[utilities_tab.js]"]
  node_about["About and links<br/>[about_tab.js]"]
end

subgraph group_state["Settings and files"]
  node_settingsfile[("User settings<br/>[utils.js]")]
  node_gamefiles[("Offline game files<br/>[file_tab.js]")]
end

subgraph group_integrations["External integrations"]
  node_presence["Rich presence<br/>[discord_rpc.js]"]
  node_game["Pokerogue game"]
  node_releaseapi["GitHub releases"]
  node_discord["Discord RPC service"]
  node_reference["Reference websites"]
end

node_user(("Player"))

node_user -->|"launches"| node_main
node_main -->|"loads settings and menu"| node_utils
node_main -->|"registers shortcuts"| node_shortcuts
node_main -->|"starts presence"| node_presence
node_main -->|"sets runtime state"| node_globals
node_main -->|"loads online or offline"| node_game
node_utils -->|"configures window bridge"| node_preload
node_utils -->|"builds menu from"| node_filemenu
node_utils -->|"builds menu from"| node_settingsmenu
node_utils -->|"builds menu from"| node_utilities
node_utils -->|"builds menu from"| node_about
node_utils -->|"reads and writes"| node_settingsfile
node_settingsmenu -->|"applies settings"| node_utils
node_settingsmenu -->|"changes mode and options"| node_globals
node_filemenu -->|"resets and downloads"| node_utils
node_filemenu -->|"requests game release"| node_releaseapi
node_filemenu -->|"extracts downloaded files"| node_gamefiles
node_filemenu -->|"updates offline state"| node_globals
node_about -->|"fetches version info"| node_utils
node_utils -->|"requests app and game versions"| node_releaseapi
node_utilities -->|"creates utility windows"| node_utils
node_utilities -->|"opens reference pages"| node_reference
node_presence -->|"reads game status"| node_game
node_presence -->|"updates activity"| node_discord

click node_main "https://github.com/admiral-billy/pokerogue-app/blob/main/src/main.js"
click node_globals "https://github.com/admiral-billy/pokerogue-app/blob/main/src/globals.js"
click node_preload "https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils_preload.js"
click node_utils "https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils.js"
click node_shortcuts "https://github.com/admiral-billy/pokerogue-app/blob/main/src/local_shortcuts.js"
click node_presence "https://github.com/admiral-billy/pokerogue-app/blob/main/src/discord_rpc.js"
click node_filemenu "https://github.com/admiral-billy/pokerogue-app/blob/main/src/file_tab.js"
click node_settingsmenu "https://github.com/admiral-billy/pokerogue-app/blob/main/src/settings_tab.js"
click node_utilities "https://github.com/admiral-billy/pokerogue-app/blob/main/src/utilities_tab.js"
click node_about "https://github.com/admiral-billy/pokerogue-app/blob/main/src/about_tab.js"
click node_settingsfile "https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils.js"
click node_gamefiles "https://github.com/admiral-billy/pokerogue-app/blob/main/src/file_tab.js"

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_globals,node_preload,node_utils,node_shortcuts toneBlue
class node_filemenu,node_settingsmenu,node_utilities,node_about toneAmber
class node_settingsfile,node_gamefiles toneMint
class node_presence,node_game,node_releaseapi,node_discord,node_reference toneRose
class node_user toneIndigo
```

## Components

### App runtime

- [Window orchestration](https://github.com/admiral-billy/pokerogue-app/blob/main/src/main.js): `src/main.js`
- [Shared state](https://github.com/admiral-billy/pokerogue-app/blob/main/src/globals.js): `src/globals.js`
- [Renderer bridge](https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils_preload.js): `src/utils_preload.js`
- [Window and app services](https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils.js): `src/utils.js`
- [Local shortcuts](https://github.com/admiral-billy/pokerogue-app/blob/main/src/local_shortcuts.js): `src/local_shortcuts.js`

### Menu features

- [File actions](https://github.com/admiral-billy/pokerogue-app/blob/main/src/file_tab.js): `src/file_tab.js`
- [Settings](https://github.com/admiral-billy/pokerogue-app/blob/main/src/settings_tab.js): `src/settings_tab.js`
- [Reference utilities](https://github.com/admiral-billy/pokerogue-app/blob/main/src/utilities_tab.js): `src/utilities_tab.js`
- [About and links](https://github.com/admiral-billy/pokerogue-app/blob/main/src/about_tab.js): `src/about_tab.js`

### Settings and files

- [User settings](https://github.com/admiral-billy/pokerogue-app/blob/main/src/utils.js): `src/utils.js`
- [Offline game files](https://github.com/admiral-billy/pokerogue-app/blob/main/src/file_tab.js): `src/file_tab.js`

### External integrations

- [Rich presence](https://github.com/admiral-billy/pokerogue-app/blob/main/src/discord_rpc.js): `src/discord_rpc.js`
- **Pokerogue game**
- **GitHub releases**
- **Discord RPC service**
- **Reference websites**

### Other components

- **Player**

## Connections

- Player → Window orchestration: launches
- Window orchestration → Window and app services: loads settings and menu
- Window orchestration → Local shortcuts: registers shortcuts
- Window orchestration → Rich presence: starts presence
- Window orchestration → Shared state: sets runtime state
- Window orchestration → Pokerogue game: loads online or offline
- Window and app services → Renderer bridge: configures window bridge
- Window and app services → File actions: builds menu from
- Window and app services → Settings: builds menu from
- Window and app services → Reference utilities: builds menu from
- Window and app services → About and links: builds menu from
- Window and app services → User settings: reads and writes
- Settings → Window and app services: applies settings
- Settings → Shared state: changes mode and options
- File actions → Window and app services: resets and downloads
- File actions → GitHub releases: requests game release
- File actions → Offline game files: extracts downloaded files
- File actions → Shared state: updates offline state
- About and links → Window and app services: fetches version info
- Window and app services → GitHub releases: requests app and game versions
- Reference utilities → Window and app services: creates utility windows
- Reference utilities → Reference websites: opens reference pages
- Rich presence → Pokerogue game: reads game status
- Rich presence → Discord RPC service: updates activity
