# charan877/spidy architecture

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

- Interactive diagram: https://gitdiagram.com/charan877/spidy
- Repository: https://github.com/charan877/spidy

## Overview

SPIDY accepts a natural-language application request and turns it into a planned, contract-driven codebase, runs it, verifies it, and attempts bounded recovery before presenting the result. The backend orchestrator coordinates the engineering stages; the server and React/Three.js interface expose build controls, telemetry, and previews. SQLite persists project and build records, while the model router provides provider selection and failover. The README documents the end-to-end stages and major capabilities; several implementation details are unsampled, so those connections are represented only where documented or indexed.

Main entry points: [`backend/orchestration/orchestrator.py`](https://github.com/charan877/spidy/blob/main/backend/orchestration/orchestrator.py) (Workflow Orchestrator), [`server.py`](https://github.com/charan877/spidy/blob/main/server.py) (API and WebSocket), [`backend/runtime/project_runner.py`](https://github.com/charan877/spidy/blob/main/backend/runtime/project_runner.py) (Project Runner), [`frontend/src/App.tsx`](https://github.com/charan877/spidy/blob/main/frontend/src/App.tsx) (Web Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_frontend["Web Dashboard<br/>[App.tsx]"]
  node_world["3D Scene<br/>[World3D.tsx]"]
  node_dashboard_views["Build Views"]
end

subgraph group_control["Build Control"]
  node_server["API and WebSocket<br/>[server.py]"]
  node_state["Project State<br/>[project_state.py]"]
  node_context["Build Context<br/>[active_context.py]"]
  node_orchestrator["Workflow Orchestrator<br/>[orchestrator.py]"]
end

subgraph group_engineering["Engineering Pipeline"]
  node_classifier["Request Classification<br/>[task_classifier.py]"]
  node_planner["Task Planning<br/>[planner_agent.py]"]
  node_architect["Architecture Contracts"]
  node_generator["Code Generation<br/>[generator_impl.py]"]
  node_workspace["Isolated Workspace"]
end

subgraph group_runtime["Runtime Verification"]
  node_reviewer["Quality Review<br/>[reviewer_agent.py]"]
  node_runner["Project Runner<br/>[project_runner.py]"]
  node_processes["Process Supervision<br/>[process_manager.py]"]
  node_sessions["Runtime Sessions<br/>[runtime_session.py]"]
  node_preview["Preview Health<br/>[preview_manager.py]"]
  node_gates["Verification Gates<br/>[gate_evaluator.py]"]
  node_browser["Browser Verification"]
  node_recovery["Failure Recovery<br/>[debugger_agent.py]"]
end

subgraph group_services["AI and Persistence"]
  node_router["LLM Model Router<br/>[model_router.py]"]
  node_database[("SQLite Persistence<br/>[connection.py]")]
  node_db_manager["Database Manager"]
end

node_user(("Developer"))

node_user -->|"submits request"| node_server
node_server -.->|"streams telemetry"| node_frontend
node_frontend -->|"renders scene"| node_world
node_frontend -->|"renders views"| node_dashboard_views
node_server -->|"starts workflow"| node_orchestrator
node_server -.->|"updates state"| node_state
node_orchestrator -->|"isolates build"| node_context
node_orchestrator -->|"tracks lifecycle"| node_state
node_orchestrator -->|"classifies request"| node_classifier
node_orchestrator -->|"plans tasks"| node_planner
node_orchestrator -->|"defines contracts"| node_architect
node_orchestrator -->|"generates code"| node_generator
node_orchestrator -->|"writes files"| node_workspace
node_orchestrator -->|"runs project"| node_runner
node_runner -->|"starts processes"| node_processes
node_processes -->|"creates sessions"| node_sessions
node_runner -->|"checks preview"| node_preview
node_runner -->|"evaluates gates"| node_gates
node_gates -->|"verifies browser"| node_browser
node_orchestrator -->|"requests review"| node_reviewer
node_orchestrator -->|"recovers failures"| node_recovery
node_orchestrator -.->|"requests models"| node_router
node_server -->|"checks provider"| node_router
node_server -->|"restores build data"| node_db_manager
node_db_manager -->|"opens connections"| node_database

click node_frontend "https://github.com/charan877/spidy/blob/main/frontend/src/App.tsx"
click node_world "https://github.com/charan877/spidy/blob/main/frontend/src/three/World3D.tsx"
click node_dashboard_views "https://github.com/charan877/spidy/tree/main/frontend/src/components"
click node_server "https://github.com/charan877/spidy/blob/main/server.py"
click node_state "https://github.com/charan877/spidy/blob/main/backend/core/project_state.py"
click node_context "https://github.com/charan877/spidy/blob/main/backend/core/active_context.py"
click node_orchestrator "https://github.com/charan877/spidy/blob/main/backend/orchestration/orchestrator.py"
click node_classifier "https://github.com/charan877/spidy/blob/main/backend/core/task_classifier.py"
click node_planner "https://github.com/charan877/spidy/blob/main/backend/agents/planner_agent.py"
click node_architect "https://github.com/charan877/spidy/blob/main/backend/core/architecture_contract.py"
click node_generator "https://github.com/charan877/spidy/blob/main/backend/agents/generator_impl.py"
click node_workspace "https://github.com/charan877/spidy/blob/main/backend/core/workspace_manager.py"
click node_reviewer "https://github.com/charan877/spidy/blob/main/backend/agents/reviewer_agent.py"
click node_runner "https://github.com/charan877/spidy/blob/main/backend/runtime/project_runner.py"
click node_processes "https://github.com/charan877/spidy/blob/main/backend/runtime/process_manager.py"
click node_sessions "https://github.com/charan877/spidy/blob/main/backend/runtime/runtime_session.py"
click node_preview "https://github.com/charan877/spidy/blob/main/backend/runtime/preview_manager.py"
click node_gates "https://github.com/charan877/spidy/blob/main/backend/verification/gate_evaluator.py"
click node_browser "https://github.com/charan877/spidy/blob/main/backend/verification/browser_verifier.py"
click node_recovery "https://github.com/charan877/spidy/blob/main/backend/agents/debugger_agent.py"
click node_router "https://github.com/charan877/spidy/blob/main/backend/core/llm/model_router.py"
click node_database "https://github.com/charan877/spidy/blob/main/backend/database/connection.py"
click node_db_manager "https://github.com/charan877/spidy/blob/main/backend/database/database_manager.py"

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_frontend,node_world,node_dashboard_views toneBlue
class node_server,node_state,node_context,node_orchestrator toneAmber
class node_classifier,node_planner,node_architect,node_generator,node_workspace toneMint
class node_reviewer,node_runner,node_processes,node_sessions,node_preview,node_gates,node_browser,node_recovery toneRose
class node_router,node_database,node_db_manager,node_user toneIndigo
```

## Components

### User Interface

- [Web Dashboard](https://github.com/charan877/spidy/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [3D Scene](https://github.com/charan877/spidy/blob/main/frontend/src/three/World3D.tsx): `frontend/src/three/World3D.tsx`
- [Build Views](https://github.com/charan877/spidy/tree/main/frontend/src/components): `frontend/src/components`

### Build Control

- [API and WebSocket](https://github.com/charan877/spidy/blob/main/server.py): `server.py`
- [Project State](https://github.com/charan877/spidy/blob/main/backend/core/project_state.py): `backend/core/project_state.py`
- [Build Context](https://github.com/charan877/spidy/blob/main/backend/core/active_context.py): `backend/core/active_context.py`
- [Workflow Orchestrator](https://github.com/charan877/spidy/blob/main/backend/orchestration/orchestrator.py): `backend/orchestration/orchestrator.py`

### Engineering Pipeline

- [Request Classification](https://github.com/charan877/spidy/blob/main/backend/core/task_classifier.py): `backend/core/task_classifier.py`
- [Task Planning](https://github.com/charan877/spidy/blob/main/backend/agents/planner_agent.py): `backend/agents/planner_agent.py`
- [Architecture Contracts](https://github.com/charan877/spidy/blob/main/backend/core/architecture_contract.py): `backend/core/architecture_contract.py`
- [Code Generation](https://github.com/charan877/spidy/blob/main/backend/agents/generator_impl.py): `backend/agents/generator_impl.py`
- [Isolated Workspace](https://github.com/charan877/spidy/blob/main/backend/core/workspace_manager.py): `backend/core/workspace_manager.py`

### Runtime Verification

- [Quality Review](https://github.com/charan877/spidy/blob/main/backend/agents/reviewer_agent.py): `backend/agents/reviewer_agent.py`
- [Project Runner](https://github.com/charan877/spidy/blob/main/backend/runtime/project_runner.py): `backend/runtime/project_runner.py`
- [Process Supervision](https://github.com/charan877/spidy/blob/main/backend/runtime/process_manager.py): `backend/runtime/process_manager.py`
- [Runtime Sessions](https://github.com/charan877/spidy/blob/main/backend/runtime/runtime_session.py): `backend/runtime/runtime_session.py`
- [Preview Health](https://github.com/charan877/spidy/blob/main/backend/runtime/preview_manager.py): `backend/runtime/preview_manager.py`
- [Verification Gates](https://github.com/charan877/spidy/blob/main/backend/verification/gate_evaluator.py): `backend/verification/gate_evaluator.py`
- [Browser Verification](https://github.com/charan877/spidy/blob/main/backend/verification/browser_verifier.py): `backend/verification/browser_verifier.py`
- [Failure Recovery](https://github.com/charan877/spidy/blob/main/backend/agents/debugger_agent.py): `backend/agents/debugger_agent.py`

### AI and Persistence

- [LLM Model Router](https://github.com/charan877/spidy/blob/main/backend/core/llm/model_router.py): `backend/core/llm/model_router.py`
- [SQLite Persistence](https://github.com/charan877/spidy/blob/main/backend/database/connection.py): `backend/database/connection.py`
- [Database Manager](https://github.com/charan877/spidy/blob/main/backend/database/database_manager.py): `backend/database/database_manager.py`

### Other components

- **Developer**

## Connections

- Developer → API and WebSocket: submits request
- API and WebSocket → Web Dashboard: streams telemetry
- Web Dashboard → 3D Scene: renders scene (evidence: `frontend/src/App.tsx`)
- Web Dashboard → Build Views: renders views (evidence: `frontend/src/App.tsx`)
- API and WebSocket → Workflow Orchestrator: starts workflow (evidence: `server.py`)
- API and WebSocket → Project State: updates state (evidence: `server.py`)
- Workflow Orchestrator → Build Context: isolates build
- Workflow Orchestrator → Project State: tracks lifecycle (evidence: `backend/orchestration/orchestrator.py`)
- Workflow Orchestrator → Request Classification: classifies request (evidence: `backend/orchestration/orchestrator.py`)
- Workflow Orchestrator → Task Planning: plans tasks
- Workflow Orchestrator → Architecture Contracts: defines contracts (evidence: `backend/orchestration/orchestrator.py`)
- Workflow Orchestrator → Code Generation: generates code
- Workflow Orchestrator → Isolated Workspace: writes files (evidence: `backend/orchestration/orchestrator.py`)
- Workflow Orchestrator → Project Runner: runs project (evidence: `backend/orchestration/orchestrator.py`)
- Project Runner → Process Supervision: starts processes (evidence: `backend/runtime/project_runner.py`)
- Process Supervision → Runtime Sessions: creates sessions (evidence: `backend/runtime/process_manager.py`)
- Project Runner → Preview Health: checks preview (evidence: `backend/runtime/project_runner.py`)
- Project Runner → Verification Gates: evaluates gates (evidence: `backend/runtime/project_runner.py`)
- Verification Gates → Browser Verification: verifies browser (evidence: `backend/verification/gate_evaluator.py`)
- Workflow Orchestrator → Quality Review: requests review (evidence: `backend/orchestration/orchestrator.py`)
- Workflow Orchestrator → Failure Recovery: recovers failures
- Workflow Orchestrator → LLM Model Router: requests models (evidence: `backend/orchestration/orchestrator.py`)
- API and WebSocket → LLM Model Router: checks provider (evidence: `server.py`)
- API and WebSocket → Database Manager: restores build data (evidence: `server.py`)
- Database Manager → SQLite Persistence: opens connections (evidence: `backend/database/database_manager.py`)
