# apw-labs/pyre-ide architecture

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

- Interactive diagram: https://gitdiagram.com/apw-labs/pyre-ide
- Repository: https://github.com/apw-labs/pyre-ide

## Overview

Pyre IDE is a small Tauri/React desktop bridge for Python. Its visible workflow scans for interpreters, lets the user start a Python script, and displays streamed stdout/stderr. The Rust backend also exposes virtual-environment creation, though the sampled UI does not invoke it. The Python engine crate is an external dependency, not present in this tree; its internal behavior is therefore represented only at the API boundary.

Main entry points: [`src-tauri/src/lib.rs`](https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/lib.rs) (Command Handlers), [`src/App.tsx`](https://github.com/apw-labs/pyre-ide/blob/main/src/App.tsx) (IDE Screen), [`src/main.tsx`](https://github.com/apw-labs/pyre-ide/blob/main/src/main.tsx) (React Entry), [`src-tauri/src/main.rs`](https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/main.rs) (Rust Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Desktop UI"]
  node_ui_entry["React Entry<br/>[main.tsx]"]
  node_app["IDE Screen<br/>[App.tsx]"]
  node_script["Test Script<br/>[test_script.py]"]
end

subgraph group_backend["Tauri Backend"]
  node_tauri_main["Rust Entry<br/>[main.rs]"]
  node_tauri_commands["Command Handlers<br/>[lib.rs]"]
end

subgraph group_python["Python Engine"]
  node_interpreter_scan["Interpreter Scanner"]
  node_process_supervisor["Process Supervisor"]
  node_venv_manager["Venv Manager"]
end

node_user(("User"))
node_python_runtime(("Python Runtime"))

node_user -->|"uses"| node_app
node_ui_entry -->|"renders"| node_app
node_app -->|"invokes scan"| node_tauri_commands
node_tauri_commands -->|"discovers interpreters"| node_interpreter_scan
node_app -->|"invokes script"| node_tauri_commands
node_app -->|"selects path"| node_script
node_tauri_commands -->|"spawns process"| node_process_supervisor
node_process_supervisor -.->|"runs script"| node_python_runtime
node_tauri_commands -->|"emits output events"| node_app
node_app -->|"listens for output"| node_tauri_commands
node_tauri_commands -->|"creates environment"| node_venv_manager
node_tauri_main -->|"starts backend"| node_tauri_commands

click node_ui_entry "https://github.com/apw-labs/pyre-ide/blob/main/src/main.tsx"
click node_app "https://github.com/apw-labs/pyre-ide/blob/main/src/App.tsx"
click node_script "https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/test_script.py"
click node_tauri_main "https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/main.rs"
click node_tauri_commands "https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/lib.rs"

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_ui_entry,node_app,node_script,node_user toneBlue
class node_tauri_main,node_tauri_commands toneAmber
class node_interpreter_scan,node_process_supervisor,node_venv_manager toneMint
class node_python_runtime toneIndigo
```

## Components

### Desktop UI

- [React Entry](https://github.com/apw-labs/pyre-ide/blob/main/src/main.tsx): `src/main.tsx`
- [IDE Screen](https://github.com/apw-labs/pyre-ide/blob/main/src/App.tsx): `src/App.tsx`
- [Test Script](https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/test_script.py): `src-tauri/src/test_script.py`

### Tauri Backend

- [Rust Entry](https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/main.rs): `src-tauri/src/main.rs`
- [Command Handlers](https://github.com/apw-labs/pyre-ide/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Python Engine

- **Interpreter Scanner**
- **Process Supervisor**
- **Venv Manager**

### Other components

- **User**
- **Python Runtime**

## Connections

- User → IDE Screen: uses (evidence: `src/App.tsx`)
- React Entry → IDE Screen: renders (evidence: `src/main.tsx`)
- IDE Screen → Command Handlers: invokes scan (evidence: `src/App.tsx`)
- Command Handlers → Interpreter Scanner: discovers interpreters (evidence: `src-tauri/src/lib.rs`)
- IDE Screen → Command Handlers: invokes script (evidence: `src/App.tsx`)
- IDE Screen → Test Script: selects path (evidence: `src/App.tsx`)
- Command Handlers → Process Supervisor: spawns process (evidence: `src-tauri/src/lib.rs`)
- Process Supervisor → Python Runtime: runs script
- Command Handlers → IDE Screen: emits output events (evidence: `src-tauri/src/lib.rs`)
- IDE Screen → Command Handlers: listens for output (evidence: `src/App.tsx`)
- Command Handlers → Venv Manager: creates environment (evidence: `src-tauri/src/lib.rs`)
- Rust Entry → Command Handlers: starts backend (evidence: `src-tauri/src/main.rs`)
