How ausspeedruns/asm-graphics works
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: replicants.ts Shared state · index.ts Extension hub · settings.tsx Settings · obs-local.ts OBS local
Components 27
Extensions
Server-side NodeCG integrations and state orchestration
- Extension hub · Bootstraps the server-side bundle and wires feature modules together
src/extensions/index.ts - Replicants · Central shared state definitions and extension-side bindings
src/extensions/replicants.ts - Donations · Donation ingestion and donation-related state updates
src/extensions/donations.ts - Incentives · Incentive and war tracking sourced from external services
src/extensions/incentives.ts - Schedule import · Imports and converts schedule data into shared run state
src/extensions/schedule-import.ts - Prizes · Prize state and prize-related coordination
src/extensions/prizes.ts - Host reads · Host-read text and delivery state
src/extensions/host-reads.ts - Runner tablet · Runner-facing tablet state and controls
src/extensions/runner-tablet.ts - Audio cues · Game audio indicators and X32 audio integration
src/extensions/x32-audio.ts - OBS local · Local OBS-related data and scene coordination
src/extensions/obs-local.ts
Dashboard
Operator panels and live control surfaces
- Stage view · Live run management, ordering, editing, and talkback workflow
src/dashboard/stage-view.tsx - Settings · Integration settings and generated artifact controls
src/dashboard/settings.tsx - Donations · Donation monitoring and operator controls
src/dashboard/donations.tsx - Bingo · Bingo and race-specific control surface
src/dashboard/bingo.tsx - Countdown · Timer and countdown controls
src/dashboard/countdown.tsx
Graphics
On-stream browser outputs and overlays
- Overlays · Aspect-ratio and platform-specific gameplay overlays
src/graphics/overlays - Ticker · Scrolling omnibar and compact live information surfaces
src/graphics/ticker.tsx - Intermission · Between-run and incentive-focused full-screen graphics
src/graphics/intermission.tsx - Host dash · On-stream host dashboard with donation and incentive controls
src/graphics/host-dashboard.tsx - Runner tablet · Runner-facing tablet view rendered in the browser
src/graphics/runner-tablet.tsx - Gameplay · Primary gameplay overlay and presentation screens
src/graphics/gameplay-overlay.tsx
Shared
Cross-runtime data contracts and hooks
- Shared state · Replicant names and cross-runtime data contracts
src/shared/replicants.ts - Shared types · Common TypeScript definitions for runs, donations, incentives, audio, and config
src/shared/types - Run hooks · Shared helpers for current, next, previous, and surrounding runs
src/shared/hooks
Assets
Bundle resources and OBS media/config
- OBS assets · Scene presets, transition media, and OBS bundle resources
obs - Shared assets · Fonts, sponsors, design assets, and shared visual resources
shared - Config schema · Generated event configuration schema for integrations and OBS settings
configschema.json
Connections 45
- 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