# slinky2026/pipboy architecture

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

- Interactive diagram: https://gitdiagram.com/slinky2026/pipboy
- Repository: https://github.com/slinky2026/pipboy

## Overview

Pypboy is a Pygame Pip-Boy-style interface. The main workflow takes keyboard or touch input, routes navigation to one of five screens, and draws the active screen over a themed frame. Those screens expose status and sensors, inventory, data, GPS-backed maps, and local radio playback. Shared app state and reusable widgets support the screens; GPS, sensor, weather, map-tile, and audio resources provide device or external data. The map excerpt is partial, and the README is empty, so unsampled subsystem details are not inferred.

Main entry points: [`src/pypboy/core.py`](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/core.py) (Pypboy Runtime), [`src/pypboy/screens/stats.py`](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/stats.py) (Status Screen), [`src/pypboy/screens/map.py`](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/map.py) (Map Screen), [`src/pypboy/screens/inventory.py`](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/inventory.py) (Inventory Screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_runtime["Pypboy Runtime<br/>[core.py]"]
end

subgraph group_screens["Pip-Boy Screens"]
  node_stats["Status Screen<br/>[stats.py]"]
  node_inventory["Inventory Screen<br/>[inventory.py]"]
  node_data_screen["Data Screen<br/>[data.py]"]
  node_map_screen["Map Screen<br/>[map.py]"]
  node_radio["Radio Screen<br/>[radio.py]"]
  node_screen_base["Screen Base<br/>[base.py]"]
end

subgraph group_state["Shared Data"]
  node_app_state["App State<br/>[data.py]"]
end

subgraph group_input["Input Handling"]
  node_input_manager["Input Manager<br/>[manager.py]"]
  node_actions["Action Types<br/>[actions.py]"]
end

subgraph group_integrations["Device And Media"]
  node_gps["GPS Reader<br/>[gps_reader.py]"]
  node_sensors["Sensor Reader<br/>[sensor_reader.py]"]
  node_tile_cache[("Tile Disk Cache")]
  node_audio_files["Radio Audio"]
end

subgraph group_ui["Interface"]
  node_theme["Theme Loader<br/>[theme.py]"]
  node_widgets["Display Widgets<br/>[widgets.py]"]
end

node_user(("User"))
node_weather["Weather Service"]
node_tile_service["Map Tile Service"]

node_user -->|"operates"| node_runtime
node_runtime -->|"processes input"| node_input_manager
node_input_manager -->|"queues actions"| node_actions
node_runtime -->|"routes actions"| node_actions
node_runtime -->|"dispatches events"| node_stats
node_runtime -->|"dispatches events"| node_inventory
node_runtime -->|"dispatches events"| node_data_screen
node_runtime -->|"dispatches events"| node_map_screen
node_runtime -->|"dispatches events"| node_radio
node_runtime -->|"creates state"| node_app_state
node_runtime -->|"loads theme"| node_theme
node_inventory -->|"reads inventory"| node_app_state
node_stats -->|"reads vitals"| node_app_state
node_data_screen -->|"uses state"| node_app_state
node_map_screen -->|"reads coordinates"| node_gps
node_stats -->|"reads measurements"| node_sensors
node_stats -->|"fetches temperature"| node_weather
node_map_screen -->|"requests tiles"| node_tile_service
node_map_screen -->|"reads and writes"| node_tile_cache
node_radio -->|"loads tracks"| node_audio_files
node_inventory -->|"renders list"| node_widgets
node_stats -->|"draws meters"| node_widgets
node_inventory -->|"extends"| node_screen_base
node_map_screen -->|"extends"| node_screen_base
node_radio -->|"extends"| node_screen_base
node_data_screen -->|"extends"| node_screen_base

click node_runtime "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/core.py"
click node_stats "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/stats.py"
click node_inventory "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/inventory.py"
click node_data_screen "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/data.py"
click node_map_screen "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/map.py"
click node_radio "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/radio.py"
click node_app_state "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/data.py"
click node_input_manager "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/input/manager.py"
click node_actions "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/input/actions.py"
click node_gps "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/gps_reader.py"
click node_sensors "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/sensor_reader.py"
click node_tile_cache "https://github.com/slinky2026/pipboy/tree/main/cache/tiles"
click node_audio_files "https://github.com/slinky2026/pipboy/tree/main/assets/audio"
click node_theme "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/ui/theme.py"
click node_widgets "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/ui/widgets.py"
click node_screen_base "https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/base.py"

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_runtime,node_user toneBlue
class node_stats,node_inventory,node_data_screen,node_map_screen,node_radio,node_screen_base toneAmber
class node_app_state toneMint
class node_input_manager,node_actions toneRose
class node_gps,node_sensors,node_tile_cache,node_audio_files,node_weather,node_tile_service toneIndigo
class node_theme,node_widgets toneTeal
```

## Components

### Application

- [Pypboy Runtime](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/core.py): `src/pypboy/core.py`

### Pip-Boy Screens

- [Status Screen](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/stats.py): `src/pypboy/screens/stats.py`
- [Inventory Screen](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/inventory.py): `src/pypboy/screens/inventory.py`
- [Data Screen](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/data.py): `src/pypboy/screens/data.py`
- [Map Screen](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/map.py): `src/pypboy/screens/map.py`
- [Radio Screen](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/radio.py): `src/pypboy/screens/radio.py`
- [Screen Base](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/screens/base.py): `src/pypboy/screens/base.py`

### Shared Data

- [App State](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/data.py): `src/pypboy/data.py`

### Input Handling

- [Input Manager](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/input/manager.py): `src/pypboy/input/manager.py`
- [Action Types](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/input/actions.py): `src/pypboy/input/actions.py`

### Device And Media

- [GPS Reader](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/gps_reader.py): `src/pypboy/gps_reader.py`
- [Sensor Reader](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/sensor_reader.py): `src/pypboy/sensor_reader.py`
- [Tile Disk Cache](https://github.com/slinky2026/pipboy/tree/main/cache/tiles): `cache/tiles`
- [Radio Audio](https://github.com/slinky2026/pipboy/tree/main/assets/audio): `assets/audio`

### Interface

- [Theme Loader](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/ui/theme.py): `src/pypboy/ui/theme.py`
- [Display Widgets](https://github.com/slinky2026/pipboy/blob/main/src/pypboy/ui/widgets.py): `src/pypboy/ui/widgets.py`

### Other components

- **User**
- **Weather Service**
- **Map Tile Service**

## Connections

- User → Pypboy Runtime: operates (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Input Manager: processes input (evidence: `src/pypboy/core.py`)
- Input Manager → Action Types: queues actions (evidence: `src/pypboy/input/manager.py`)
- Pypboy Runtime → Action Types: routes actions (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Status Screen: dispatches events (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Inventory Screen: dispatches events (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Data Screen: dispatches events (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Map Screen: dispatches events (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Radio Screen: dispatches events (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → App State: creates state (evidence: `src/pypboy/core.py`)
- Pypboy Runtime → Theme Loader: loads theme (evidence: `src/pypboy/core.py`)
- Inventory Screen → App State: reads inventory (evidence: `src/pypboy/screens/inventory.py`)
- Status Screen → App State: reads vitals (evidence: `src/pypboy/screens/stats.py`)
- Data Screen → App State: uses state (evidence: `src/pypboy/screens/data.py`)
- Map Screen → GPS Reader: reads coordinates (evidence: `src/pypboy/screens/map.py`)
- Status Screen → Sensor Reader: reads measurements (evidence: `src/pypboy/screens/stats.py`)
- Status Screen → Weather Service: fetches temperature (evidence: `src/pypboy/screens/stats.py`)
- Map Screen → Map Tile Service: requests tiles (evidence: `src/pypboy/screens/map.py`)
- Map Screen → Tile Disk Cache: reads and writes (evidence: `src/pypboy/screens/map.py`)
- Radio Screen → Radio Audio: loads tracks (evidence: `src/pypboy/screens/radio.py`)
- Inventory Screen → Display Widgets: renders list (evidence: `src/pypboy/screens/inventory.py`)
- Status Screen → Display Widgets: draws meters (evidence: `src/pypboy/screens/stats.py`)
- Inventory Screen → Screen Base: extends (evidence: `src/pypboy/screens/inventory.py`)
- Map Screen → Screen Base: extends (evidence: `src/pypboy/screens/map.py`)
- Radio Screen → Screen Base: extends (evidence: `src/pypboy/screens/radio.py`)
- Data Screen → Screen Base: extends (evidence: `src/pypboy/screens/data.py`)
