# roryp/hydrafusion architecture

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

- Interactive diagram: https://gitdiagram.com/roryp/hydrafusion
- Repository: https://github.com/roryp/hydrafusion

## Overview

This is a Copilot Fusion accessibility-workshop app: participants replay recorded runs and compare live model audits with fixed browser checks. The dashboard is served by a Node HTTP server; live runs use the Copilot SDK and optional browser tools, while recordings and shared trace logic support replay and cost inspection. The README and sampled files establish the main flow; unsampled dashboard wiring and some server internals limit which detailed API edges can be shown.

Main entry points: [`src/server.mjs`](https://github.com/roryp/hydrafusion/blob/main/src/server.mjs) (HTTP server and API), [`public/app.js`](https://github.com/roryp/hydrafusion/blob/main/public/app.js) (Workshop dashboard), [`src/live.mjs`](https://github.com/roryp/hydrafusion/blob/main/src/live.mjs) (Live run coordinator), [`src/recordings.mjs`](https://github.com/roryp/hydrafusion/blob/main/src/recordings.mjs) (Recording service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Workshop experience"]
  node_dashboard["Workshop dashboard<br/>[app.js]"]
  node_tutorials["Workshop tutorials<br/>[tutorials.html]"]
  node_demo_page["Accessibility demo page<br/>[index.html]"]
  node_http_server["HTTP server and API<br/>[server.mjs]"]
  node_cli["Demo CLI<br/>[cli.mjs]"]
  node_terminal_view["Terminal run viewer<br/>[terminal.mjs]"]
end

subgraph group_orchestration["Run orchestration"]
  node_live_runner["Live run coordinator<br/>[live.mjs]"]
  node_browser_tools["Browser tools<br/>[browser-mcp.mjs]"]
  node_demo_catalog["Demo and pattern catalog<br/>[demos.mjs]"]
end

subgraph group_accessibility["Accessibility checks"]
  node_check_api["Fixed-check API<br/>[checks.mjs]"]
  node_check_runner["Playwright check runner<br/>[run-checks.mjs]"]
  node_check_snippets["Eight check snippets"]
end

subgraph group_run_data["Run data and traces"]
  node_recording_service["Recording service<br/>[recordings.mjs]"]
  node_recording_files[("Saved recordings")]
  node_run_files[("Local run files")]
  node_trace_model["Trace and cost model<br/>[trace.mjs]"]
end

node_participant(("Participant"))
node_copilot_sdk["Copilot SDK"]
node_browser_user(("Workshop admin"))

node_participant -->|"opens"| node_dashboard
node_dashboard -->|"uses app services"| node_http_server
node_dashboard -->|"opens"| node_tutorials
node_dashboard -->|"previews"| node_demo_page
node_browser_user -->|"starts audits"| node_dashboard
node_http_server -->|"starts live runs"| node_live_runner
node_http_server -->|"loads recordings"| node_recording_service
node_http_server -->|"runs checks"| node_check_runner
node_http_server -->|"reads demos"| node_demo_catalog
node_cli -->|"runs demos"| node_live_runner
node_cli -->|"loads and saves"| node_recording_service
node_cli -->|"serves demo page"| node_http_server
node_cli -->|"prints events"| node_terminal_view
node_live_runner -->|"creates sessions"| node_copilot_sdk
node_live_runner -->|"configures tools"| node_browser_tools
node_live_runner -->|"uses demo settings"| node_demo_catalog
node_check_runner -->|"reads checks"| node_check_api
node_check_runner -->|"executes snippets"| node_check_snippets
node_check_runner -->|"tests page"| node_demo_page
node_recording_service -->|"reads recordings"| node_recording_files
node_recording_service -->|"loads and saves"| node_run_files
node_recording_service -->|"summarizes runs"| node_trace_model
node_terminal_view -->|"renders trace"| node_trace_model

click node_dashboard "https://github.com/roryp/hydrafusion/blob/main/public/app.js"
click node_tutorials "https://github.com/roryp/hydrafusion/blob/main/public/tutorials.html"
click node_demo_page "https://github.com/roryp/hydrafusion/blob/main/demo-page/index.html"
click node_http_server "https://github.com/roryp/hydrafusion/blob/main/src/server.mjs"
click node_cli "https://github.com/roryp/hydrafusion/blob/main/src/cli.mjs"
click node_terminal_view "https://github.com/roryp/hydrafusion/blob/main/src/terminal.mjs"
click node_live_runner "https://github.com/roryp/hydrafusion/blob/main/src/live.mjs"
click node_browser_tools "https://github.com/roryp/hydrafusion/blob/main/src/browser-mcp.mjs"
click node_demo_catalog "https://github.com/roryp/hydrafusion/blob/main/src/shared/demos.mjs"
click node_check_api "https://github.com/roryp/hydrafusion/blob/main/src/shared/checks.mjs"
click node_check_runner "https://github.com/roryp/hydrafusion/blob/main/checks/run-checks.mjs"
click node_check_snippets "https://github.com/roryp/hydrafusion/tree/main/checks"
click node_recording_service "https://github.com/roryp/hydrafusion/blob/main/src/recordings.mjs"
click node_recording_files "https://github.com/roryp/hydrafusion/tree/main/recordings"
click node_run_files "https://github.com/roryp/hydrafusion/tree/main/runs"
click node_trace_model "https://github.com/roryp/hydrafusion/blob/main/src/shared/trace.mjs"

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_dashboard,node_tutorials,node_demo_page,node_http_server,node_cli,node_terminal_view toneBlue
class node_live_runner,node_browser_tools,node_demo_catalog toneAmber
class node_check_api,node_check_runner,node_check_snippets toneMint
class node_recording_service,node_recording_files,node_run_files,node_trace_model toneRose
class node_participant,node_copilot_sdk,node_browser_user toneIndigo
```

## Components

### Workshop experience

- [Workshop dashboard](https://github.com/roryp/hydrafusion/blob/main/public/app.js): `public/app.js`
- [Workshop tutorials](https://github.com/roryp/hydrafusion/blob/main/public/tutorials.html): `public/tutorials.html`
- [Accessibility demo page](https://github.com/roryp/hydrafusion/blob/main/demo-page/index.html): `demo-page/index.html`
- [HTTP server and API](https://github.com/roryp/hydrafusion/blob/main/src/server.mjs): `src/server.mjs`
- [Demo CLI](https://github.com/roryp/hydrafusion/blob/main/src/cli.mjs): `src/cli.mjs`
- [Terminal run viewer](https://github.com/roryp/hydrafusion/blob/main/src/terminal.mjs): `src/terminal.mjs`

### Run orchestration

- [Live run coordinator](https://github.com/roryp/hydrafusion/blob/main/src/live.mjs): `src/live.mjs`
- [Browser tools](https://github.com/roryp/hydrafusion/blob/main/src/browser-mcp.mjs): `src/browser-mcp.mjs`
- [Demo and pattern catalog](https://github.com/roryp/hydrafusion/blob/main/src/shared/demos.mjs): `src/shared/demos.mjs`

### Accessibility checks

- [Fixed-check API](https://github.com/roryp/hydrafusion/blob/main/src/shared/checks.mjs): `src/shared/checks.mjs`
- [Playwright check runner](https://github.com/roryp/hydrafusion/blob/main/checks/run-checks.mjs): `checks/run-checks.mjs`
- [Eight check snippets](https://github.com/roryp/hydrafusion/tree/main/checks): `checks`

### Run data and traces

- [Recording service](https://github.com/roryp/hydrafusion/blob/main/src/recordings.mjs): `src/recordings.mjs`
- [Saved recordings](https://github.com/roryp/hydrafusion/tree/main/recordings): `recordings`
- [Local run files](https://github.com/roryp/hydrafusion/tree/main/runs): `runs`
- [Trace and cost model](https://github.com/roryp/hydrafusion/blob/main/src/shared/trace.mjs): `src/shared/trace.mjs`

### Other components

- **Participant**
- **Copilot SDK**
- **Workshop admin**

## Connections

- Participant → Workshop dashboard: opens (evidence: `Readme.md`)
- Workshop dashboard → HTTP server and API: uses app services (evidence: `Readme.md`)
- Workshop dashboard → Workshop tutorials: opens (evidence: `Readme.md`)
- Workshop dashboard → Accessibility demo page: previews (evidence: `Readme.md`)
- Workshop admin → Workshop dashboard: starts audits (evidence: `Readme.md`)
- HTTP server and API → Live run coordinator: starts live runs (evidence: `src/server.mjs`)
- HTTP server and API → Recording service: loads recordings (evidence: `src/server.mjs`)
- HTTP server and API → Playwright check runner: runs checks (evidence: `src/server.mjs`)
- HTTP server and API → Demo and pattern catalog: reads demos (evidence: `src/server.mjs`)
- Demo CLI → Live run coordinator: runs demos (evidence: `src/cli.mjs`)
- Demo CLI → Recording service: loads and saves (evidence: `src/cli.mjs`)
- Demo CLI → HTTP server and API: serves demo page (evidence: `src/cli.mjs`)
- Demo CLI → Terminal run viewer: prints events (evidence: `src/cli.mjs`)
- Live run coordinator → Copilot SDK: creates sessions (evidence: `src/live.mjs`)
- Live run coordinator → Browser tools: configures tools (evidence: `src/live.mjs`)
- Live run coordinator → Demo and pattern catalog: uses demo settings (evidence: `src/live.mjs`)
- Playwright check runner → Fixed-check API: reads checks (evidence: `checks/run-checks.mjs`)
- Playwright check runner → Eight check snippets: executes snippets
- Playwright check runner → Accessibility demo page: tests page (evidence: `checks/run-checks.mjs`)
- Recording service → Saved recordings: reads recordings (evidence: `src/recordings.mjs`)
- Recording service → Local run files: loads and saves (evidence: `src/recordings.mjs`)
- Recording service → Trace and cost model: summarizes runs (evidence: `src/recordings.mjs`)
- Terminal run viewer → Trace and cost model: renders trace (evidence: `src/terminal.mjs`)
