# encephos/h2aa-front architecture

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

## Overview

This is a React war-status dashboard for monitoring the Helldivers galactic campaign. The principal evidenced flow is browser entry → status query → backend API → dashboard, with loading/error handling and periodic refresh. The code also exposes map, history, strategy, dispatch, and space-station capabilities. Several component and hook implementations are not included in the excerpts, so their internal wiring is left unspecified rather than inferred.

Main entry points: [`src/services/api.ts`](https://github.com/encephos/h2aa-front/blob/main/src/services/api.ts) (API client), [`src/App.tsx`](https://github.com/encephos/h2aa-front/blob/main/src/App.tsx) (WarRoom app), [`src/components/GalacticMap.tsx`](https://github.com/encephos/h2aa-front/blob/main/src/components/GalacticMap.tsx) (Galactic map), [`src/hooks/useWarStatus.ts`](https://github.com/encephos/h2aa-front/blob/main/src/hooks/useWarStatus.ts) (War status query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_app["WarRoom app<br/>[App.tsx]"]
end

subgraph group_views["War room views"]
  node_dashboard["War dashboard<br/>[Dashboard.tsx]"]
  node_loading["Loading screen<br/>[LoadingScreen.tsx]"]
  node_map["Galactic map<br/>[GalacticMap.tsx]"]
  node_planetgrid["Planet grid<br/>[PlanetGrid.tsx]"]
  node_planetcard["Planet details<br/>[PlanetCard.tsx]"]
  node_majororder["Major order<br/>[MajorOrder.tsx]"]
  node_dispatchfeed["Dispatch feed<br/>[DispatchFeed.tsx]"]
  node_historycharts["History charts"]
  node_planetchart["Planet history"]
  node_strategy["Strategy panels<br/>[StrategyPanel.tsx]"]
  node_tactical["Tactical analysis"]
  node_recommendation["Recommendations"]
  node_stations["Space stations<br/>[SpaceStations.tsx]"]
end

subgraph group_data["Queries and models"]
  node_warhook["War status query<br/>[useWarStatus.ts]"]
  node_historyhook["History queries<br/>[useHistory.ts]"]
  node_strategyhook["Strategy queries"]
  node_dispatchhook["Dispatch query<br/>[useDispatches.ts]"]
  node_stationhook["Station query"]
  node_wartypes["War data models<br/>[war.ts]"]
  node_planetdata["Planet metadata<br/>[planetData.ts]"]
  node_warutils["War display utilities<br/>[warUtils.ts]"]
end

subgraph group_integration["API integration"]
  node_api["API client<br/>[api.ts]"]
  node_errors["API errors<br/>[errors.ts]"]
end

node_operator(("Operator"))
node_backend(("War backend"))

node_operator -->|"opens"| node_app
node_app -->|"queries"| node_warhook
node_warhook -->|"calls"| node_api
node_api -->|"requests"| node_backend
node_api -->|"throws"| node_errors
node_warhook -->|"returns status"| node_app
node_app -->|"renders while loading"| node_loading
node_app -->|"renders status"| node_dashboard
node_map -->|"queries interventions"| node_historyhook
node_map -->|"queries directives"| node_strategyhook
node_map -->|"renders history"| node_planetchart
node_historyhook -->|"fetches history"| node_backend
node_strategyhook -->|"calls"| node_api
node_dispatchhook -->|"calls"| node_api
node_stationhook -->|"calls"| node_api
node_api -.->|"uses response types"| node_wartypes

click node_app "https://github.com/encephos/h2aa-front/blob/main/src/App.tsx"
click node_dashboard "https://github.com/encephos/h2aa-front/blob/main/src/components/Dashboard.tsx"
click node_loading "https://github.com/encephos/h2aa-front/blob/main/src/components/LoadingScreen.tsx"
click node_map "https://github.com/encephos/h2aa-front/blob/main/src/components/GalacticMap.tsx"
click node_planetgrid "https://github.com/encephos/h2aa-front/blob/main/src/components/PlanetGrid.tsx"
click node_planetcard "https://github.com/encephos/h2aa-front/blob/main/src/components/PlanetCard.tsx"
click node_majororder "https://github.com/encephos/h2aa-front/blob/main/src/components/MajorOrder.tsx"
click node_dispatchfeed "https://github.com/encephos/h2aa-front/blob/main/src/components/DispatchFeed.tsx"
click node_historycharts "https://github.com/encephos/h2aa-front/blob/main/src/components/GlobalHistoryChart.tsx"
click node_planetchart "https://github.com/encephos/h2aa-front/blob/main/src/components/PlanetHistoryChart.tsx"
click node_strategy "https://github.com/encephos/h2aa-front/blob/main/src/components/StrategyPanel.tsx"
click node_tactical "https://github.com/encephos/h2aa-front/blob/main/src/components/TacticalAnalysisPanel.tsx"
click node_recommendation "https://github.com/encephos/h2aa-front/blob/main/src/components/StrategicRecommendation.tsx"
click node_stations "https://github.com/encephos/h2aa-front/blob/main/src/components/SpaceStations.tsx"
click node_warhook "https://github.com/encephos/h2aa-front/blob/main/src/hooks/useWarStatus.ts"
click node_historyhook "https://github.com/encephos/h2aa-front/blob/main/src/hooks/useHistory.ts"
click node_strategyhook "https://github.com/encephos/h2aa-front/blob/main/src/hooks/useStrategyDirectives.ts"
click node_dispatchhook "https://github.com/encephos/h2aa-front/blob/main/src/hooks/useDispatches.ts"
click node_stationhook "https://github.com/encephos/h2aa-front/blob/main/src/hooks/useSpaceStations.ts"
click node_wartypes "https://github.com/encephos/h2aa-front/blob/main/src/types/war.ts"
click node_api "https://github.com/encephos/h2aa-front/blob/main/src/services/api.ts"
click node_errors "https://github.com/encephos/h2aa-front/blob/main/src/services/errors.ts"
click node_planetdata "https://github.com/encephos/h2aa-front/blob/main/src/data/planetData.ts"
click node_warutils "https://github.com/encephos/h2aa-front/blob/main/src/utils/warUtils.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 toneBlue
class node_dashboard,node_loading,node_map,node_planetgrid,node_planetcard,node_majororder,node_dispatchfeed,node_historycharts,node_planetchart,node_strategy,node_tactical,node_recommendation,node_stations toneAmber
class node_warhook,node_historyhook,node_strategyhook,node_dispatchhook,node_stationhook,node_wartypes,node_planetdata,node_warutils toneMint
class node_api,node_errors toneRose
class node_operator,node_backend toneIndigo
```

## Components

### Application entry

- [WarRoom app](https://github.com/encephos/h2aa-front/blob/main/src/App.tsx): `src/App.tsx`

### War room views

- [War dashboard](https://github.com/encephos/h2aa-front/blob/main/src/components/Dashboard.tsx): `src/components/Dashboard.tsx`
- [Loading screen](https://github.com/encephos/h2aa-front/blob/main/src/components/LoadingScreen.tsx): `src/components/LoadingScreen.tsx`
- [Galactic map](https://github.com/encephos/h2aa-front/blob/main/src/components/GalacticMap.tsx): `src/components/GalacticMap.tsx`
- [Planet grid](https://github.com/encephos/h2aa-front/blob/main/src/components/PlanetGrid.tsx): `src/components/PlanetGrid.tsx`
- [Planet details](https://github.com/encephos/h2aa-front/blob/main/src/components/PlanetCard.tsx): `src/components/PlanetCard.tsx`
- [Major order](https://github.com/encephos/h2aa-front/blob/main/src/components/MajorOrder.tsx): `src/components/MajorOrder.tsx`
- [Dispatch feed](https://github.com/encephos/h2aa-front/blob/main/src/components/DispatchFeed.tsx): `src/components/DispatchFeed.tsx`
- [History charts](https://github.com/encephos/h2aa-front/blob/main/src/components/GlobalHistoryChart.tsx): `src/components/GlobalHistoryChart.tsx`
- [Planet history](https://github.com/encephos/h2aa-front/blob/main/src/components/PlanetHistoryChart.tsx): `src/components/PlanetHistoryChart.tsx`
- [Strategy panels](https://github.com/encephos/h2aa-front/blob/main/src/components/StrategyPanel.tsx): `src/components/StrategyPanel.tsx`
- [Tactical analysis](https://github.com/encephos/h2aa-front/blob/main/src/components/TacticalAnalysisPanel.tsx): `src/components/TacticalAnalysisPanel.tsx`
- [Recommendations](https://github.com/encephos/h2aa-front/blob/main/src/components/StrategicRecommendation.tsx): `src/components/StrategicRecommendation.tsx`
- [Space stations](https://github.com/encephos/h2aa-front/blob/main/src/components/SpaceStations.tsx): `src/components/SpaceStations.tsx`

### Queries and models

- [War status query](https://github.com/encephos/h2aa-front/blob/main/src/hooks/useWarStatus.ts): `src/hooks/useWarStatus.ts`
- [History queries](https://github.com/encephos/h2aa-front/blob/main/src/hooks/useHistory.ts): `src/hooks/useHistory.ts`
- [Strategy queries](https://github.com/encephos/h2aa-front/blob/main/src/hooks/useStrategyDirectives.ts): `src/hooks/useStrategyDirectives.ts`
- [Dispatch query](https://github.com/encephos/h2aa-front/blob/main/src/hooks/useDispatches.ts): `src/hooks/useDispatches.ts`
- [Station query](https://github.com/encephos/h2aa-front/blob/main/src/hooks/useSpaceStations.ts): `src/hooks/useSpaceStations.ts`
- [War data models](https://github.com/encephos/h2aa-front/blob/main/src/types/war.ts): `src/types/war.ts`
- [Planet metadata](https://github.com/encephos/h2aa-front/blob/main/src/data/planetData.ts): `src/data/planetData.ts`
- [War display utilities](https://github.com/encephos/h2aa-front/blob/main/src/utils/warUtils.ts): `src/utils/warUtils.ts`

### API integration

- [API client](https://github.com/encephos/h2aa-front/blob/main/src/services/api.ts): `src/services/api.ts`
- [API errors](https://github.com/encephos/h2aa-front/blob/main/src/services/errors.ts): `src/services/errors.ts`

### Other components

- **Operator**
- **War backend**

## Connections

- Operator → WarRoom app: opens
- WarRoom app → War status query: queries
- War status query → API client: calls
- API client → War backend: requests
- API client → API errors: throws
- War status query → WarRoom app: returns status
- WarRoom app → Loading screen: renders while loading
- WarRoom app → War dashboard: renders status
- Galactic map → History queries: queries interventions
- Galactic map → Strategy queries: queries directives
- Galactic map → Planet history: renders history
- History queries → War backend: fetches history
- Strategy queries → API client: calls
- Dispatch query → API client: calls
- Station query → API client: calls
- API client → War data models: uses response types
