# adirwt852-cloud/graph architecture

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

- Interactive diagram: https://gitdiagram.com/adirwt852-cloud/graph
- Repository: https://github.com/adirwt852-cloud/graph

## Overview

GraphFlow scans frontend and backend source to build a dependency graph, then supports impact simulations, runtime-trace views, reports, and evaluation. Users can access the analysis through the CLI, server-backed UI, or GitHub Action. The supplied excerpts show key scanner, graph-builder, simulator, and UI relationships; some package capabilities are indexed but their internal call paths were not sampled, so those links are omitted.

Main entry points: [`src/App.tsx`](https://github.com/adirwt852-cloud/graph/blob/main/src/App.tsx) (Analysis UI), [`packages/cli/src/index.ts`](https://github.com/adirwt852-cloud/graph/blob/main/packages/cli/src/index.ts) (CLI), [`server.ts`](https://github.com/adirwt852-cloud/graph/blob/main/server.ts) (Web Server), [`packages/simulator/src/simulator.ts`](https://github.com/adirwt852-cloud/graph/blob/main/packages/simulator/src/simulator.ts) (What-if Simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entrypoints["Entry Points"]
  node_cli["CLI<br/>[index.ts]"]
  node_server["Web Server<br/>[server.ts]"]
  node_github_action["GitHub Action<br/>[action.ts]"]
end

subgraph group_analysis["Graph Analysis"]
  node_frontend_scanner["Frontend Scanner<br/>[frontendScanner.ts]"]
  node_backend_scanner["Backend Scanner<br/>[backendScanner.ts]"]
  node_route_matcher["Route Matcher<br/>[routeMatcher.ts]"]
  node_graph_builder["Graph Builder<br/>[graphBuilder.ts]"]
  node_graph_types["Graph Types<br/>[types.ts]"]
end

subgraph group_impact["Impact &amp; Evidence"]
  node_simulator["What-if Simulator<br/>[simulator.ts]"]
  node_evaluation["Evaluation Harness"]
  node_runtime_agent["Runtime Agent<br/>[runtimeAgent.ts]"]
end

subgraph group_presentation["Reports &amp; UI"]
  node_html_reporter["HTML Reporter<br/>[htmlReporter.ts]"]
  node_pr_formatter["PR Comment Formatter"]
  node_app["Analysis UI<br/>[App.tsx]"]
  node_graph_canvas["Graph Canvas<br/>[GraphCanvas.tsx]"]
  node_node_inspector["Node Inspector"]
  node_simulation_controls["Simulation Controls"]
  node_scenario_compare["Scenario Comparison"]
  node_evaluation_dashboard["Evaluation Dashboard"]
  node_pr_simulator["PR Comment Preview"]
  node_runtime_view["Runtime Trace View"]
  node_unresolved_sites["Unresolved Sites"]
end

node_engineer(("Engineer"))

node_engineer -->|"runs analysis"| node_cli
node_engineer -->|"uses web UI"| node_server
node_engineer -.->|"runs action"| node_github_action
node_cli -->|"scans frontend"| node_frontend_scanner
node_cli -->|"scans backend"| node_backend_scanner
node_cli -->|"matches routes"| node_route_matcher
node_cli -->|"builds graph"| node_graph_builder
node_cli -->|"runs simulation"| node_simulator
node_server -->|"scans frontend"| node_frontend_scanner
node_server -->|"scans backend"| node_backend_scanner
node_server -->|"matches routes"| node_route_matcher
node_server -->|"builds graph"| node_graph_builder
node_server -->|"runs scenarios"| node_simulator
node_frontend_scanner -->|"provides call sites"| node_route_matcher
node_backend_scanner -->|"provides routes"| node_route_matcher
node_graph_builder -->|"uses graph model"| node_graph_types
node_simulator -->|"uses graph model"| node_graph_types
node_evaluation -->|"runs simulations"| node_simulator
node_app -->|"renders graph"| node_graph_canvas
node_app -->|"shows node details"| node_node_inspector
node_app -->|"offers controls"| node_simulation_controls
node_app -->|"shows comparisons"| node_scenario_compare
node_app -->|"shows evaluation"| node_evaluation_dashboard
node_app -->|"shows preview"| node_pr_simulator
node_app -->|"shows traces"| node_runtime_view
node_app -->|"shows unresolved calls"| node_unresolved_sites
node_pr_simulator -->|"formats comment"| node_pr_formatter

click node_cli "https://github.com/adirwt852-cloud/graph/blob/main/packages/cli/src/index.ts"
click node_server "https://github.com/adirwt852-cloud/graph/blob/main/server.ts"
click node_github_action "https://github.com/adirwt852-cloud/graph/blob/main/packages/github-action/src/action.ts"
click node_frontend_scanner "https://github.com/adirwt852-cloud/graph/blob/main/packages/scanner/src/frontendScanner.ts"
click node_backend_scanner "https://github.com/adirwt852-cloud/graph/blob/main/packages/scanner/src/backendScanner.ts"
click node_route_matcher "https://github.com/adirwt852-cloud/graph/blob/main/packages/scanner/src/routeMatcher.ts"
click node_graph_builder "https://github.com/adirwt852-cloud/graph/blob/main/packages/graph-builder/src/graphBuilder.ts"
click node_graph_types "https://github.com/adirwt852-cloud/graph/blob/main/packages/graph-builder/src/types.ts"
click node_simulator "https://github.com/adirwt852-cloud/graph/blob/main/packages/simulator/src/simulator.ts"
click node_evaluation "https://github.com/adirwt852-cloud/graph/blob/main/packages/evaluation/src/evaluationHarness.ts"
click node_runtime_agent "https://github.com/adirwt852-cloud/graph/blob/main/packages/runtime-agent/src/runtimeAgent.ts"
click node_html_reporter "https://github.com/adirwt852-cloud/graph/blob/main/packages/reporter/src/htmlReporter.ts"
click node_pr_formatter "https://github.com/adirwt852-cloud/graph/blob/main/packages/reporter/src/prCommentFormatter.ts"
click node_app "https://github.com/adirwt852-cloud/graph/blob/main/src/App.tsx"
click node_graph_canvas "https://github.com/adirwt852-cloud/graph/blob/main/src/components/GraphCanvas.tsx"
click node_node_inspector "https://github.com/adirwt852-cloud/graph/blob/main/src/components/NodeInspectorModal.tsx"
click node_simulation_controls "https://github.com/adirwt852-cloud/graph/blob/main/src/components/SimulationControls.tsx"
click node_scenario_compare "https://github.com/adirwt852-cloud/graph/blob/main/src/components/ScenarioComparisonModal.tsx"
click node_evaluation_dashboard "https://github.com/adirwt852-cloud/graph/blob/main/src/components/EvaluationDashboard.tsx"
click node_pr_simulator "https://github.com/adirwt852-cloud/graph/blob/main/src/components/PrCommentSimulator.tsx"
click node_runtime_view "https://github.com/adirwt852-cloud/graph/blob/main/src/components/RuntimeTraceView.tsx"
click node_unresolved_sites "https://github.com/adirwt852-cloud/graph/blob/main/src/components/UnresolvedSitesModal.tsx"

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_cli,node_server,node_github_action toneBlue
class node_frontend_scanner,node_backend_scanner,node_route_matcher,node_graph_builder,node_graph_types toneAmber
class node_simulator,node_evaluation,node_runtime_agent toneMint
class node_html_reporter,node_pr_formatter,node_app,node_graph_canvas,node_node_inspector,node_simulation_controls,node_scenario_compare,node_evaluation_dashboard,node_pr_simulator,node_runtime_view,node_unresolved_sites toneRose
class node_engineer toneIndigo
```

## Components

### Entry Points

- [CLI](https://github.com/adirwt852-cloud/graph/blob/main/packages/cli/src/index.ts): `packages/cli/src/index.ts`
- [Web Server](https://github.com/adirwt852-cloud/graph/blob/main/server.ts): `server.ts`
- [GitHub Action](https://github.com/adirwt852-cloud/graph/blob/main/packages/github-action/src/action.ts): `packages/github-action/src/action.ts`

### Graph Analysis

- [Frontend Scanner](https://github.com/adirwt852-cloud/graph/blob/main/packages/scanner/src/frontendScanner.ts): `packages/scanner/src/frontendScanner.ts`
- [Backend Scanner](https://github.com/adirwt852-cloud/graph/blob/main/packages/scanner/src/backendScanner.ts): `packages/scanner/src/backendScanner.ts`
- [Route Matcher](https://github.com/adirwt852-cloud/graph/blob/main/packages/scanner/src/routeMatcher.ts): `packages/scanner/src/routeMatcher.ts`
- [Graph Builder](https://github.com/adirwt852-cloud/graph/blob/main/packages/graph-builder/src/graphBuilder.ts): `packages/graph-builder/src/graphBuilder.ts`
- [Graph Types](https://github.com/adirwt852-cloud/graph/blob/main/packages/graph-builder/src/types.ts): `packages/graph-builder/src/types.ts`

### Impact & Evidence

- [What-if Simulator](https://github.com/adirwt852-cloud/graph/blob/main/packages/simulator/src/simulator.ts): `packages/simulator/src/simulator.ts`
- [Evaluation Harness](https://github.com/adirwt852-cloud/graph/blob/main/packages/evaluation/src/evaluationHarness.ts): `packages/evaluation/src/evaluationHarness.ts`
- [Runtime Agent](https://github.com/adirwt852-cloud/graph/blob/main/packages/runtime-agent/src/runtimeAgent.ts): `packages/runtime-agent/src/runtimeAgent.ts`

### Reports & UI

- [HTML Reporter](https://github.com/adirwt852-cloud/graph/blob/main/packages/reporter/src/htmlReporter.ts): `packages/reporter/src/htmlReporter.ts`
- [PR Comment Formatter](https://github.com/adirwt852-cloud/graph/blob/main/packages/reporter/src/prCommentFormatter.ts): `packages/reporter/src/prCommentFormatter.ts`
- [Analysis UI](https://github.com/adirwt852-cloud/graph/blob/main/src/App.tsx): `src/App.tsx`
- [Graph Canvas](https://github.com/adirwt852-cloud/graph/blob/main/src/components/GraphCanvas.tsx): `src/components/GraphCanvas.tsx`
- [Node Inspector](https://github.com/adirwt852-cloud/graph/blob/main/src/components/NodeInspectorModal.tsx): `src/components/NodeInspectorModal.tsx`
- [Simulation Controls](https://github.com/adirwt852-cloud/graph/blob/main/src/components/SimulationControls.tsx): `src/components/SimulationControls.tsx`
- [Scenario Comparison](https://github.com/adirwt852-cloud/graph/blob/main/src/components/ScenarioComparisonModal.tsx): `src/components/ScenarioComparisonModal.tsx`
- [Evaluation Dashboard](https://github.com/adirwt852-cloud/graph/blob/main/src/components/EvaluationDashboard.tsx): `src/components/EvaluationDashboard.tsx`
- [PR Comment Preview](https://github.com/adirwt852-cloud/graph/blob/main/src/components/PrCommentSimulator.tsx): `src/components/PrCommentSimulator.tsx`
- [Runtime Trace View](https://github.com/adirwt852-cloud/graph/blob/main/src/components/RuntimeTraceView.tsx): `src/components/RuntimeTraceView.tsx`
- [Unresolved Sites](https://github.com/adirwt852-cloud/graph/blob/main/src/components/UnresolvedSitesModal.tsx): `src/components/UnresolvedSitesModal.tsx`

### Other components

- **Engineer**

## Connections

- Engineer → CLI: runs analysis (evidence: `packages/cli/src/index.ts`)
- Engineer → Web Server: uses web UI (evidence: `server.ts`)
- Engineer → GitHub Action: runs action
- CLI → Frontend Scanner: scans frontend (evidence: `packages/cli/src/index.ts`)
- CLI → Backend Scanner: scans backend (evidence: `packages/cli/src/index.ts`)
- CLI → Route Matcher: matches routes (evidence: `packages/cli/src/index.ts`)
- CLI → Graph Builder: builds graph (evidence: `packages/cli/src/index.ts`)
- CLI → What-if Simulator: runs simulation (evidence: `packages/cli/src/index.ts`)
- Web Server → Frontend Scanner: scans frontend (evidence: `server.ts`)
- Web Server → Backend Scanner: scans backend (evidence: `server.ts`)
- Web Server → Route Matcher: matches routes (evidence: `server.ts`)
- Web Server → Graph Builder: builds graph (evidence: `server.ts`)
- Web Server → What-if Simulator: runs scenarios (evidence: `server.ts`)
- Frontend Scanner → Route Matcher: provides call sites (evidence: `packages/scanner/src/routeMatcher.ts`)
- Backend Scanner → Route Matcher: provides routes (evidence: `packages/scanner/src/routeMatcher.ts`)
- Graph Builder → Graph Types: uses graph model (evidence: `packages/graph-builder/src/graphBuilder.ts`)
- What-if Simulator → Graph Types: uses graph model (evidence: `packages/simulator/src/simulator.ts`)
- Evaluation Harness → What-if Simulator: runs simulations (evidence: `packages/evaluation/src/evaluationHarness.ts`)
- Analysis UI → Graph Canvas: renders graph (evidence: `src/App.tsx`)
- Analysis UI → Node Inspector: shows node details (evidence: `src/App.tsx`)
- Analysis UI → Simulation Controls: offers controls (evidence: `src/App.tsx`)
- Analysis UI → Scenario Comparison: shows comparisons (evidence: `src/App.tsx`)
- Analysis UI → Evaluation Dashboard: shows evaluation (evidence: `src/App.tsx`)
- Analysis UI → PR Comment Preview: shows preview (evidence: `src/App.tsx`)
- Analysis UI → Runtime Trace View: shows traces (evidence: `src/App.tsx`)
- Analysis UI → Unresolved Sites: shows unresolved calls (evidence: `src/App.tsx`)
- PR Comment Preview → PR Comment Formatter: formats comment (evidence: `src/components/PrCommentSimulator.tsx`)
