# sk07shubh/yourvision architecture

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

- Interactive diagram: https://gitdiagram.com/sk07shubh/yourvision
- Repository: https://github.com/sk07shubh/yourvision

## Overview

YourVision is a LeetCode Java execution visualizer. Its main workflow reads the solution and selected testcase from the LeetCode page, sends them to a local backend for traced execution, converts execution events into visual states, and presents those states for inspection and playback. The graph also preserves the Java tracing internals and LeetCode testcase/editor integration. Some Java internals and extension behavior are identified by the source index but not excerpted, so their unverified runtime links are omitted.

Main entry points: [`extension/src/leetcode/integration.tsx`](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/integration.tsx) (Page integration), [`extension/src/leetcode/dom-testcase.ts`](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/dom-testcase.ts) (DOM testcase reader), [`extension/src/components/VisualizerPanel.tsx`](https://github.com/sk07shubh/yourvision/blob/main/extension/src/components/VisualizerPanel.tsx) (Visualizer panel), [`backend/src/execution/java/runner.ts`](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/runner.ts) (Java runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["LeetCode integration"]
  node_content["Content entry<br/>[main.tsx]"]
  node_integration["Page integration<br/>[integration.tsx]"]
  node_selectors["Page selectors<br/>[selectors.ts]"]
  node_source["Editor source<br/>[code-source.ts]"]
  node_method["Method inference<br/>[method.ts]"]
  node_domtest["DOM testcase reader<br/>[dom-testcase.ts]"]
  node_testcase["Testcase parser<br/>[testcase.ts]"]
  node_leetcode_types["LeetCode types<br/>[leetcode.ts]"]
  node_overlay["Editor overlay<br/>[editor-overlay.ts]"]
end

subgraph group_extension["Extension UI and state"]
  node_panel["Visualizer panel"]
  node_store["Session store<br/>[store.ts]"]
  node_session["Session facade<br/>[session.ts]"]
  node_worker["Background worker<br/>[service-worker.ts]"]
  node_api["Backend API client<br/>[backend.ts]"]
  node_messages["Message types<br/>[messages.ts]"]
  node_extension_trace_types["Trace types<br/>[trace.ts]"]
end

subgraph group_backend["Execution backend"]
  node_server["HTTP server<br/>[server.ts]"]
  node_runner["Java runner<br/>[runner.ts]"]
  node_runtime["Java runtime"]
  node_tracer["Event tracer"]
  node_probe["Source probe"]
  node_listnode["List node support"]
  node_treenode["Tree node support"]
end

subgraph group_trace["Trace processing"]
  node_enrich["Trace enrichment<br/>[enrichTrace.ts]"]
  node_builder["State builder<br/>[stateBuilder.ts]"]
  node_schema["Trace schema<br/>[schema.ts]"]
end

node_leetcode(("LeetCode page"))

node_content -->|"loads integration"| node_integration
node_integration -->|"locates UI"| node_selectors
node_integration -->|"reads source"| node_source
node_integration -->|"infers method"| node_method
node_integration -->|"reads testcase"| node_domtest
node_domtest -->|"uses parser"| node_testcase
node_domtest -->|"queries DOM"| node_selectors
node_method -->|"uses types"| node_leetcode_types
node_domtest -->|"uses types"| node_leetcode_types
node_testcase -->|"uses types"| node_leetcode_types
node_integration -->|"mounts panel"| node_panel
node_integration -->|"begins session"| node_store
node_panel -->|"controls playback"| node_store
node_panel -->|"uses session"| node_session
node_panel -->|"uses editor overlay"| node_overlay
node_integration -->|"uses API"| node_api
node_worker -->|"posts execution"| node_server
node_server -->|"runs Java"| node_runner
node_runner -->|"enriches trace"| node_enrich
node_runner -->|"builds states"| node_builder
node_enrich -->|"uses types"| node_schema
node_builder -->|"uses types"| node_schema
node_integration -.->|"reads page"| node_leetcode
node_runner -.->|"executes with"| node_runtime
node_runtime -.->|"records events"| node_tracer
node_tracer -.->|"uses source data"| node_probe
node_worker -.->|"dispatches requests"| node_api
node_store -->|"uses types"| node_extension_trace_types
node_api -->|"uses types"| node_messages
node_api -->|"uses types"| node_extension_trace_types

click node_content "https://github.com/sk07shubh/yourvision/blob/main/extension/src/content/main.tsx"
click node_integration "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/integration.tsx"
click node_selectors "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/selectors.ts"
click node_source "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/code-source.ts"
click node_method "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/method.ts"
click node_domtest "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/dom-testcase.ts"
click node_testcase "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/testcase.ts"
click node_leetcode_types "https://github.com/sk07shubh/yourvision/blob/main/extension/src/types/leetcode.ts"
click node_overlay "https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/editor-overlay.ts"
click node_panel "https://github.com/sk07shubh/yourvision/blob/main/extension/src/components/VisualizerPanel.tsx"
click node_store "https://github.com/sk07shubh/yourvision/blob/main/extension/src/state/store.ts"
click node_session "https://github.com/sk07shubh/yourvision/blob/main/extension/src/state/session.ts"
click node_worker "https://github.com/sk07shubh/yourvision/blob/main/extension/src/background/service-worker.ts"
click node_api "https://github.com/sk07shubh/yourvision/blob/main/extension/src/api/backend.ts"
click node_messages "https://github.com/sk07shubh/yourvision/blob/main/extension/src/types/messages.ts"
click node_extension_trace_types "https://github.com/sk07shubh/yourvision/blob/main/extension/src/types/trace.ts"
click node_server "https://github.com/sk07shubh/yourvision/blob/main/backend/src/server.ts"
click node_runner "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/runner.ts"
click node_runtime "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/YourVisionRuntime.java"
click node_tracer "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/YourVisionTracer.java"
click node_probe "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/YourVisionSourceProbe.java"
click node_listnode "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/LeetCodeListNode.java"
click node_treenode "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/LeetCodeTreeNode.java"
click node_enrich "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/trace/enrichTrace.ts"
click node_builder "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/trace/stateBuilder.ts"
click node_schema "https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/trace/schema.ts"

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_content,node_integration,node_selectors,node_source,node_method,node_domtest,node_testcase,node_leetcode_types,node_overlay toneBlue
class node_panel,node_store,node_session,node_worker,node_api,node_messages,node_extension_trace_types toneAmber
class node_server,node_runner,node_runtime,node_tracer,node_probe,node_listnode,node_treenode toneMint
class node_enrich,node_builder,node_schema toneRose
class node_leetcode toneIndigo
```

## Components

### LeetCode integration

- [Content entry](https://github.com/sk07shubh/yourvision/blob/main/extension/src/content/main.tsx): `extension/src/content/main.tsx`
- [Page integration](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/integration.tsx): `extension/src/leetcode/integration.tsx`
- [Page selectors](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/selectors.ts): `extension/src/leetcode/selectors.ts`
- [Editor source](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/code-source.ts): `extension/src/leetcode/code-source.ts`
- [Method inference](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/method.ts): `extension/src/leetcode/method.ts`
- [DOM testcase reader](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/dom-testcase.ts): `extension/src/leetcode/dom-testcase.ts`
- [Testcase parser](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/testcase.ts): `extension/src/leetcode/testcase.ts`
- [LeetCode types](https://github.com/sk07shubh/yourvision/blob/main/extension/src/types/leetcode.ts): `extension/src/types/leetcode.ts`
- [Editor overlay](https://github.com/sk07shubh/yourvision/blob/main/extension/src/leetcode/editor-overlay.ts): `extension/src/leetcode/editor-overlay.ts`

### Extension UI and state

- [Visualizer panel](https://github.com/sk07shubh/yourvision/blob/main/extension/src/components/VisualizerPanel.tsx): `extension/src/components/VisualizerPanel.tsx`
- [Session store](https://github.com/sk07shubh/yourvision/blob/main/extension/src/state/store.ts): `extension/src/state/store.ts`
- [Session facade](https://github.com/sk07shubh/yourvision/blob/main/extension/src/state/session.ts): `extension/src/state/session.ts`
- [Background worker](https://github.com/sk07shubh/yourvision/blob/main/extension/src/background/service-worker.ts): `extension/src/background/service-worker.ts`
- [Backend API client](https://github.com/sk07shubh/yourvision/blob/main/extension/src/api/backend.ts): `extension/src/api/backend.ts`
- [Message types](https://github.com/sk07shubh/yourvision/blob/main/extension/src/types/messages.ts): `extension/src/types/messages.ts`
- [Trace types](https://github.com/sk07shubh/yourvision/blob/main/extension/src/types/trace.ts): `extension/src/types/trace.ts`

### Execution backend

- [HTTP server](https://github.com/sk07shubh/yourvision/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Java runner](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/runner.ts): `backend/src/execution/java/runner.ts`
- [Java runtime](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/YourVisionRuntime.java): `backend/src/execution/java/YourVisionRuntime.java`
- [Event tracer](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/YourVisionTracer.java): `backend/src/execution/java/YourVisionTracer.java`
- [Source probe](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/YourVisionSourceProbe.java): `backend/src/execution/java/YourVisionSourceProbe.java`
- [List node support](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/LeetCodeListNode.java): `backend/src/execution/java/LeetCodeListNode.java`
- [Tree node support](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/java/LeetCodeTreeNode.java): `backend/src/execution/java/LeetCodeTreeNode.java`

### Trace processing

- [Trace enrichment](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/trace/enrichTrace.ts): `backend/src/execution/trace/enrichTrace.ts`
- [State builder](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/trace/stateBuilder.ts): `backend/src/execution/trace/stateBuilder.ts`
- [Trace schema](https://github.com/sk07shubh/yourvision/blob/main/backend/src/execution/trace/schema.ts): `backend/src/execution/trace/schema.ts`

### Other components

- **LeetCode page**

## Connections

- Content entry → Page integration: loads integration (evidence: `extension/src/content/main.tsx`)
- Page integration → Page selectors: locates UI (evidence: `extension/src/leetcode/integration.tsx`)
- Page integration → Editor source: reads source (evidence: `extension/src/leetcode/integration.tsx`)
- Page integration → Method inference: infers method (evidence: `extension/src/leetcode/integration.tsx`)
- Page integration → DOM testcase reader: reads testcase (evidence: `extension/src/leetcode/integration.tsx`)
- DOM testcase reader → Testcase parser: uses parser (evidence: `extension/src/leetcode/dom-testcase.ts`)
- DOM testcase reader → Page selectors: queries DOM (evidence: `extension/src/leetcode/dom-testcase.ts`)
- Method inference → LeetCode types: uses types (evidence: `extension/src/leetcode/method.ts`)
- DOM testcase reader → LeetCode types: uses types (evidence: `extension/src/leetcode/dom-testcase.ts`)
- Testcase parser → LeetCode types: uses types (evidence: `extension/src/leetcode/testcase.ts`)
- Page integration → Visualizer panel: mounts panel (evidence: `extension/src/leetcode/integration.tsx`)
- Page integration → Session store: begins session (evidence: `extension/src/leetcode/integration.tsx`)
- Visualizer panel → Session store: controls playback (evidence: `extension/src/components/VisualizerPanel.tsx`)
- Visualizer panel → Session facade: uses session (evidence: `extension/src/components/VisualizerPanel.tsx`)
- Visualizer panel → Editor overlay: uses editor overlay (evidence: `extension/src/components/VisualizerPanel.tsx`)
- Page integration → Backend API client: uses API (evidence: `extension/src/leetcode/integration.tsx`)
- Background worker → HTTP server: posts execution (evidence: `extension/src/background/service-worker.ts`)
- HTTP server → Java runner: runs Java (evidence: `backend/src/server.ts`)
- Java runner → Trace enrichment: enriches trace (evidence: `backend/src/execution/java/runner.ts`)
- Java runner → State builder: builds states (evidence: `backend/src/execution/java/runner.ts`)
- Trace enrichment → Trace schema: uses types (evidence: `backend/src/execution/trace/enrichTrace.ts`)
- State builder → Trace schema: uses types (evidence: `backend/src/execution/trace/stateBuilder.ts`)
- Page integration → LeetCode page: reads page
- Java runner → Java runtime: executes with
- Java runtime → Event tracer: records events
- Event tracer → Source probe: uses source data
- Background worker → Backend API client: dispatches requests
- Session store → Trace types: uses types (evidence: `extension/src/state/store.ts`)
- Backend API client → Message types: uses types (evidence: `extension/src/api/backend.ts`)
- Backend API client → Trace types: uses types (evidence: `extension/src/api/backend.ts`)
