# kauri-off/fallbeans architecture

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

- Interactive diagram: https://gitdiagram.com/kauri-off/fallbeans
- Repository: https://github.com/kauri-off/fallbeans

## Overview

Fall Beans is a multiplayer party game with a Bevy client and an authoritative Rust server. The main workflow is: a player chooses or adds a server, obtains a session and joins a room, then plays rounds whose state is simulated by the server and presented by the client. The graph also preserves practice with bots, map content, graphics configuration, and server diagnostics. Edges follow explicit README workflow statements or source-index references; unsampled implementation details are represented only where the README documents them.

Main entry points: [`crates/fb_client/src/net.rs`](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/net.rs) (Client transport), [`crates/fb_server/src/rooms/room/sim.rs`](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/sim.rs) (Authoritative simulation), [`crates/fb_client/src/ui/mod.rs`](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/ui/mod.rs) (Screens and controls), [`crates/fb_server/src/net.rs`](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/net.rs) (Server networking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Player client"]
  node_ui["Screens and controls<br/>[mod.rs]"]
  node_server_list["Server selection<br/>[servers.rs]"]
  node_settings[("Player settings<br/>[settings.rs]")]
  node_session["Room session<br/>[session.rs]"]
  node_client_net["Client transport<br/>[net.rs]"]
  node_client_game["Client game<br/>[game.rs]"]
  node_client_view["Game view<br/>[view.rs]"]
  node_graphics["Graphics and upscaling<br/>[quality.rs]"]
end

subgraph group_server["Server and rooms"]
  node_http["HTTP API<br/>[http.rs]"]
  node_auth["Identity and auth<br/>[auth.rs]"]
  node_server_net["Server networking<br/>[net.rs]"]
  node_rooms["Room coordination<br/>[mod.rs]"]
  node_round_flow["Round flow<br/>[flow.rs]"]
  node_server_sim["Authoritative simulation<br/>[sim.rs]"]
  node_debug_api["Debug API<br/>[http.rs]"]
end

subgraph group_game["Game simulation"]
  node_simulation["Physics and world<br/>[physics.rs]"]
  node_world["World construction<br/>[builder.rs]"]
  node_maps["Maps and rounds<br/>[mod.rs]"]
  node_bots["Bot behavior<br/>[mod.rs]"]
end

subgraph group_shared["Shared contracts"]
  node_protocol["Network schema<br/>[schema.rs]"]
  node_game_rules["Shared game rules<br/>[rules.rs]"]
end

node_player(("Player"))
node_external_server(("Configured game server"))

node_player -->|"uses"| node_ui
node_ui -->|"selects server"| node_server_list
node_ui -->|"changes settings"| node_settings
node_server_list -->|"connects"| node_client_net
node_client_net -->|"requests session"| node_http
node_client_net -->|"joins over UDP or WebSocket"| node_server_net
node_http -->|"authenticates"| node_auth
node_server_net -->|"routes players"| node_rooms
node_rooms -->|"manages rounds"| node_round_flow
node_round_flow -->|"starts simulation"| node_server_sim
node_server_sim -.->|"steps world"| node_simulation
node_server_sim -.->|"runs map"| node_maps
node_server_sim -.->|"fills empty places"| node_bots
node_client_net -.->|"exchanges messages"| node_protocol
node_server_net -.->|"exchanges messages"| node_protocol
node_client_game -.->|"presents game"| node_client_view
node_client_view -->|"renders with"| node_graphics
node_settings -->|"configures"| node_graphics
node_client_game -.->|"uses rules"| node_game_rules
node_external_server -->|"serves API"| node_http
node_player -->|"requests diagnostics"| node_debug_api

click node_ui "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/ui/mod.rs"
click node_server_list "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/servers.rs"
click node_settings "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/settings.rs"
click node_session "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/session.rs"
click node_client_net "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/net.rs"
click node_client_game "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/game.rs"
click node_client_view "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/view.rs"
click node_graphics "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/render/quality.rs"
click node_http "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/http.rs"
click node_auth "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/auth.rs"
click node_server_net "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/net.rs"
click node_rooms "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/mod.rs"
click node_round_flow "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/flow.rs"
click node_server_sim "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/sim.rs"
click node_simulation "https://github.com/kauri-off/fallbeans/blob/master/core/fb_sim/src/physics.rs"
click node_world "https://github.com/kauri-off/fallbeans/blob/master/core/fb_sim/src/builder.rs"
click node_maps "https://github.com/kauri-off/fallbeans/blob/master/core/fb_maps/src/race/mod.rs"
click node_bots "https://github.com/kauri-off/fallbeans/blob/master/core/fb_sim/src/bots/mod.rs"
click node_protocol "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_net/src/schema.rs"
click node_game_rules "https://github.com/kauri-off/fallbeans/blob/master/core/fb_shared/src/rules.rs"
click node_debug_api "https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/http.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_ui,node_server_list,node_settings,node_session,node_client_net,node_client_game,node_client_view,node_graphics toneBlue
class node_http,node_auth,node_server_net,node_rooms,node_round_flow,node_server_sim,node_debug_api toneAmber
class node_simulation,node_world,node_maps,node_bots,node_external_server toneMint
class node_protocol,node_game_rules toneRose
class node_player toneIndigo
```

## Components

### Player client

- [Screens and controls](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/ui/mod.rs): `crates/fb_client/src/ui/mod.rs`
- [Server selection](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/servers.rs): `crates/fb_client/src/servers.rs`
- [Player settings](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/settings.rs): `crates/fb_client/src/settings.rs`
- [Room session](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/session.rs): `crates/fb_client/src/session.rs`
- [Client transport](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/net.rs): `crates/fb_client/src/net.rs`
- [Client game](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/game.rs): `crates/fb_client/src/game.rs`
- [Game view](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/view.rs): `crates/fb_client/src/view.rs`
- [Graphics and upscaling](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_client/src/render/quality.rs): `crates/fb_client/src/render/quality.rs`

### Server and rooms

- [HTTP API](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/http.rs): `crates/fb_server/src/http.rs`
- [Identity and auth](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/auth.rs): `crates/fb_server/src/auth.rs`
- [Server networking](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/net.rs): `crates/fb_server/src/net.rs`
- [Room coordination](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/mod.rs): `crates/fb_server/src/rooms/room/mod.rs`
- [Round flow](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/flow.rs): `crates/fb_server/src/rooms/room/flow.rs`
- [Authoritative simulation](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/rooms/room/sim.rs): `crates/fb_server/src/rooms/room/sim.rs`
- [Debug API](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_server/src/http.rs): `crates/fb_server/src/http.rs`

### Game simulation

- [Physics and world](https://github.com/kauri-off/fallbeans/blob/master/core/fb_sim/src/physics.rs): `core/fb_sim/src/physics.rs`
- [World construction](https://github.com/kauri-off/fallbeans/blob/master/core/fb_sim/src/builder.rs): `core/fb_sim/src/builder.rs`
- [Maps and rounds](https://github.com/kauri-off/fallbeans/blob/master/core/fb_maps/src/race/mod.rs): `core/fb_maps/src/race/mod.rs`
- [Bot behavior](https://github.com/kauri-off/fallbeans/blob/master/core/fb_sim/src/bots/mod.rs): `core/fb_sim/src/bots/mod.rs`

### Shared contracts

- [Network schema](https://github.com/kauri-off/fallbeans/blob/master/crates/fb_net/src/schema.rs): `crates/fb_net/src/schema.rs`
- [Shared game rules](https://github.com/kauri-off/fallbeans/blob/master/core/fb_shared/src/rules.rs): `core/fb_shared/src/rules.rs`

### Other components

- **Player**
- **Configured game server**

## Connections

- Player → Screens and controls: uses (evidence: `README.md`)
- Screens and controls → Server selection: selects server (evidence: `README.md`)
- Screens and controls → Player settings: changes settings (evidence: `crates/fb_client/src/ui/mod.rs`)
- Server selection → Client transport: connects (evidence: `crates/fb_client/src/servers.rs`)
- Client transport → HTTP API: requests session (evidence: `README.md`)
- Client transport → Server networking: joins over UDP or WebSocket (evidence: `README.md`)
- HTTP API → Identity and auth: authenticates (evidence: `crates/fb_server/src/auth.rs`)
- Server networking → Room coordination: routes players (evidence: `README.md`)
- Room coordination → Round flow: manages rounds (evidence: `crates/fb_server/src/rooms/room/mod.rs`)
- Round flow → Authoritative simulation: starts simulation (evidence: `crates/fb_server/src/rooms/room/mod.rs`)
- Authoritative simulation → Physics and world: steps world
- Authoritative simulation → Maps and rounds: runs map
- Authoritative simulation → Bot behavior: fills empty places (evidence: `README.md`)
- Client transport → Network schema: exchanges messages
- Server networking → Network schema: exchanges messages
- Client game → Game view: presents game
- Game view → Graphics and upscaling: renders with (evidence: `crates/fb_client/src/render/quality.rs`)
- Player settings → Graphics and upscaling: configures (evidence: `crates/fb_client/src/settings.rs`)
- Client game → Shared game rules: uses rules
- Configured game server → HTTP API: serves API (evidence: `README.md`)
- Player → Debug API: requests diagnostics (evidence: `README.md`)
