# riddh619/issue-x architecture

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

- Interactive diagram: https://gitdiagram.com/riddh619/issue-x
- Repository: https://github.com/riddh619/issue-x

## Overview

PreFlight Sandbox turns a GitHub issue into a reproduction and contribution briefing. A contributor submits an issue in the dashboard; the backend gathers issue discussion and repository-tree context, identifies candidate files, synthesizes analysis and artifacts, and can execute code in a sandbox. The UI presents editable code, a patch diff, dossier, devcontainer configuration, and terminal instructions. The README documents curated demos and fallback synthesis. Backend stages share one source file; finer internal boundaries and some handoffs are inferred from the partial excerpt, so uncertain links are omitted.

Main entry points: [`backend/main.py`](https://github.com/riddh619/issue-x/blob/main/backend/main.py) (PreFlight API), [`frontend/src/App.jsx`](https://github.com/riddh619/issue-x/blob/main/frontend/src/App.jsx) (Issue dashboard), [`frontend/src/main.jsx`](https://github.com/riddh619/issue-x/blob/main/frontend/src/main.jsx) (React application root), [`frontend/src/DiffViewer.jsx`](https://github.com/riddh619/issue-x/blob/main/frontend/src/DiffViewer.jsx) (Patch diff viewer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Contributor dashboard"]
  node_dashboard["Issue dashboard<br/>[App.jsx]"]
  node_diff["Patch diff viewer<br/>[DiffViewer.jsx]"]
  node_reactroot["React application root<br/>[main.jsx]"]
end

subgraph group_analysis["Issue analysis"]
  node_api["PreFlight API<br/>[main.py]"]
  node_issuefetch["Issue and comments fetch<br/>[main.py]"]
  node_treefetch["Repository tree fetch<br/>[main.py]"]
  node_targeting["Target slice selection<br/>[main.py]"]
  node_synthesis["AI analysis and synthesis<br/>[main.py]"]
  node_fallback["Fallback synthesis<br/>[main.py]"]
  node_samples["Curated issue demos<br/>[main.py]"]
end

subgraph group_artifacts["Reproduction artifacts"]
  node_repro["Reproduction test<br/>[main.py]"]
  node_dossier["Mission dossier<br/>[main.py]"]
  node_devcontainer["Devcontainer config<br/>[main.py]"]
  node_commands["TDD terminal commands<br/>[main.py]"]
end

subgraph group_execution["Sandbox execution"]
  node_sandbox["Code execution<br/>[main.py]"]
end

node_contributor(("Contributor"))
node_github["GitHub REST API"]
node_gemini["Google Gemini API"]

node_contributor -->|"submits issue"| node_dashboard
node_reactroot -->|"renders"| node_dashboard
node_dashboard -.->|"requests analysis"| node_api
node_api -->|"fetches issue context"| node_issuefetch
node_api -->|"fetches repository tree"| node_treefetch
node_issuefetch -->|"requests issue data"| node_github
node_treefetch -->|"requests file tree"| node_github
node_api -->|"selects candidates"| node_targeting
node_api -->|"generates analysis"| node_synthesis
node_synthesis -->|"uses AI analysis"| node_gemini
node_api -->|"uses on limits"| node_fallback
node_dashboard -.->|"offers demos"| node_samples
node_synthesis -->|"generates"| node_repro
node_synthesis -->|"generates"| node_dossier
node_synthesis -->|"generates"| node_devcontainer
node_synthesis -->|"generates"| node_commands
node_api -->|"executes code"| node_sandbox
node_dashboard -->|"displays patch diff"| node_diff
node_api -.->|"returns artifacts"| node_dashboard

click node_dashboard "https://github.com/riddh619/issue-x/blob/main/frontend/src/App.jsx"
click node_diff "https://github.com/riddh619/issue-x/blob/main/frontend/src/DiffViewer.jsx"
click node_reactroot "https://github.com/riddh619/issue-x/blob/main/frontend/src/main.jsx"
click node_api "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_issuefetch "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_treefetch "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_targeting "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_synthesis "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_fallback "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_samples "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_repro "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_dossier "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_devcontainer "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_commands "https://github.com/riddh619/issue-x/blob/main/backend/main.py"
click node_sandbox "https://github.com/riddh619/issue-x/blob/main/backend/main.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_dashboard,node_diff,node_reactroot toneBlue
class node_api,node_issuefetch,node_treefetch,node_targeting,node_synthesis,node_fallback,node_samples toneAmber
class node_repro,node_dossier,node_devcontainer,node_commands,node_github,node_gemini toneMint
class node_sandbox toneRose
class node_contributor toneIndigo
```

## Components

### Contributor dashboard

- [Issue dashboard](https://github.com/riddh619/issue-x/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Patch diff viewer](https://github.com/riddh619/issue-x/blob/main/frontend/src/DiffViewer.jsx): `frontend/src/DiffViewer.jsx`
- [React application root](https://github.com/riddh619/issue-x/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### Issue analysis

- [PreFlight API](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Issue and comments fetch](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Repository tree fetch](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Target slice selection](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [AI analysis and synthesis](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Fallback synthesis](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Curated issue demos](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`

### Reproduction artifacts

- [Reproduction test](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Mission dossier](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [Devcontainer config](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`
- [TDD terminal commands](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`

### Sandbox execution

- [Code execution](https://github.com/riddh619/issue-x/blob/main/backend/main.py): `backend/main.py`

### Other components

- **Contributor**
- **GitHub REST API**
- **Google Gemini API**

## Connections

- Contributor → Issue dashboard: submits issue (evidence: `README.md`)
- React application root → Issue dashboard: renders (evidence: `frontend/src/main.jsx`)
- Issue dashboard → PreFlight API: requests analysis
- PreFlight API → Issue and comments fetch: fetches issue context (evidence: `backend/main.py`)
- PreFlight API → Repository tree fetch: fetches repository tree (evidence: `backend/main.py`)
- Issue and comments fetch → GitHub REST API: requests issue data (evidence: `backend/main.py`)
- Repository tree fetch → GitHub REST API: requests file tree (evidence: `backend/main.py`)
- PreFlight API → Target slice selection: selects candidates (evidence: `backend/main.py`)
- PreFlight API → AI analysis and synthesis: generates analysis (evidence: `backend/main.py`)
- AI analysis and synthesis → Google Gemini API: uses AI analysis (evidence: `backend/main.py`)
- PreFlight API → Fallback synthesis: uses on limits (evidence: `README.md`)
- Issue dashboard → Curated issue demos: offers demos
- AI analysis and synthesis → Reproduction test: generates (evidence: `README.md`)
- AI analysis and synthesis → Mission dossier: generates (evidence: `README.md`)
- AI analysis and synthesis → Devcontainer config: generates (evidence: `README.md`)
- AI analysis and synthesis → TDD terminal commands: generates (evidence: `README.md`)
- PreFlight API → Code execution: executes code (evidence: `README.md`)
- Issue dashboard → Patch diff viewer: displays patch diff (evidence: `frontend/src/App.jsx`)
- PreFlight API → Issue dashboard: returns artifacts
