# dishakd21/python_error_debugging_assistant architecture

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

- Interactive diagram: https://gitdiagram.com/dishakd21/python_error_debugging_assistant
- Repository: https://github.com/dishakd21/python_error_debugging_assistant

## Overview

PyDebug AI accepts uploaded Python files (and ZIP projects in the integrated client), optional traceback context, and returns a diagnosis, explanation, corrected code, changes, and tests. The main workflow runs from the client through FastAPI to prompt construction and Gemini analysis. The README also describes temporary-project assembly and pytest validation; the corresponding debugger service is present but was not excerpted, so its implementation details and connections are not asserted. The tree contains a separate frontend whose debug button is still a placeholder. The README's deterministic fallback claim conflicts with the sampled Gemini service, which returns a configuration error when no API key is set.

Main entry points: [`backend/app/services/gemini.py`](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/gemini.py) (Model analysis), [`backend/app/routes/debug.py`](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/routes/debug.py) (Upload handler), [`backend/app/services/debugger.py`](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/debugger.py) (Debugger service), [`client/src/App.jsx`](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/client/src/App.jsx) (Debug client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client applications"]
  node_integrated_client["Debug client<br/>[App.jsx]"]
  node_prototype["Upload prototype<br/>[App.jsx]"]
end

subgraph group_api["API ingress"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_debug_route["Upload handler<br/>[debug.py]"]
end

subgraph group_analysis["Debug analysis"]
  node_gemini_service["Model analysis<br/>[gemini.py]"]
  node_prompt_builder["Prompt builder"]
  node_configuration["Model configuration<br/>[config.py]"]
  node_traceback_parser["Traceback parser"]
  node_debugger_service["Debugger service<br/>[debugger.py]"]
end

subgraph group_validation["Validation"]
  node_pytest_validation["Pytest validation<br/>[debugger.py]"]
end

node_user(("Developer"))
node_gemini_api["Gemini API"]
node_response["Debug result"]

node_user -->|"uploads and submits"| node_integrated_client
node_integrated_client -->|"posts files"| node_debug_route
node_user -->|"uploads files"| node_prototype
node_api_app -->|"registers routes"| node_debug_route
node_debug_route -->|"passes project"| node_gemini_service
node_gemini_service -->|"builds prompt"| node_prompt_builder
node_gemini_service -->|"reads settings"| node_configuration
node_gemini_service -->|"requests analysis"| node_gemini_api
node_gemini_service -->|"returns JSON result"| node_response
node_debug_route -->|"returns result"| node_response
node_debugger_service -->|"uses model service"| node_gemini_service
node_debugger_service -.->|"runs validation"| node_pytest_validation
node_debug_route -.->|"validates project"| node_pytest_validation

click node_integrated_client "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/client/src/App.jsx"
click node_prototype "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/frontend/src/App.jsx"
click node_api_app "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/main.py"
click node_debug_route "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/routes/debug.py"
click node_gemini_service "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/gemini.py"
click node_prompt_builder "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/prompts/debugging_prompt.py"
click node_configuration "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/config.py"
click node_traceback_parser "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/traceback_parser.py"
click node_debugger_service "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/debugger.py"
click node_pytest_validation "https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/debugger.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_integrated_client,node_prototype toneBlue
class node_api_app,node_debug_route toneAmber
class node_gemini_service,node_prompt_builder,node_configuration,node_traceback_parser,node_debugger_service,node_gemini_api toneMint
class node_pytest_validation toneRose
class node_user,node_response toneIndigo
```

## Components

### Client applications

- [Debug client](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Upload prototype](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### API ingress

- [FastAPI app](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/main.py): `backend/app/main.py`
- [Upload handler](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/routes/debug.py): `backend/app/routes/debug.py`

### Debug analysis

- [Model analysis](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/gemini.py): `backend/app/services/gemini.py`
- [Prompt builder](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/prompts/debugging_prompt.py): `backend/app/prompts/debugging_prompt.py`
- [Model configuration](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/config.py): `backend/app/config.py`
- [Traceback parser](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/traceback_parser.py): `backend/app/services/traceback_parser.py`
- [Debugger service](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/debugger.py): `backend/app/services/debugger.py`

### Validation

- [Pytest validation](https://github.com/dishakd21/python_error_debugging_assistant/blob/main/backend/app/services/debugger.py): `backend/app/services/debugger.py`

### Other components

- **Developer**
- **Gemini API**
- **Debug result**

## Connections

- Developer → Debug client: uploads and submits (evidence: `client/src/App.jsx`)
- Debug client → Upload handler: posts files (evidence: `client/src/App.jsx`)
- Developer → Upload prototype: uploads files (evidence: `frontend/src/App.jsx`)
- FastAPI app → Upload handler: registers routes (evidence: `backend/app/main.py`)
- Upload handler → Model analysis: passes project (evidence: `backend/app/routes/debug.py`)
- Model analysis → Prompt builder: builds prompt (evidence: `backend/app/services/gemini.py`)
- Model analysis → Model configuration: reads settings (evidence: `backend/app/services/gemini.py`)
- Model analysis → Gemini API: requests analysis (evidence: `backend/app/services/gemini.py`)
- Model analysis → Debug result: returns JSON result (evidence: `backend/app/services/gemini.py`)
- Upload handler → Debug result: returns result (evidence: `backend/app/routes/debug.py`)
- Debugger service → Model analysis: uses model service (evidence: `backend/app/services/debugger.py`)
- Debugger service → Pytest validation: runs validation (evidence: `README.md`)
- Upload handler → Pytest validation: validates project (evidence: `README.md`)
