# peangoulvant/silentcontact architecture

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

- Interactive diagram: https://gitdiagram.com/peangoulvant/silentcontact
- Repository: https://github.com/peangoulvant/silentcontact

## Overview

This is a browser-based naval scenario and force-setup application with a procedurally generated hex map. The main workflow is to create a game, configure a mission, malus, and friendly ships, then view and interact with the map alongside the force panel. The graph follows the sampled React entry flow and documented imports. Several components are represented at subsystem level where their implementation was not excerpted; their internal behavior and any unshown connections are not inferred.

Main entry points: [`src/App.tsx`](https://github.com/peangoulvant/silentcontact/blob/main/src/App.tsx) (App shell), [`src/core/configuration/ConfigurationPanel.tsx`](https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/ConfigurationPanel.tsx) (Configuration flow), [`src/core/store/current-game.store.ts`](https://github.com/peangoulvant/silentcontact/blob/main/src/core/store/current-game.store.ts) (Persisted game), [`src/core/map/components/HexCanvas.tsx`](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/components/HexCanvas.tsx) (Hex canvas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Game setup"]
  node_app["App shell<br/>[App.tsx]"]
  node_config["Configuration flow"]
  node_mission["Mission picker<br/>[MissionPicker.tsx]"]
  node_malus["Malus picker<br/>[MalusPicker.tsx]"]
  node_ships["Ship picker<br/>[ShipsPicker.tsx]"]
  node_shipcards["Ship cards<br/>[ShipsCard.tsx]"]
  node_force["Force panel<br/>[ForcePanel.tsx]"]
end

subgraph group_map["Map experience"]
  node_map_hook["Map state hook<br/>[useOceanMap.ts]"]
  node_map_view["Map view<br/>[MapView.tsx]"]
  node_canvas["Hex canvas<br/>[HexCanvas.tsx]"]
  node_events["Map interactions<br/>[mapEvents.ts]"]
  node_map_draw["Map renderer<br/>[drawMap.ts]"]
  node_ship_draw["Ship renderer<br/>[drawShip.ts]"]
  node_mapgen["Map generator<br/>[generateMap.ts]"]
  node_noise["Noise utility<br/>[noise.ts]"]
end

subgraph group_state["Application state"]
  node_game_store[("Persisted game")]
  node_map_store[("Map state")]
end

subgraph group_shared["Shared models and data"]
  node_catalog["Scenario and ship data"]
  node_hex_data["Hex geometry<br/>[hex.constants.ts]"]
  node_game_model["Game model<br/>[game.types.ts]"]
  node_scenario_model["Scenario models<br/>[scenario.types.ts]"]
  node_terrain_model["Terrain model<br/>[terrain.types.ts]"]
end

node_user(("Player"))

node_user -->|"configures game"| node_config
node_app -->|"renders"| node_config
node_app -->|"renders"| node_force
node_app -->|"renders"| node_map_view
node_app -->|"uses"| node_map_hook
node_app -->|"reads and updates"| node_game_store
node_app -->|"generates map"| node_mapgen
node_config -->|"renders"| node_mission
node_config -->|"renders"| node_malus
node_config -->|"renders"| node_ships
node_config -->|"reads and updates"| node_game_store
node_mission -->|"updates selection"| node_game_store
node_mission -->|"reads mission data"| node_catalog
node_malus -->|"updates selection"| node_game_store
node_malus -->|"reads malus data"| node_catalog
node_ships -->|"renders"| node_shipcards
node_ships -->|"updates selection"| node_game_store
node_shipcards -->|"reads ship data"| node_catalog
node_map_hook -->|"generates map"| node_mapgen
node_map_view -->|"renders"| node_canvas
node_map_view -->|"uses ship renderer"| node_ship_draw
node_canvas -->|"draws map"| node_map_draw
node_canvas -->|"registers handlers"| node_events
node_canvas -->|"updates map"| node_map_store
node_canvas -->|"uses geometry"| node_hex_data
node_mapgen -->|"uses noise"| node_noise
node_mapgen -->|"uses terrain data"| node_catalog
node_mapgen -->|"creates cells"| node_terrain_model
node_game_store -->|"stores"| node_game_model

click node_app "https://github.com/peangoulvant/silentcontact/blob/main/src/App.tsx"
click node_config "https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/ConfigurationPanel.tsx"
click node_mission "https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/MissionPicker.tsx"
click node_malus "https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/MalusPicker.tsx"
click node_ships "https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/ShipsPicker.tsx"
click node_shipcards "https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/ShipsCard.tsx"
click node_force "https://github.com/peangoulvant/silentcontact/blob/main/src/core/force/ForcePanel.tsx"
click node_map_hook "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/hooks/useOceanMap.ts"
click node_map_view "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/components/MapView.tsx"
click node_canvas "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/components/HexCanvas.tsx"
click node_events "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/hooks/mapEvents.ts"
click node_map_draw "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/drawMap.ts"
click node_ship_draw "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/drawShip.ts"
click node_mapgen "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/generateMap.ts"
click node_noise "https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/noise.ts"
click node_game_store "https://github.com/peangoulvant/silentcontact/blob/main/src/core/store/current-game.store.ts"
click node_map_store "https://github.com/peangoulvant/silentcontact/blob/main/src/core/store/current-map.store.ts"
click node_catalog "https://github.com/peangoulvant/silentcontact/tree/main/src/shared/data"
click node_hex_data "https://github.com/peangoulvant/silentcontact/blob/main/src/shared/data/map/hex.constants.ts"
click node_game_model "https://github.com/peangoulvant/silentcontact/blob/main/src/shared/domain/game/game.types.ts"
click node_scenario_model "https://github.com/peangoulvant/silentcontact/blob/main/src/shared/domain/scenario/scenario.types.ts"
click node_terrain_model "https://github.com/peangoulvant/silentcontact/blob/main/src/shared/domain/map/terrain.types.ts"

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_app,node_config,node_mission,node_malus,node_ships,node_shipcards,node_force toneBlue
class node_map_hook,node_map_view,node_canvas,node_events,node_map_draw,node_ship_draw,node_mapgen,node_noise toneAmber
class node_game_store,node_map_store toneMint
class node_catalog,node_hex_data,node_game_model,node_scenario_model,node_terrain_model toneRose
class node_user toneIndigo
```

## Components

### Game setup

- [App shell](https://github.com/peangoulvant/silentcontact/blob/main/src/App.tsx): `src/App.tsx`
- [Configuration flow](https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/ConfigurationPanel.tsx): `src/core/configuration/ConfigurationPanel.tsx`
- [Mission picker](https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/MissionPicker.tsx): `src/core/configuration/components/MissionPicker.tsx`
- [Malus picker](https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/MalusPicker.tsx): `src/core/configuration/components/MalusPicker.tsx`
- [Ship picker](https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/ShipsPicker.tsx): `src/core/configuration/components/ShipsPicker.tsx`
- [Ship cards](https://github.com/peangoulvant/silentcontact/blob/main/src/core/configuration/components/ShipsCard.tsx): `src/core/configuration/components/ShipsCard.tsx`
- [Force panel](https://github.com/peangoulvant/silentcontact/blob/main/src/core/force/ForcePanel.tsx): `src/core/force/ForcePanel.tsx`

### Map experience

- [Map state hook](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/hooks/useOceanMap.ts): `src/core/map/hooks/useOceanMap.ts`
- [Map view](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/components/MapView.tsx): `src/core/map/components/MapView.tsx`
- [Hex canvas](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/components/HexCanvas.tsx): `src/core/map/components/HexCanvas.tsx`
- [Map interactions](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/hooks/mapEvents.ts): `src/core/map/hooks/mapEvents.ts`
- [Map renderer](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/drawMap.ts): `src/core/map/utils/drawMap.ts`
- [Ship renderer](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/drawShip.ts): `src/core/map/utils/drawShip.ts`
- [Map generator](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/generateMap.ts): `src/core/map/utils/generateMap.ts`
- [Noise utility](https://github.com/peangoulvant/silentcontact/blob/main/src/core/map/utils/noise.ts): `src/core/map/utils/noise.ts`

### Application state

- [Persisted game](https://github.com/peangoulvant/silentcontact/blob/main/src/core/store/current-game.store.ts): `src/core/store/current-game.store.ts`
- [Map state](https://github.com/peangoulvant/silentcontact/blob/main/src/core/store/current-map.store.ts): `src/core/store/current-map.store.ts`

### Shared models and data

- [Scenario and ship data](https://github.com/peangoulvant/silentcontact/tree/main/src/shared/data): `src/shared/data`
- [Hex geometry](https://github.com/peangoulvant/silentcontact/blob/main/src/shared/data/map/hex.constants.ts): `src/shared/data/map/hex.constants.ts`
- [Game model](https://github.com/peangoulvant/silentcontact/blob/main/src/shared/domain/game/game.types.ts): `src/shared/domain/game/game.types.ts`
- [Scenario models](https://github.com/peangoulvant/silentcontact/blob/main/src/shared/domain/scenario/scenario.types.ts): `src/shared/domain/scenario/scenario.types.ts`
- [Terrain model](https://github.com/peangoulvant/silentcontact/blob/main/src/shared/domain/map/terrain.types.ts): `src/shared/domain/map/terrain.types.ts`

### Other components

- **Player**

## Connections

- Player → Configuration flow: configures game
- App shell → Configuration flow: renders (evidence: `src/App.tsx`)
- App shell → Force panel: renders (evidence: `src/App.tsx`)
- App shell → Map view: renders (evidence: `src/App.tsx`)
- App shell → Map state hook: uses (evidence: `src/App.tsx`)
- App shell → Persisted game: reads and updates (evidence: `src/App.tsx`)
- App shell → Map generator: generates map (evidence: `src/App.tsx`)
- Configuration flow → Mission picker: renders (evidence: `src/core/configuration/ConfigurationPanel.tsx`)
- Configuration flow → Malus picker: renders (evidence: `src/core/configuration/ConfigurationPanel.tsx`)
- Configuration flow → Ship picker: renders (evidence: `src/core/configuration/ConfigurationPanel.tsx`)
- Configuration flow → Persisted game: reads and updates (evidence: `src/core/configuration/ConfigurationPanel.tsx`)
- Mission picker → Persisted game: updates selection (evidence: `src/core/configuration/components/MissionPicker.tsx`)
- Mission picker → Scenario and ship data: reads mission data (evidence: `src/core/configuration/components/MissionPicker.tsx`)
- Malus picker → Persisted game: updates selection (evidence: `src/core/configuration/components/MalusPicker.tsx`)
- Malus picker → Scenario and ship data: reads malus data (evidence: `src/core/configuration/components/MalusPicker.tsx`)
- Ship picker → Ship cards: renders (evidence: `src/core/configuration/components/ShipsPicker.tsx`)
- Ship picker → Persisted game: updates selection (evidence: `src/core/configuration/components/ShipsPicker.tsx`)
- Ship cards → Scenario and ship data: reads ship data (evidence: `src/core/configuration/components/ShipsCard.tsx`)
- Map state hook → Map generator: generates map (evidence: `src/core/map/hooks/useOceanMap.ts`)
- Map view → Hex canvas: renders (evidence: `src/core/map/components/MapView.tsx`)
- Map view → Ship renderer: uses ship renderer (evidence: `src/core/map/components/MapView.tsx`)
- Hex canvas → Map renderer: draws map (evidence: `src/core/map/components/HexCanvas.tsx`)
- Hex canvas → Map interactions: registers handlers (evidence: `src/core/map/components/HexCanvas.tsx`)
- Hex canvas → Map state: updates map (evidence: `src/core/map/components/HexCanvas.tsx`)
- Hex canvas → Hex geometry: uses geometry (evidence: `src/core/map/components/HexCanvas.tsx`)
- Map generator → Noise utility: uses noise (evidence: `src/core/map/utils/generateMap.ts`)
- Map generator → Scenario and ship data: uses terrain data (evidence: `src/core/map/utils/generateMap.ts`)
- Map generator → Terrain model: creates cells (evidence: `src/core/map/utils/generateMap.ts`)
- Persisted game → Game model: stores (evidence: `src/core/store/current-game.store.ts`)
