# ricott1/rebels-in-the-sky architecture

> Architecture diagram of the GitHub repository ricott1/rebels-in-the-sky, 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/ricott1/rebels-in-the-sky
- Repository: https://github.com/ricott1/rebels-in-the-sky

## Overview

Rebels in the Sky is a terminal game about building a pirate crew, traveling the galaxy, and playing basketball. The principal loop runs through the application: load or initialize a world, interact through the terminal UI, simulate world events, and persist game state. The README also describes space adventures, tournaments, online challenges and trading, local bot teams, music, and optional relayer and SSH modes. Some subsystem links are based on documented capabilities and the module tree; unsampled implementation details are not inferred.

Main entry points: [`src/app.rs`](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/app.rs) (App orchestration), [`src/main.rs`](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/main.rs) (CLI entry), [`src/core/world.rs`](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/core/world.rs) (World and crew), [`src/network/handler.rs`](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/network/handler.rs) (Peer networking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Application runtime"]
  node_main["CLI entry<br/>[main.rs]"]
  node_args["Arguments<br/>[args.rs]"]
  node_app["App orchestration<br/>[app.rs]"]
  node_ticks["Tick events"]
end

subgraph group_game["Game world"]
  node_world["World and crew<br/>[world.rs]"]
  node_space["Galaxy adventure<br/>[mod.rs]"]
  node_basketball["Basketball engine<br/>[mod.rs]"]
  node_tournament["Tournaments<br/>[tournament.rs]"]
  node_store[("Save data<br/>[store.rs]")]
end

subgraph group_interface["Terminal interface"]
  node_terminal["Terminal I/O<br/>[tui.rs]"]
  node_input["Input events"]
  node_ui["Screens and panels<br/>[mod.rs]"]
  node_images["Game imagery<br/>[mod.rs]"]
end

subgraph group_connectivity["Network and services"]
  node_network["Peer networking<br/>[handler.rs]"]
  node_challenges["Challenges and trades<br/>[challenge.rs]"]
  node_music["Internet radio<br/>[music_player.rs]"]
  node_relayer["Relayer mode<br/>[relayer.rs]"]
  node_ssh["SSH game server<br/>[ssh_game.rs]"]
end

node_player(("Player"))
node_peers(("Other players"))

node_player -->|"starts"| node_main
node_main -->|"parses"| node_args
node_main -->|"runs"| node_app
node_app -->|"renders through"| node_terminal
node_input -->|"sends events"| node_app
node_ticks -->|"sends ticks"| node_app
node_app -->|"updates"| node_ui
node_ui -->|"uses imagery"| node_images
node_app -->|"simulates"| node_world
node_app -->|"loads and saves"| node_store
node_app -->|"starts polling"| node_network
node_network -->|"dispatches events"| node_app
node_network -->|"exchanges data"| node_peers
node_challenges -->|"uses peer transport"| node_network
node_player -->|"interacts"| node_ui
node_world -->|"supports adventures"| node_space
node_world -->|"supports games"| node_basketball
node_world -->|"supports tournaments"| node_tournament
node_app -.->|"starts optionally"| node_music
node_main -.->|"runs optionally"| node_relayer
node_main -.->|"runs optionally"| node_ssh

click node_main "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/main.rs"
click node_args "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/args.rs"
click node_app "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/app.rs"
click node_terminal "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/tui.rs"
click node_input "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/crossterm_event_handler.rs"
click node_ticks "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/tick_event_handler.rs"
click node_ui "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/ui/mod.rs"
click node_images "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/image/mod.rs"
click node_world "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/core/world.rs"
click node_space "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/space_adventure/mod.rs"
click node_basketball "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/game_engine/mod.rs"
click node_tournament "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/game_engine/tournament.rs"
click node_store "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/store.rs"
click node_network "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/network/handler.rs"
click node_challenges "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/network/challenge.rs"
click node_music "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/audio/music_player.rs"
click node_relayer "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/relayer.rs"
click node_ssh "https://github.com/ricott1/rebels-in-the-sky/blob/main/src/ssh_game.rs"

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_args,node_app,node_ticks toneBlue
class node_world,node_space,node_basketball,node_tournament,node_store toneAmber
class node_terminal,node_input,node_ui,node_images toneMint
class node_network,node_challenges,node_music,node_relayer,node_ssh toneRose
class node_player,node_peers toneIndigo
```

## Components

### Application runtime

- [CLI entry](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/main.rs): `src/main.rs`
- [Arguments](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/args.rs): `src/args.rs`
- [App orchestration](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/app.rs): `src/app.rs`
- [Tick events](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/tick_event_handler.rs): `src/tick_event_handler.rs`

### Game world

- [World and crew](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/core/world.rs): `src/core/world.rs`
- [Galaxy adventure](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/space_adventure/mod.rs): `src/space_adventure/mod.rs`
- [Basketball engine](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/game_engine/mod.rs): `src/game_engine/mod.rs`
- [Tournaments](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/game_engine/tournament.rs): `src/game_engine/tournament.rs`
- [Save data](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/store.rs): `src/store.rs`

### Terminal interface

- [Terminal I/O](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/tui.rs): `src/tui.rs`
- [Input events](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/crossterm_event_handler.rs): `src/crossterm_event_handler.rs`
- [Screens and panels](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/ui/mod.rs): `src/ui/mod.rs`
- [Game imagery](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/image/mod.rs): `src/image/mod.rs`

### Network and services

- [Peer networking](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/network/handler.rs): `src/network/handler.rs`
- [Challenges and trades](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/network/challenge.rs): `src/network/challenge.rs`
- [Internet radio](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/audio/music_player.rs): `src/audio/music_player.rs`
- [Relayer mode](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/relayer.rs): `src/relayer.rs`
- [SSH game server](https://github.com/ricott1/rebels-in-the-sky/blob/main/src/ssh_game.rs): `src/ssh_game.rs`

### Other components

- **Player**
- **Other players**

## Connections

- Player → CLI entry: starts
- CLI entry → Arguments: parses
- CLI entry → App orchestration: runs
- App orchestration → Terminal I/O: renders through
- Input events → App orchestration: sends events
- Tick events → App orchestration: sends ticks
- App orchestration → Screens and panels: updates
- Screens and panels → Game imagery: uses imagery
- App orchestration → World and crew: simulates
- App orchestration → Save data: loads and saves
- App orchestration → Peer networking: starts polling
- Peer networking → App orchestration: dispatches events
- Peer networking → Other players: exchanges data
- Challenges and trades → Peer networking: uses peer transport
- Player → Screens and panels: interacts
- World and crew → Galaxy adventure: supports adventures
- World and crew → Basketball engine: supports games
- World and crew → Tournaments: supports tournaments
- App orchestration → Internet radio: starts optionally
- CLI entry → Relayer mode: runs optionally
- CLI entry → SSH game server: runs optionally
