# glapko/oxihex architecture

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

- Interactive diagram: https://gitdiagram.com/glapko/oxihex
- Repository: https://github.com/glapko/oxihex

## Overview

Oxihex is a Rust hex-strategy game prototype: the README describes simultaneous seasonal turns, a player-authored Chronicle, and vassalage. The sampled runtime currently consists of a Bevy client that starts a 2D camera and a minimal Bevy server; shared code defines players and serializable world, chunk, tile, and hex types. The README capabilities are shown as documented systems, not implemented flows. Source excerpts establish the shared-model dependencies; they do not show networking or gameplay orchestration.

Main entry points: [`common/src/lib.rs`](https://github.com/glapko/oxihex/blob/main/common/src/lib.rs) (Shared API), [`common/src/world.rs`](https://github.com/glapko/oxihex/blob/main/common/src/world.rs) (World state), [`common/src/world/chunk.rs`](https://github.com/glapko/oxihex/blob/main/common/src/world/chunk.rs) (World chunks), [`common/src/world/chunk/tile.rs`](https://github.com/glapko/oxihex/blob/main/common/src/world/chunk/tile.rs) (Tile ownership)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime shells"]
  node_client_app["Client app<br/>[main.rs]"]
  node_server_app["Server app<br/>[main.rs]"]
end

subgraph group_shared["Shared game model"]
  node_shared_api["Shared API<br/>[lib.rs]"]
  node_player["Player records<br/>[player.rs]"]
  node_world["World state<br/>[world.rs]"]
  node_chunks["World chunks<br/>[chunk.rs]"]
  node_tiles["Tile ownership<br/>[tile.rs]"]
  node_hex_coords["Hex coordinates<br/>[hex.rs]"]
  node_building["Building type<br/>[building.rs]"]
end

subgraph group_gameplay["Documented gameplay"]
  node_turns_seasons["Seasonal turns<br/>[README.md]"]
  node_chronicle["Player Chronicle<br/>[README.md]"]
  node_vassalage["Vassalage<br/>[README.md]"]
end

node_shared_api -->|"exports"| node_world
node_shared_api -->|"exports"| node_player
node_world -->|"uses"| node_chunks
node_chunks -->|"stores"| node_tiles
node_tiles -->|"references"| node_player

click node_client_app "https://github.com/glapko/oxihex/blob/main/client/src/main.rs"
click node_server_app "https://github.com/glapko/oxihex/blob/main/server/src/main.rs"
click node_shared_api "https://github.com/glapko/oxihex/blob/main/common/src/lib.rs"
click node_player "https://github.com/glapko/oxihex/blob/main/common/src/player.rs"
click node_world "https://github.com/glapko/oxihex/blob/main/common/src/world.rs"
click node_chunks "https://github.com/glapko/oxihex/blob/main/common/src/world/chunk.rs"
click node_tiles "https://github.com/glapko/oxihex/blob/main/common/src/world/chunk/tile.rs"
click node_hex_coords "https://github.com/glapko/oxihex/blob/main/common/src/world/hex.rs"
click node_building "https://github.com/glapko/oxihex/blob/main/common/src/world/chunk/tile/building.rs"
click node_turns_seasons "https://github.com/glapko/oxihex/blob/main/README.md"
click node_chronicle "https://github.com/glapko/oxihex/blob/main/README.md"
click node_vassalage "https://github.com/glapko/oxihex/blob/main/README.md"

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_client_app,node_server_app toneBlue
class node_shared_api,node_player,node_world,node_chunks,node_tiles,node_hex_coords,node_building toneAmber
class node_turns_seasons,node_chronicle,node_vassalage toneMint
```

## Components

### Runtime shells

- [Client app](https://github.com/glapko/oxihex/blob/main/client/src/main.rs): `client/src/main.rs`
- [Server app](https://github.com/glapko/oxihex/blob/main/server/src/main.rs): `server/src/main.rs`

### Shared game model

- [Shared API](https://github.com/glapko/oxihex/blob/main/common/src/lib.rs): `common/src/lib.rs`
- [Player records](https://github.com/glapko/oxihex/blob/main/common/src/player.rs): `common/src/player.rs`
- [World state](https://github.com/glapko/oxihex/blob/main/common/src/world.rs): `common/src/world.rs`
- [World chunks](https://github.com/glapko/oxihex/blob/main/common/src/world/chunk.rs): `common/src/world/chunk.rs`
- [Tile ownership](https://github.com/glapko/oxihex/blob/main/common/src/world/chunk/tile.rs): `common/src/world/chunk/tile.rs`
- [Hex coordinates](https://github.com/glapko/oxihex/blob/main/common/src/world/hex.rs): `common/src/world/hex.rs`
- [Building type](https://github.com/glapko/oxihex/blob/main/common/src/world/chunk/tile/building.rs): `common/src/world/chunk/tile/building.rs`

### Documented gameplay

- [Seasonal turns](https://github.com/glapko/oxihex/blob/main/README.md): `README.md`
- [Player Chronicle](https://github.com/glapko/oxihex/blob/main/README.md): `README.md`
- [Vassalage](https://github.com/glapko/oxihex/blob/main/README.md): `README.md`

## Connections

- Shared API → World state: exports (evidence: `common/src/lib.rs`)
- Shared API → Player records: exports (evidence: `common/src/lib.rs`)
- World state → World chunks: uses (evidence: `common/src/world.rs`)
- World chunks → Tile ownership: stores (evidence: `common/src/world/chunk.rs`)
- Tile ownership → Player records: references (evidence: `common/src/world/chunk/tile.rs`)
