# dvianz/mauagame architecture

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

- Interactive diagram: https://gitdiagram.com/dvianz/mauagame
- Repository: https://github.com/dvianz/mauagame

## Overview

This is a small browser-based factory crisis game. Players configure a session, resolve timed rounds under event-specific rules, record each round as a success or failure, and view a debrief with a generated network graphic. The excerpt shows a manually selected scan outcome, not an external scanner. Source excerpts are partial, so the graph includes only the wiring they establish.

Main entry points: [`app.js`](https://github.com/dvianz/mauagame/blob/main/app.js) (Round control), [`index.html`](https://github.com/dvianz/mauagame/blob/main/index.html) (Game interface), [`styles.css`](https://github.com/dvianz/mauagame/blob/main/styles.css) (Visual styles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Session flow"]
  node_session_setup["Session setup<br/>[index.html]"]
  node_session_state["Session state<br/>[app.js]"]
  node_debrief["Debrief graph<br/>[app.js]"]
end

subgraph group_round["Round gameplay"]
  node_round_control["Round control<br/>[app.js]"]
  node_crisis_events["Crisis events<br/>[app.js]"]
  node_timer["Round timer<br/>[app.js]"]
  node_scan_outcome["Scan outcome<br/>[app.js]"]
  node_round_result["Round result<br/>[app.js]"]
end

subgraph group_presentation["Browser interface"]
  node_game_ui["Game interface<br/>[index.html]"]
  node_visual_styles["Visual styles<br/>[styles.css]"]
end

node_players(("Players"))

node_players -->|"configure"| node_session_setup
node_session_setup -->|"set options"| node_session_state
node_players -->|"play"| node_game_ui
node_game_ui -->|"start round"| node_round_control
node_round_control -->|"update state"| node_session_state
node_round_control -->|"select event"| node_crisis_events
node_round_control -->|"reset timer"| node_timer
node_players -->|"control timer"| node_timer
node_players -->|"choose outcome"| node_scan_outcome
node_scan_outcome -->|"show result"| node_round_result
node_scan_outcome -->|"count success"| node_session_state
node_players -->|"next round"| node_round_result
node_round_result -->|"start next"| node_round_control
node_round_result -->|"finish session"| node_debrief
node_debrief -->|"read totals"| node_session_state
node_debrief -->|"draw graph"| node_game_ui
node_game_ui -->|"styled by"| node_visual_styles
node_players -->|"restart"| node_debrief

click node_session_setup "https://github.com/dvianz/mauagame/blob/main/index.html"
click node_session_state "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_round_control "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_crisis_events "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_timer "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_scan_outcome "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_round_result "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_debrief "https://github.com/dvianz/mauagame/blob/main/app.js"
click node_game_ui "https://github.com/dvianz/mauagame/blob/main/index.html"
click node_visual_styles "https://github.com/dvianz/mauagame/blob/main/styles.css"

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_session_setup,node_session_state,node_debrief toneBlue
class node_round_control,node_crisis_events,node_timer,node_scan_outcome,node_round_result toneAmber
class node_game_ui,node_visual_styles toneMint
class node_players toneIndigo
```

## Components

### Session flow

- [Session setup](https://github.com/dvianz/mauagame/blob/main/index.html): `index.html`
- [Session state](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`
- [Debrief graph](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`

### Round gameplay

- [Round control](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`
- [Crisis events](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`
- [Round timer](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`
- [Scan outcome](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`
- [Round result](https://github.com/dvianz/mauagame/blob/main/app.js): `app.js`

### Browser interface

- [Game interface](https://github.com/dvianz/mauagame/blob/main/index.html): `index.html`
- [Visual styles](https://github.com/dvianz/mauagame/blob/main/styles.css): `styles.css`

### Other components

- **Players**

## Connections

- Players → Session setup: configure
- Session setup → Session state: set options
- Players → Game interface: play
- Game interface → Round control: start round
- Round control → Session state: update state
- Round control → Crisis events: select event
- Round control → Round timer: reset timer
- Players → Round timer: control timer
- Players → Scan outcome: choose outcome
- Scan outcome → Round result: show result
- Scan outcome → Session state: count success
- Players → Round result: next round
- Round result → Round control: start next
- Round result → Debrief graph: finish session
- Debrief graph → Session state: read totals
- Debrief graph → Game interface: draw graph
- Game interface → Visual styles: styled by
- Players → Debrief graph: restart
