# jithendra0909/patchpulse architecture

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

- Interactive diagram: https://gitdiagram.com/jithendra0909/patchpulse
- Repository: https://github.com/jithendra0909/patchpulse

## Overview

PatchPulse is a web platform for diagnosing and repairing broken APIs. Users connect a repository, trigger or inspect an incident in Studio, and follow the repair workflow through localization, AI patch generation, sandbox verification, replay, safety scoring, and pull-request creation. Vault exposes incident history and analytics; Settings manages platform configuration. The README documents several capabilities whose page-level wiring is not in the excerpts, so those branches are represented without guessing their internal calls.

Main entry points: [`frontend/src/pages/StudioPage.tsx`](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/StudioPage.tsx) (Repair Studio), [`backend/src/agent/Orchestrator.ts`](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/agent/Orchestrator.ts) (Repair orchestrator), [`frontend/src/App.tsx`](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/App.tsx) (App shell), [`backend/src/server.ts`](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/server.ts) (API server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["App shell<br/>[App.tsx]"]
  node_onboarding["Repository onboarding"]
  node_studio["Repair Studio<br/>[StudioPage.tsx]"]
  node_pipeline["Pipeline display<br/>[AgentPipeline.tsx]"]
  node_chaos["Chaos controls<br/>[ChaosPanel.tsx]"]
  node_diff["Patch diff<br/>[CodeDiffViewer.tsx]"]
  node_terminal["Sandbox logs<br/>[TerminalPanel.tsx]"]
  node_replay["API replay<br/>[ApiReplayCard.tsx]"]
  node_safetyui["Safety evidence<br/>[SafetyEvidence.tsx]"]
  node_prbutton["Approve PR<br/>[CreatePRButton.tsx]"]
  node_vault["Incident Vault<br/>[VaultPage.tsx]"]
  node_settingsui["Settings page<br/>[SettingsPage.tsx]"]
  node_client["HTTP API client<br/>[client.ts]"]
end

subgraph group_backend["Repair engine"]
  node_server["API server<br/>[server.ts]"]
  node_orchestrator["Repair orchestrator<br/>[Orchestrator.ts]"]
  node_localization["Code localization<br/>[localization.ts]"]
  node_gemini["Patch generation<br/>[gemini.ts]"]
  node_sandbox["Sandbox runner<br/>[runner.ts]"]
  node_safety["Safety scoring<br/>[safety.ts]"]
  node_events["Live events<br/>[events.ts]"]
end

subgraph group_data["Persistence"]
  node_incidents[("Incident records<br/>[Incident.ts]")]
  node_repositories[("Repository records<br/>[Repository.ts]")]
  node_settings[("Settings records<br/>[Settings.ts]")]
end

subgraph group_integrations["External integrations"]
  node_github{{"GitHub"}}
  node_geminisvc{{"Gemini API"}}
end

node_user(("Engineer"))

node_user -->|"uses"| node_app
node_app -->|"shows"| node_studio
node_app -->|"shows"| node_vault
node_app -->|"shows"| node_settingsui
node_app -->|"renders"| node_onboarding
node_studio -.->|"displays"| node_pipeline
node_studio -.->|"offers"| node_chaos
node_studio -.->|"shows"| node_diff
node_studio -.->|"shows"| node_terminal
node_studio -.->|"shows"| node_replay
node_studio -.->|"shows"| node_safetyui
node_studio -.->|"offers"| node_prbutton
node_onboarding -->|"calls"| node_client
node_app -->|"checks health"| node_client
node_client -.->|"requests API"| node_server
node_server -->|"reads and writes"| node_repositories
node_server -->|"reads and writes"| node_incidents
node_server -->|"reads and writes"| node_settings
node_server -.->|"starts repair"| node_orchestrator
node_orchestrator -->|"records incident"| node_incidents
node_orchestrator -->|"localizes code"| node_localization
node_orchestrator -->|"requests patch"| node_gemini
node_orchestrator -->|"runs tests"| node_sandbox
node_orchestrator -->|"scores evidence"| node_safety
node_orchestrator -->|"emits stages"| node_events
node_gemini -->|"generates patch"| node_geminisvc
node_prbutton -.->|"opens pull request"| node_github
node_server -->|"creates pull request"| node_github

click node_app "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/App.tsx"
click node_onboarding "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/onboarding/OnboardingModal.tsx"
click node_studio "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/StudioPage.tsx"
click node_pipeline "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/AgentPipeline.tsx"
click node_chaos "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/ChaosPanel.tsx"
click node_diff "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/CodeDiffViewer.tsx"
click node_terminal "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/TerminalPanel.tsx"
click node_replay "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/ApiReplayCard.tsx"
click node_safetyui "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/SafetyEvidence.tsx"
click node_prbutton "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/CreatePRButton.tsx"
click node_vault "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/VaultPage.tsx"
click node_settingsui "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/SettingsPage.tsx"
click node_client "https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/services/api/client.ts"
click node_server "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/server.ts"
click node_orchestrator "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/agent/Orchestrator.ts"
click node_localization "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/code-intelligence/localization.ts"
click node_gemini "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/ai/gemini.ts"
click node_sandbox "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/sandbox/runner.ts"
click node_safety "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/verification/safety.ts"
click node_events "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/shared/events.ts"
click node_incidents "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/models/Incident.ts"
click node_repositories "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/models/Repository.ts"
click node_settings "https://github.com/jithendra0909/patchpulse/blob/main/backend/src/models/Settings.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_app,node_onboarding,node_studio,node_pipeline,node_chaos,node_diff,node_terminal,node_replay,node_safetyui,node_prbutton,node_vault,node_settingsui,node_client toneBlue
class node_server,node_orchestrator,node_localization,node_gemini,node_sandbox,node_safety,node_events toneAmber
class node_incidents,node_repositories,node_settings toneMint
class node_github,node_geminisvc toneRose
class node_user toneIndigo
```

## Components

### Web application

- [App shell](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Repository onboarding](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/onboarding/OnboardingModal.tsx): `frontend/src/components/onboarding/OnboardingModal.tsx`
- [Repair Studio](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/StudioPage.tsx): `frontend/src/pages/StudioPage.tsx`
- [Pipeline display](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/AgentPipeline.tsx): `frontend/src/components/studio/AgentPipeline.tsx`
- [Chaos controls](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/ChaosPanel.tsx): `frontend/src/components/studio/ChaosPanel.tsx`
- [Patch diff](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/CodeDiffViewer.tsx): `frontend/src/components/studio/CodeDiffViewer.tsx`
- [Sandbox logs](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/TerminalPanel.tsx): `frontend/src/components/studio/TerminalPanel.tsx`
- [API replay](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/ApiReplayCard.tsx): `frontend/src/components/studio/ApiReplayCard.tsx`
- [Safety evidence](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/SafetyEvidence.tsx): `frontend/src/components/studio/SafetyEvidence.tsx`
- [Approve PR](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/components/studio/CreatePRButton.tsx): `frontend/src/components/studio/CreatePRButton.tsx`
- [Incident Vault](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/VaultPage.tsx): `frontend/src/pages/VaultPage.tsx`
- [Settings page](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/pages/SettingsPage.tsx): `frontend/src/pages/SettingsPage.tsx`
- [HTTP API client](https://github.com/jithendra0909/patchpulse/blob/main/frontend/src/services/api/client.ts): `frontend/src/services/api/client.ts`

### Repair engine

- [API server](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Repair orchestrator](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/agent/Orchestrator.ts): `backend/src/agent/Orchestrator.ts`
- [Code localization](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/code-intelligence/localization.ts): `backend/src/code-intelligence/localization.ts`
- [Patch generation](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/ai/gemini.ts): `backend/src/ai/gemini.ts`
- [Sandbox runner](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/sandbox/runner.ts): `backend/src/sandbox/runner.ts`
- [Safety scoring](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/verification/safety.ts): `backend/src/verification/safety.ts`
- [Live events](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/shared/events.ts): `backend/src/shared/events.ts`

### Persistence

- [Incident records](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/models/Incident.ts): `backend/src/models/Incident.ts`
- [Repository records](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/models/Repository.ts): `backend/src/models/Repository.ts`
- [Settings records](https://github.com/jithendra0909/patchpulse/blob/main/backend/src/models/Settings.ts): `backend/src/models/Settings.ts`

### External integrations

- **GitHub**
- **Gemini API**

### Other components

- **Engineer**

## Connections

- Engineer → App shell: uses (evidence: `README.md`)
- App shell → Repair Studio: shows (evidence: `frontend/src/App.tsx`)
- App shell → Incident Vault: shows (evidence: `frontend/src/App.tsx`)
- App shell → Settings page: shows (evidence: `frontend/src/App.tsx`)
- App shell → Repository onboarding: renders (evidence: `frontend/src/App.tsx`)
- Repair Studio → Pipeline display: displays
- Repair Studio → Chaos controls: offers
- Repair Studio → Patch diff: shows
- Repair Studio → Sandbox logs: shows
- Repair Studio → API replay: shows
- Repair Studio → Safety evidence: shows
- Repair Studio → Approve PR: offers
- Repository onboarding → HTTP API client: calls (evidence: `frontend/src/components/onboarding/OnboardingModal.tsx`)
- App shell → HTTP API client: checks health (evidence: `frontend/src/App.tsx`)
- HTTP API client → API server: requests API
- API server → Repository records: reads and writes (evidence: `backend/src/server.ts`)
- API server → Incident records: reads and writes (evidence: `backend/src/server.ts`)
- API server → Settings records: reads and writes (evidence: `backend/src/server.ts`)
- API server → Repair orchestrator: starts repair (evidence: `backend/src/server.ts`)
- Repair orchestrator → Incident records: records incident (evidence: `backend/src/agent/Orchestrator.ts`)
- Repair orchestrator → Code localization: localizes code (evidence: `backend/src/agent/Orchestrator.ts`)
- Repair orchestrator → Patch generation: requests patch (evidence: `backend/src/agent/Orchestrator.ts`)
- Repair orchestrator → Sandbox runner: runs tests (evidence: `backend/src/agent/Orchestrator.ts`)
- Repair orchestrator → Safety scoring: scores evidence (evidence: `backend/src/agent/Orchestrator.ts`)
- Repair orchestrator → Live events: emits stages (evidence: `backend/src/agent/Orchestrator.ts`)
- Patch generation → Gemini API: generates patch (evidence: `backend/src/ai/gemini.ts`)
- Approve PR → GitHub: opens pull request
- API server → GitHub: creates pull request (evidence: `backend/src/server.ts`)
