# mrkenny44/brightside architecture

> Architecture diagram of the GitHub repository mrkenny44/brightside, 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/mrkenny44/brightside
- Repository: https://github.com/mrkenny44/brightside

## Overview

Brightside is a turn-based ship-racing game with desktop and console interfaces, local and networked matches, configurable computer players, save/load, and a bot-simulation mode. The main play path runs from a player through the UI and MatchController into match rules and board state; bots use a separate move-selection worker before their moves are applied. The README is empty, so product capabilities and wiring are inferred from the tree and sampled source; unsampled subsystems are represented at supported directory paths, with uncertain links omitted.

Main entry points: [`src/main/java/org/controller/MatchController.java`](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/controller/MatchController.java) (Match controller), [`src/main/java/org/model/match/Match.java`](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/match/Match.java) (Match rules), [`src/main/java/org/gui/windowing/WindowManager.java`](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/gui/windowing/WindowManager.java) (Window manager), [`src/main/java/org/gui`](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/gui) (Desktop UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Player interfaces"]
  node_window["Window manager<br/>[WindowManager.java]"]
  node_gui["Desktop UI"]
  node_cli["Console UI<br/>[ConsoleUI.java]"]
end

subgraph group_control["Match control"]
  node_controller["Match controller"]
  node_worker["Bot worker<br/>[BotWorker.java]"]
end

subgraph group_game["Game domain"]
  node_setup["Match setup<br/>[Setup.java]"]
  node_match["Match rules<br/>[Match.java]"]
  node_board["Board state<br/>[GameBoard.java]"]
  node_moves["Move and card rules"]
  node_players["Human and bot players"]
  node_strategy["Bot strategy search"]
end

subgraph group_network["Online play"]
  node_lobby["Online lobby"]
  node_remote["Remote match proxy<br/>[ClientMatch.java]"]
  node_transport["Network transport"]
end

subgraph group_support["Persistence and analysis"]
  node_saveload["Save and load"]
  node_serialization["Serialization and validation"]
  node_statistics["Match statistics"]
  node_simulation["Bot simulation"]
end

node_player(("Player"))

node_player -->|"uses"| node_window
node_player -->|"plays"| node_cli
node_window -->|"displays"| node_gui
node_gui -->|"submits actions"| node_controller
node_cli -->|"submits actions"| node_controller
node_gui -->|"configures match"| node_setup
node_cli -->|"creates match"| node_setup
node_window -->|"starts or loads"| node_controller
node_controller -->|"applies actions"| node_match
node_controller -->|"schedules bots"| node_worker
node_worker -->|"requests bot moves"| node_match
node_match -->|"advances turns"| node_players
node_players -->|"selects bot moves"| node_strategy
node_strategy -->|"evaluates moves"| node_moves
node_match -->|"executes moves"| node_moves
node_match -->|"updates state"| node_board
node_setup -->|"builds"| node_match
node_gui -->|"joins lobby"| node_lobby
node_lobby -->|"exchanges messages"| node_transport
node_lobby -->|"starts remote match"| node_remote
node_remote -->|"sends commands"| node_transport
node_remote -->|"encodes state"| node_serialization
node_remote -->|"reads replicated state"| node_match
node_controller -->|"saves match"| node_saveload
node_window -->|"loads match"| node_saveload
node_saveload -->|"serializes state"| node_serialization
node_board -->|"records events"| node_statistics
node_worker -->|"records bot metrics"| node_statistics
node_simulation -->|"runs matches"| node_controller
node_simulation -->|"collects results"| node_statistics

click node_window "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/gui/windowing/WindowManager.java"
click node_gui "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/gui"
click node_cli "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/cli/ConsoleUI.java"
click node_controller "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/controller/MatchController.java"
click node_worker "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/controller/BotWorker.java"
click node_setup "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/match/Setup.java"
click node_match "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/match/Match.java"
click node_board "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/board/GameBoard.java"
click node_moves "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/moves"
click node_players "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/player"
click node_strategy "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/player/strategy"
click node_lobby "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/online"
click node_remote "https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/online/ClientMatch.java"
click node_transport "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/online/rawnetwork"
click node_saveload "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/saveload"
click node_serialization "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/de_serialization"
click node_statistics "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/board/stats"
click node_simulation "https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/simulation"

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_window,node_gui,node_cli toneBlue
class node_controller,node_worker toneAmber
class node_setup,node_match,node_board,node_moves,node_players,node_strategy toneMint
class node_lobby,node_remote,node_transport toneRose
class node_saveload,node_serialization,node_statistics,node_simulation,node_player toneIndigo
```

## Components

### Player interfaces

- [Window manager](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/gui/windowing/WindowManager.java): `src/main/java/org/gui/windowing/WindowManager.java`
- [Desktop UI](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/gui): `src/main/java/org/gui`
- [Console UI](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/cli/ConsoleUI.java): `src/main/java/org/cli/ConsoleUI.java`

### Match control

- [Match controller](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/controller/MatchController.java): `src/main/java/org/controller/MatchController.java`
- [Bot worker](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/controller/BotWorker.java): `src/main/java/org/controller/BotWorker.java`

### Game domain

- [Match setup](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/match/Setup.java): `src/main/java/org/model/match/Setup.java`
- [Match rules](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/match/Match.java): `src/main/java/org/model/match/Match.java`
- [Board state](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/model/board/GameBoard.java): `src/main/java/org/model/board/GameBoard.java`
- [Move and card rules](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/moves): `src/main/java/org/model/moves`
- [Human and bot players](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/player): `src/main/java/org/model/player`
- [Bot strategy search](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/player/strategy): `src/main/java/org/model/player/strategy`

### Online play

- [Online lobby](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/online): `src/main/java/org/online`
- [Remote match proxy](https://github.com/mrkenny44/brightside/blob/master/src/main/java/org/online/ClientMatch.java): `src/main/java/org/online/ClientMatch.java`
- [Network transport](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/online/rawnetwork): `src/main/java/org/online/rawnetwork`

### Persistence and analysis

- [Save and load](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/saveload): `src/main/java/org/saveload`
- [Serialization and validation](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/de_serialization): `src/main/java/org/de_serialization`
- [Match statistics](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/model/board/stats): `src/main/java/org/model/board/stats`
- [Bot simulation](https://github.com/mrkenny44/brightside/tree/master/src/main/java/org/simulation): `src/main/java/org/simulation`

### Other components

- **Player**

## Connections

- Player → Window manager: uses
- Player → Console UI: plays
- Window manager → Desktop UI: displays
- Desktop UI → Match controller: submits actions
- Console UI → Match controller: submits actions
- Desktop UI → Match setup: configures match
- Console UI → Match setup: creates match
- Window manager → Match controller: starts or loads
- Match controller → Match rules: applies actions
- Match controller → Bot worker: schedules bots
- Bot worker → Match rules: requests bot moves
- Match rules → Human and bot players: advances turns
- Human and bot players → Bot strategy search: selects bot moves
- Bot strategy search → Move and card rules: evaluates moves
- Match rules → Move and card rules: executes moves
- Match rules → Board state: updates state
- Match setup → Match rules: builds
- Desktop UI → Online lobby: joins lobby
- Online lobby → Network transport: exchanges messages
- Online lobby → Remote match proxy: starts remote match
- Remote match proxy → Network transport: sends commands
- Remote match proxy → Serialization and validation: encodes state
- Remote match proxy → Match rules: reads replicated state
- Match controller → Save and load: saves match
- Window manager → Save and load: loads match
- Save and load → Serialization and validation: serializes state
- Board state → Match statistics: records events
- Bot worker → Match statistics: records bot metrics
- Bot simulation → Match controller: runs matches
- Bot simulation → Match statistics: collects results
