# spandandey961-max/spandy-shows architecture

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

- Interactive diagram: https://gitdiagram.com/spandandey961-max/spandy-shows
- Repository: https://github.com/spandandey961-max/spandy-shows

## Overview

Spandy Shows is an offline desktop app for running Python, Java, and C programs and visualizing their recorded execution. The main workflow is: a user edits or selects a program, requests a run or visualization, the backend manages execution and input, and the UI presents output and trace steps for playback and inspection. Desktop mode also provides a local program library. The README documents language-specific tracing and inspection capabilities; some implementation links are shown only as unverified where the excerpts do not establish the call path.

Main entry points: [`spandy-shows/src/App.tsx`](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/App.tsx) (Workspace App), [`spandy-shows/backend/runner.py`](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/runner.py) (Job Runner), [`spandy-shows/backend/app.py`](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/app.py) (Execution API), [`spandy-shows/backend/c_worker.py`](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_worker.py) (C Execution Worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Code Workspace"]
  node_app["Workspace App<br/>[App.tsx]"]
  node_editor["Code Editor<br/>[Editor.tsx]"]
  node_examples["Example Programs<br/>[examples.ts]"]
end

subgraph group_execution["Execution Service"]
  node_api["Execution API<br/>[app.py]"]
  node_schema["Job and Trace Schema<br/>[schema.py]"]
  node_runner["Job Runner<br/>[runner.py]"]
  node_limits["Resource Limits<br/>[limits.py]"]
  node_input["Interactive Input<br/>[interactive.py]"]
end

subgraph group_tracing["Trace Collection"]
  node_python["Python Tracing<br/>[python_worker.py]"]
  node_java["Java Tracing<br/>[java_worker.py]"]
  node_javahelper["Java Runtime Helper<br/>[SpandyRun.java]"]
  node_javatracer["Java JDI Tracer<br/>[SpandyTracer.java]"]
  node_cworker["C Execution Worker<br/>[c_worker.py]"]
  node_cobserver["C State Observer<br/>[c_observer.py]"]
  node_ccapture["C Output Capture<br/>[c_capture.c]"]
end

subgraph group_inspection["Trace Inspection"]
  node_diagram["Memory Diagram<br/>[Diagram.tsx]"]
  node_memory["Memory Layout<br/>[memoryLayout.ts]"]
  node_output["Program Output<br/>[Output.tsx]"]
  node_stepdetails["Step Explanation<br/>[stepDetails.ts]"]
end

subgraph group_desktop["Desktop Services"]
  node_library[("Local Program Library<br/>[library.py]")]
  node_desktopservice["Desktop Backend Service<br/>[service.py]"]
  node_desktopmain["Desktop Shell<br/>[main.cjs]"]
end

node_user(("Programmer"))

node_user -->|"edits and runs"| node_app
node_app -->|"renders editor"| node_editor
node_app -->|"loads examples"| node_examples
node_app -->|"sends requests"| node_api
node_api -->|"starts jobs"| node_runner
node_api -->|"validates requests"| node_schema
node_api -->|"uses program library"| node_library
node_runner -->|"validates traces"| node_schema
node_runner -->|"uses input helpers"| node_input
node_runner -->|"applies limits"| node_limits
node_runner -.->|"dispatches execution"| node_python
node_runner -.->|"dispatches execution"| node_java
node_runner -.->|"dispatches execution"| node_cworker
node_java -.->|"uses runtime helper"| node_javahelper
node_javahelper -.->|"supports tracing"| node_javatracer
node_cworker -.->|"collects state"| node_cobserver
node_cworker -.->|"captures output"| node_ccapture
node_app -->|"renders trace"| node_diagram
node_diagram -->|"layouts objects"| node_memory
node_app -->|"renders output"| node_output
node_app -->|"shows step details"| node_stepdetails
node_desktopmain -.->|"starts backend"| node_desktopservice
node_desktopservice -->|"loads FastAPI app"| node_api

click node_app "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/App.tsx"
click node_editor "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/Editor.tsx"
click node_examples "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/examples.ts"
click node_api "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/app.py"
click node_schema "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/schema.py"
click node_runner "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/runner.py"
click node_limits "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/limits.py"
click node_input "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/interactive.py"
click node_python "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/python_worker.py"
click node_java "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/java_worker.py"
click node_javahelper "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/java/SpandyRun.java"
click node_javatracer "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/java/SpandyTracer.java"
click node_cworker "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_worker.py"
click node_cobserver "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_observer.py"
click node_ccapture "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_capture.c"
click node_diagram "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/Diagram.tsx"
click node_memory "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/memoryLayout.ts"
click node_output "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/Output.tsx"
click node_stepdetails "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/stepDetails.ts"
click node_library "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/library.py"
click node_desktopservice "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/desktop/service.py"
click node_desktopmain "https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/desktop/main.cjs"

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_app,node_editor,node_examples toneBlue
class node_api,node_schema,node_runner,node_limits,node_input toneAmber
class node_python,node_java,node_javahelper,node_javatracer,node_cworker,node_cobserver,node_ccapture toneMint
class node_diagram,node_memory,node_output,node_stepdetails toneRose
class node_library,node_desktopservice,node_desktopmain,node_user toneIndigo
```

## Components

### Code Workspace

- [Workspace App](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/App.tsx): `spandy-shows/src/App.tsx`
- [Code Editor](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/Editor.tsx): `spandy-shows/src/Editor.tsx`
- [Example Programs](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/examples.ts): `spandy-shows/src/examples.ts`

### Execution Service

- [Execution API](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/app.py): `spandy-shows/backend/app.py`
- [Job and Trace Schema](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/schema.py): `spandy-shows/backend/schema.py`
- [Job Runner](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/runner.py): `spandy-shows/backend/runner.py`
- [Resource Limits](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/limits.py): `spandy-shows/backend/limits.py`
- [Interactive Input](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/interactive.py): `spandy-shows/backend/interactive.py`

### Trace Collection

- [Python Tracing](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/python_worker.py): `spandy-shows/backend/python_worker.py`
- [Java Tracing](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/java_worker.py): `spandy-shows/backend/java_worker.py`
- [Java Runtime Helper](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/java/SpandyRun.java): `spandy-shows/backend/java/SpandyRun.java`
- [Java JDI Tracer](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/java/SpandyTracer.java): `spandy-shows/backend/java/SpandyTracer.java`
- [C Execution Worker](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_worker.py): `spandy-shows/backend/c_worker.py`
- [C State Observer](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_observer.py): `spandy-shows/backend/c_observer.py`
- [C Output Capture](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/c_capture.c): `spandy-shows/backend/c_capture.c`

### Trace Inspection

- [Memory Diagram](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/Diagram.tsx): `spandy-shows/src/Diagram.tsx`
- [Memory Layout](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/memoryLayout.ts): `spandy-shows/src/memoryLayout.ts`
- [Program Output](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/Output.tsx): `spandy-shows/src/Output.tsx`
- [Step Explanation](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/src/stepDetails.ts): `spandy-shows/src/stepDetails.ts`

### Desktop Services

- [Local Program Library](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/backend/library.py): `spandy-shows/backend/library.py`
- [Desktop Backend Service](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/desktop/service.py): `spandy-shows/desktop/service.py`
- [Desktop Shell](https://github.com/spandandey961-max/spandy-shows/blob/main/spandy-shows/desktop/main.cjs): `spandy-shows/desktop/main.cjs`

### Other components

- **Programmer**

## Connections

- Programmer → Workspace App: edits and runs
- Workspace App → Code Editor: renders editor (evidence: `spandy-shows/src/App.tsx`)
- Workspace App → Example Programs: loads examples (evidence: `spandy-shows/src/App.tsx`)
- Workspace App → Execution API: sends requests (evidence: `spandy-shows/src/App.tsx`)
- Execution API → Job Runner: starts jobs (evidence: `spandy-shows/backend/app.py`)
- Execution API → Job and Trace Schema: validates requests (evidence: `spandy-shows/backend/app.py`)
- Execution API → Local Program Library: uses program library (evidence: `spandy-shows/backend/app.py`)
- Job Runner → Job and Trace Schema: validates traces (evidence: `spandy-shows/backend/runner.py`)
- Job Runner → Interactive Input: uses input helpers (evidence: `spandy-shows/backend/runner.py`)
- Job Runner → Resource Limits: applies limits (evidence: `spandy-shows/backend/runner.py`)
- Job Runner → Python Tracing: dispatches execution
- Job Runner → Java Tracing: dispatches execution
- Job Runner → C Execution Worker: dispatches execution
- Java Tracing → Java Runtime Helper: uses runtime helper
- Java Runtime Helper → Java JDI Tracer: supports tracing (evidence: `spandy-shows/backend/java/SpandyTracer.java`)
- C Execution Worker → C State Observer: collects state
- C Execution Worker → C Output Capture: captures output
- Workspace App → Memory Diagram: renders trace (evidence: `spandy-shows/src/App.tsx`)
- Memory Diagram → Memory Layout: layouts objects (evidence: `spandy-shows/src/Diagram.tsx`)
- Workspace App → Program Output: renders output (evidence: `spandy-shows/src/App.tsx`)
- Workspace App → Step Explanation: shows step details (evidence: `spandy-shows/src/App.tsx`)
- Desktop Shell → Desktop Backend Service: starts backend
- Desktop Backend Service → Execution API: loads FastAPI app (evidence: `spandy-shows/desktop/service.py`)
