# ausspeedruns/asm-graphics architecture

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

- Interactive diagram: https://gitdiagram.com/ausspeedruns/asm-graphics
- Repository: https://github.com/ausspeedruns/asm-graphics

## Overview

1. This repository is a NodeCG bundle called “ASM Graphics” for AusSpeedruns marathon events. It is not a standalone app; it is a collection of browser graphics, dashboard tools, and server-side extensions that all share a common state model through NodeCG.

2. The architecture is split into three main runtime boundaries:
   - `src/extensions`: NodeCG extension code running on the server side
   - `src/dashboard`: the operator/admin panels shown inside the NodeCG dashboard
   - `src/graphics`: the browser sources shown on stream or in OBS
   These parts communicate primarily through NodeCG replicants and messages, with shared TypeScript types under `src/shared`.

3. The extension layer is the integration hub. It talks to external services and hardware such as Tiltify, an AusSpeedruns GraphQL API, nodecg-speedcontrol schedule data, OBS-WebSocket, and Behringer X32 audio gear. Extension files are grouped by feature: donations, incentives, schedule import, prizes, host reads, bingo, intermission videos, runner tablet, audio indicators, and OBS/local data.

4. The shared state model is a major boundary in the design. `src/shared/replicants.ts` and the type definitions in `src/shared/types` define the data contracts used by both dashboard and graphics. Shared hooks such as `useCurrentRun`, `useNextRun`, and `useSurroundingRuns` show that run/schedule state is central to many screens.

5. The dashboard is the control plane for operators. It contains panels for stage management, countdowns, donations, bingo, full-cam, ASNN, on-screen warnings, schedule importing, settings, and host-facing controls. The `settings` subtree is especially important because it exposes integrations and generated artifacts, including OBS scene generation, X32 config, Tiltify, event upload, prizes, intermission videos, and host reads.

6. The “Stage View” dashboard panel is a notable subsystem for live run management. It handles runner/couch ordering, run editing, person data, talkback, timeline/status indicators, and game cropping. This implies a workflow where operators keep the live stage lineup and run metadata synchronized with the broadcast graphics.

7. The graphics layer is the on-stream output side. It includes many specialized overlays for different aspect ratios and platforms: widescreen, standard 4:3, portrait, Game Boy, Game Boy Advance, Nintendo DS/3DS, 1:1, and multi-player variants. The graphics folder also contains intermission, ticker/omnibar, host dashboard, runner tablet, gameplay overlay, transition, countdown, and event-specific screens.

8. Several graphics subsystems are data-driven display surfaces rather than fixed layouts. The ticker/omnibar, intermission elements, host dashboard, prize/incentive displays, donation totals, and runner tablet all render from live state coming from the extension. This is the primary path from backend integrations to on-stream UI.

9. Asset management is part of the architecture. The repo includes shared fonts, sponsor assets, design assets, OBS media files, and audio cues. These are treated as bundle resources consumed by graphics and, in some cases, by OBS scene generation and transitions.

10. OBS integration is unusually important here. The repo ships OBS scene presets and a generator that can emit scene/source configurations based on dashboard settings. That means the bundle does not just render overlays; it also helps construct the OBS scene graph used to place browser sources, captures, and audio monitoring correctly.

11. The repository also includes a clear event-specific configuration layer. The README references a config schema for OBS, Tiltify, GraphQL, and X32 settings, and the tree contains event-specific JSON assets and a generated config schema. This makes the bundle portable across marathon events while still relying on per-event configuration.

12. Tooling-wise, this is a TypeScript monorepo-style bundle using React-based TSX entrypoints. The presence of `template.html` files, `vite.config.mjs`, `tsdown.config.ts`, and separate TS configs for dashboard/graphics/extensions indicates distinct build targets for browser and server code within one package.

Main entry points: [`src/shared/replicants.ts`](https://github.com/ausspeedruns/asm-graphics/blob/main/src/shared/replicants.ts) (Shared state), [`src/extensions/index.ts`](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/index.ts) (Extension hub), [`src/dashboard/settings.tsx`](https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/settings.tsx) (Settings), [`src/extensions/obs-local.ts`](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/obs-local.ts) (OBS local)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime_extensions["Extensions"]
  node_ext_index["Extension hub<br/>nodecg extension<br/>[index.ts]"]
  node_ext_replicants["Replicants<br/>state model<br/>[replicants.ts]"]
  node_ext_donations["Donations<br/>integration<br/>[donations.ts]"]
  node_ext_incentives["Incentives<br/>integration<br/>[incentives.ts]"]
  node_ext_schedule["Schedule import<br/>integration<br/>[schedule-import.ts]"]
  node_ext_prizes["Prizes<br/>feature<br/>[prizes.ts]"]
  node_ext_host_reads["Host reads<br/>feature<br/>[host-reads.ts]"]
  node_ext_runner_tablet["Runner tablet<br/>feature<br/>[runner-tablet.ts]"]
  node_ext_audio["Audio cues<br/>hardware<br/>[x32-audio.ts]"]
  node_ext_obs_local["OBS local<br/>integration<br/>[obs-local.ts]"]
end

subgraph group_runtime_dashboard["Dashboard"]
  node_dash_stage["Stage view<br/>dashboard panel<br/>[stage-view.tsx]"]
  node_dash_settings["Settings<br/>dashboard panel<br/>[settings.tsx]"]
  node_dash_donations["Donations<br/>dashboard panel<br/>[donations.tsx]"]
  node_dash_bingo["Bingo<br/>dashboard panel<br/>[bingo.tsx]"]
  node_dash_countdown["Countdown<br/>dashboard panel<br/>[countdown.tsx]"]
end

subgraph group_runtime_graphics["Graphics"]
  node_gfx_overlays["Overlays<br/>overlay suite"]
  node_gfx_ticker["Ticker<br/>overlay component<br/>[ticker.tsx]"]
  node_gfx_intermission["Intermission<br/>screen<br/>[intermission.tsx]"]
  node_gfx_host_dash["Host dash<br/>screen<br/>[host-dashboard.tsx]"]
  node_gfx_runner_tablet["Runner tablet<br/>screen<br/>[runner-tablet.tsx]"]
  node_gfx_gameplay["Gameplay<br/>overlay screen"]
end

subgraph group_runtime_shared["Shared"]
  node_shared_state["Shared state<br/>contracts<br/>[replicants.ts]"]
  node_shared_types["Shared types"]
  node_shared_hooks["Run hooks"]
end

subgraph group_assets["Assets"]
  node_assets_obs[("OBS assets<br/>media/config")]
  node_assets_shared[("Shared assets<br/>media")]
  node_config_schema["Config schema<br/>[configschema.json]"]
end

node_ext_index -->|"initializes"| node_ext_replicants
node_ext_index -->|"loads"| node_ext_donations
node_ext_index -->|"loads"| node_ext_incentives
node_ext_index -->|"loads"| node_ext_schedule
node_ext_index -->|"loads"| node_ext_prizes
node_ext_index -->|"loads"| node_ext_host_reads
node_ext_index -->|"loads"| node_ext_runner_tablet
node_ext_index -->|"loads"| node_ext_audio
node_ext_index -->|"loads"| node_ext_obs_local
node_ext_schedule -->|"writes"| node_shared_state
node_ext_donations -->|"writes"| node_shared_state
node_ext_incentives -->|"writes"| node_shared_state
node_ext_prizes -->|"writes"| node_shared_state
node_ext_host_reads -->|"writes"| node_shared_state
node_ext_runner_tablet -->|"writes"| node_shared_state
node_ext_audio -->|"writes"| node_shared_state
node_ext_obs_local -->|"writes"| node_shared_state
node_shared_state -->|"consumed by"| node_shared_hooks
node_shared_state -->|"reads"| node_dash_stage
node_shared_state -->|"reads"| node_dash_donations
node_shared_state -->|"reads"| node_dash_bingo
node_shared_state -->|"reads"| node_gfx_overlays
node_shared_state -->|"reads"| node_gfx_ticker
node_shared_state -->|"reads"| node_gfx_intermission
node_shared_state -->|"reads"| node_gfx_host_dash
node_shared_state -->|"reads"| node_gfx_runner_tablet
node_shared_state -->|"reads"| node_gfx_gameplay
node_dash_stage -->|"updates"| node_ext_replicants
node_dash_settings -->|"generates"| node_config_schema
node_dash_settings -->|"writes"| node_assets_obs
node_dash_settings -->|"configures"| node_ext_obs_local
node_dash_settings -->|"configures"| node_ext_audio
node_dash_settings -->|"configures"| node_ext_donations
node_dash_settings -->|"configures"| node_ext_schedule
node_dash_settings -->|"configures"| node_ext_prizes
node_dash_settings -->|"configures"| node_ext_host_reads
node_shared_types -->|"types"| node_ext_index
node_shared_types -->|"types"| node_dash_stage
node_shared_types -->|"types"| node_gfx_overlays
node_shared_hooks -->|"uses"| node_dash_stage
node_shared_hooks -->|"uses"| node_gfx_gameplay
node_assets_shared -->|"uses"| node_gfx_overlays
node_assets_shared -->|"uses"| node_gfx_intermission
node_assets_obs -->|"feeds"| node_ext_obs_local
node_config_schema -->|"documented by"| node_dash_settings

click node_ext_index "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/index.ts"
click node_ext_replicants "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/replicants.ts"
click node_ext_donations "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/donations.ts"
click node_ext_incentives "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/incentives.ts"
click node_ext_schedule "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/schedule-import.ts"
click node_ext_prizes "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/prizes.ts"
click node_ext_host_reads "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/host-reads.ts"
click node_ext_runner_tablet "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/runner-tablet.ts"
click node_ext_audio "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/x32-audio.ts"
click node_ext_obs_local "https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/obs-local.ts"
click node_dash_stage "https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/stage-view.tsx"
click node_dash_settings "https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/settings.tsx"
click node_dash_donations "https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/donations.tsx"
click node_dash_bingo "https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/bingo.tsx"
click node_dash_countdown "https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/countdown.tsx"
click node_gfx_overlays "https://github.com/ausspeedruns/asm-graphics/tree/main/src/graphics/overlays"
click node_gfx_ticker "https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/ticker.tsx"
click node_gfx_intermission "https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/intermission.tsx"
click node_gfx_host_dash "https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/host-dashboard.tsx"
click node_gfx_runner_tablet "https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/runner-tablet.tsx"
click node_gfx_gameplay "https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/gameplay-overlay.tsx"
click node_shared_state "https://github.com/ausspeedruns/asm-graphics/blob/main/src/shared/replicants.ts"
click node_shared_types "https://github.com/ausspeedruns/asm-graphics/tree/main/src/shared/types"
click node_shared_hooks "https://github.com/ausspeedruns/asm-graphics/tree/main/src/shared/hooks"
click node_assets_obs "https://github.com/ausspeedruns/asm-graphics/tree/main/obs"
click node_assets_shared "https://github.com/ausspeedruns/asm-graphics/tree/main/shared"
click node_config_schema "https://github.com/ausspeedruns/asm-graphics/blob/main/configschema.json"

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_ext_index,node_ext_replicants,node_ext_donations,node_ext_incentives,node_ext_schedule,node_ext_prizes,node_ext_host_reads,node_ext_runner_tablet,node_ext_audio,node_ext_obs_local toneBlue
class node_dash_stage,node_dash_settings,node_dash_donations,node_dash_bingo,node_dash_countdown toneAmber
class node_gfx_overlays,node_gfx_ticker,node_gfx_intermission,node_gfx_host_dash,node_gfx_runner_tablet,node_gfx_gameplay toneMint
class node_shared_state,node_shared_types,node_shared_hooks toneRose
class node_assets_obs,node_assets_shared,node_config_schema toneIndigo
```

## Components

### Extensions

Server-side NodeCG integrations and state orchestration

- [Extension hub](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/index.ts): nodecg extension · Bootstraps the server-side bundle and wires feature modules together · `src/extensions/index.ts`
- [Replicants](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/replicants.ts): state model · Central shared state definitions and extension-side bindings · `src/extensions/replicants.ts`
- [Donations](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/donations.ts): integration · Donation ingestion and donation-related state updates · `src/extensions/donations.ts`
- [Incentives](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/incentives.ts): integration · Incentive and war tracking sourced from external services · `src/extensions/incentives.ts`
- [Schedule import](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/schedule-import.ts): integration · Imports and converts schedule data into shared run state · `src/extensions/schedule-import.ts`
- [Prizes](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/prizes.ts): feature · Prize state and prize-related coordination · `src/extensions/prizes.ts`
- [Host reads](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/host-reads.ts): feature · Host-read text and delivery state · `src/extensions/host-reads.ts`
- [Runner tablet](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/runner-tablet.ts): feature · Runner-facing tablet state and controls · `src/extensions/runner-tablet.ts`
- [Audio cues](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/x32-audio.ts): hardware · Game audio indicators and X32 audio integration · `src/extensions/x32-audio.ts`
- [OBS local](https://github.com/ausspeedruns/asm-graphics/blob/main/src/extensions/obs-local.ts): integration · Local OBS-related data and scene coordination · `src/extensions/obs-local.ts`

### Dashboard

Operator panels and live control surfaces

- [Stage view](https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/stage-view.tsx): dashboard panel · Live run management, ordering, editing, and talkback workflow · `src/dashboard/stage-view.tsx`
- [Settings](https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/settings.tsx): dashboard panel · Integration settings and generated artifact controls · `src/dashboard/settings.tsx`
- [Donations](https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/donations.tsx): dashboard panel · Donation monitoring and operator controls · `src/dashboard/donations.tsx`
- [Bingo](https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/bingo.tsx): dashboard panel · Bingo and race-specific control surface · `src/dashboard/bingo.tsx`
- [Countdown](https://github.com/ausspeedruns/asm-graphics/blob/main/src/dashboard/countdown.tsx): dashboard panel · Timer and countdown controls · `src/dashboard/countdown.tsx`

### Graphics

On-stream browser outputs and overlays

- [Overlays](https://github.com/ausspeedruns/asm-graphics/tree/main/src/graphics/overlays): overlay suite · Aspect-ratio and platform-specific gameplay overlays · `src/graphics/overlays`
- [Ticker](https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/ticker.tsx): overlay component · Scrolling omnibar and compact live information surfaces · `src/graphics/ticker.tsx`
- [Intermission](https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/intermission.tsx): screen · Between-run and incentive-focused full-screen graphics · `src/graphics/intermission.tsx`
- [Host dash](https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/host-dashboard.tsx): screen · On-stream host dashboard with donation and incentive controls · `src/graphics/host-dashboard.tsx`
- [Runner tablet](https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/runner-tablet.tsx): screen · Runner-facing tablet view rendered in the browser · `src/graphics/runner-tablet.tsx`
- [Gameplay](https://github.com/ausspeedruns/asm-graphics/blob/main/src/graphics/gameplay-overlay.tsx): overlay screen · Primary gameplay overlay and presentation screens · `src/graphics/gameplay-overlay.tsx`

### Shared

Cross-runtime data contracts and hooks

- [Shared state](https://github.com/ausspeedruns/asm-graphics/blob/main/src/shared/replicants.ts): contracts · Replicant names and cross-runtime data contracts · `src/shared/replicants.ts`
- [Shared types](https://github.com/ausspeedruns/asm-graphics/tree/main/src/shared/types): types · Common TypeScript definitions for runs, donations, incentives, audio, and config · `src/shared/types`
- [Run hooks](https://github.com/ausspeedruns/asm-graphics/tree/main/src/shared/hooks): hooks · Shared helpers for current, next, previous, and surrounding runs · `src/shared/hooks`

### Assets

Bundle resources and OBS media/config

- [OBS assets](https://github.com/ausspeedruns/asm-graphics/tree/main/obs): media/config · Scene presets, transition media, and OBS bundle resources · `obs`
- [Shared assets](https://github.com/ausspeedruns/asm-graphics/tree/main/shared): media · Fonts, sponsors, design assets, and shared visual resources · `shared`
- [Config schema](https://github.com/ausspeedruns/asm-graphics/blob/main/configschema.json): schema · Generated event configuration schema for integrations and OBS settings · `configschema.json`

## Connections

- Extension hub → Replicants: initializes · Bootstraps shared state and message wiring
- Extension hub → Donations: loads · Registers donation integration module
- Extension hub → Incentives: loads · Registers incentives module
- Extension hub → Schedule import: loads · Registers schedule import module
- Extension hub → Prizes: loads · Registers prize module
- Extension hub → Host reads: loads · Registers host-read module
- Extension hub → Runner tablet: loads · Registers runner tablet module
- Extension hub → Audio cues: loads · Registers audio integration module
- Extension hub → OBS local: loads · Registers OBS/local state module
- Schedule import → Shared state: writes · Converts imported schedule into shared run state
- Donations → Shared state: writes · Publishes donation totals and events
- Incentives → Shared state: writes · Publishes incentive goals and wars
- Prizes → Shared state: writes · Publishes prize data
- Host reads → Shared state: writes · Publishes host-read content
- Runner tablet → Shared state: writes · Publishes tablet state
- Audio cues → Shared state: writes · Publishes audio indicator and X32 state
- OBS local → Shared state: writes · Publishes OBS-local data
- Shared state → Run hooks: consumed by · Hooks derive nearby run state for UI
- Shared state → Stage view: reads · Stage management reflects live run state
- Shared state → Donations: reads · Donation panel reflects live totals and matches
- Shared state → Bingo: reads · Bingo panel reflects game state
- Shared state → Overlays: reads · Gameplay overlays consume shared state
- Shared state → Ticker: reads · Ticker consumes live run and donation state
- Shared state → Intermission: reads · Intermission screens consume run, incentive, and sponsor state
- Shared state → Host dash: reads · Host dashboard renders live host and donation state
- Shared state → Runner tablet: reads · Runner tablet renders live operator-controlled state
- Shared state → Gameplay: reads · Gameplay overlay uses run metadata and timers
- Stage view → Replicants: updates · Operator edits feed back into shared state
- Settings → Config schema: generates · Settings drive event-specific config generation
- Settings → OBS assets: writes · Emits OBS presets and scene/source artifacts
- Settings → OBS local: configures · Controls OBS integration parameters
- Settings → Audio cues: configures · Controls X32 and audio integration settings
- Settings → Donations: configures · Controls Tiltify and donation settings
- Settings → Schedule import: configures · Controls schedule import settings
- Settings → Prizes: configures · Controls prize-related settings
- Settings → Host reads: configures · Controls host-read settings
- Shared types → Extension hub: types · Extension code uses common data contracts
- Shared types → Stage view: types · Dashboard panels use common data contracts
- Shared types → Overlays: types · Graphics use common data contracts
- Run hooks → Stage view: uses · Stage view uses surrounding run helpers
- Run hooks → Gameplay: uses · Graphics use current and next run helpers
- Shared assets → Overlays: uses · Overlays consume fonts, sponsors, and design assets
- Shared assets → Intermission: uses · Intermission screens consume shared visual assets
- OBS assets → OBS local: feeds · OBS presets support local scene generation
- Config schema → Settings: documented by · Settings UI maps to generated schema
