# dileep9063/devpilot-ai architecture

> Architecture diagram of the GitHub repository dileep9063/devpilot-ai, 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/dileep9063/devpilot-ai
- Repository: https://github.com/dileep9063/devpilot-ai

## Overview

DevPilot AI is a human-in-the-loop coding agent with a React interface and Django API. A user authenticates, submits a repository and task, then follows a persisted run, reviews proposed changes, approves or rejects them, and sees test results; failures can trigger an AI-proposed fix and another approval. The documented workflow also includes a separate approval before pushing and opening a pull request. The README supplies several agent-stage relationships; unsampled internals are represented only where that documentation supports them.

Main entry points: [`backend/core/agent.py`](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/agent.py) (Agent workflow), [`frontend/src/App.jsx`](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/App.jsx) (Task and run UI), [`backend/core/agent_service.py`](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/agent_service.py) (Run orchestration), [`backend/core/tasks.py`](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/tasks.py) (Background jobs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interface"]
  node_app["Task and run UI<br/>[App.jsx]"]
  node_authform["Login and registration<br/>[AuthForm.jsx]"]
  node_review["Approval and results<br/>[ApprovalCard.jsx]"]
  node_history["Run history<br/>[HistoryList.jsx]"]
  node_githubui["GitHub connection UI<br/>[GitHubConnect.jsx]"]
  node_api_client["HTTP client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_routes["API routing<br/>[urls.py]"]
  node_views["REST endpoints<br/>[views.py]"]
  node_auth["JWT authentication<br/>[auth_views.py]"]
end

subgraph group_runs["Agent execution"]
  node_background["Background jobs<br/>[tasks.py]"]
  node_service["Run orchestration<br/>[agent_service.py]"]
  node_graph["Agent workflow<br/>[agent.py]"]
  node_tools["Sandbox and code tools<br/>[tools.py]"]
  node_celery["Task queue configuration<br/>[celery.py]"]
end

subgraph group_integrations["External integrations"]
  node_llm["Provider fallback<br/>[llm_providers.py]"]
  node_chat["One-shot chat<br/>[ai_service.py]"]
  node_github["GitHub operations<br/>[github_app.py]"]
end

subgraph group_state["Run state"]
  node_records[("Run records<br/>[models.py]")]
end

node_user(("Engineer"))
node_provider_services["LLM providers"]
node_github_service["GitHub"]
node_repo["Target repository"]

node_user -->|"submits task"| node_app
node_app -->|"shows when unauthenticated"| node_authform
node_authform -->|"authenticates through"| node_api_client
node_app -->|"requests runs"| node_api_client
node_app -->|"renders approval"| node_review
node_app -->|"renders history"| node_history
node_app -->|"renders connection"| node_githubui
node_api_client -->|"calls API routes"| node_routes
node_routes -->|"routes requests"| node_views
node_routes -->|"routes registration"| node_auth
node_views -.->|"queues long runs"| node_background
node_background -->|"runs or resumes"| node_service
node_background -->|"claims and records status"| node_records
node_service -->|"invokes or resumes"| node_graph
node_service -->|"configures tool access"| node_tools
node_service -->|"uses GitHub operations"| node_github
node_service -->|"reads and updates runs"| node_records
node_graph -->|"uses sandbox tools"| node_tools
node_graph -.->|"requests model responses"| node_llm
node_tools -->|"reads and changes"| node_repo
node_graph -->|"requests approval"| node_user
node_graph -->|"proposes fixes"| node_llm
node_graph -->|"tests and commits"| node_repo
node_graph -->|"pushes and opens PR"| node_github
node_github -.->|"uses"| node_github_service
node_githubui -.->|"uses client"| node_api_client
node_chat -->|"invokes fallback"| node_llm
node_llm -->|"tries configured providers"| node_provider_services
node_celery -.->|"configures queue"| node_background

click node_app "https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/App.jsx"
click node_authform "https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/AuthForm.jsx"
click node_review "https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/ApprovalCard.jsx"
click node_history "https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/HistoryList.jsx"
click node_githubui "https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/GitHubConnect.jsx"
click node_api_client "https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/api.js"
click node_routes "https://github.com/dileep9063/devpilot-ai/blob/main/backend/config/urls.py"
click node_views "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/views.py"
click node_auth "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/auth_views.py"
click node_background "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/tasks.py"
click node_service "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/agent_service.py"
click node_graph "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/agent.py"
click node_tools "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/tools.py"
click node_llm "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/llm_providers.py"
click node_chat "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/ai_service.py"
click node_github "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/github_app.py"
click node_celery "https://github.com/dileep9063/devpilot-ai/blob/main/backend/config/celery.py"
click node_records "https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/models.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_app,node_authform,node_review,node_history,node_githubui,node_api_client toneBlue
class node_routes,node_views,node_auth toneAmber
class node_background,node_service,node_graph,node_tools,node_celery toneMint
class node_llm,node_chat,node_github toneRose
class node_records,node_user,node_provider_services,node_github_service,node_repo toneIndigo
```

## Components

### User interface

- [Task and run UI](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Login and registration](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/AuthForm.jsx): `frontend/src/components/AuthForm.jsx`
- [Approval and results](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/ApprovalCard.jsx): `frontend/src/components/ApprovalCard.jsx`
- [Run history](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/HistoryList.jsx): `frontend/src/components/HistoryList.jsx`
- [GitHub connection UI](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/components/GitHubConnect.jsx): `frontend/src/components/GitHubConnect.jsx`
- [HTTP client](https://github.com/dileep9063/devpilot-ai/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and identity

- [API routing](https://github.com/dileep9063/devpilot-ai/blob/main/backend/config/urls.py): `backend/config/urls.py`
- [REST endpoints](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/views.py): `backend/core/views.py`
- [JWT authentication](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/auth_views.py): `backend/core/auth_views.py`

### Agent execution

- [Background jobs](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/tasks.py): `backend/core/tasks.py`
- [Run orchestration](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/agent_service.py): `backend/core/agent_service.py`
- [Agent workflow](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/agent.py): `backend/core/agent.py`
- [Sandbox and code tools](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/tools.py): `backend/core/tools.py`
- [Task queue configuration](https://github.com/dileep9063/devpilot-ai/blob/main/backend/config/celery.py): `backend/config/celery.py`

### External integrations

- [Provider fallback](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/llm_providers.py): `backend/core/llm_providers.py`
- [One-shot chat](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/ai_service.py): `backend/core/ai_service.py`
- [GitHub operations](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/github_app.py): `backend/core/github_app.py`

### Run state

- [Run records](https://github.com/dileep9063/devpilot-ai/blob/main/backend/core/models.py): `backend/core/models.py`

### Other components

- **Engineer**
- **LLM providers**
- **GitHub**
- **Target repository**

## Connections

- Engineer → Task and run UI: submits task (evidence: `README.md`)
- Task and run UI → Login and registration: shows when unauthenticated (evidence: `frontend/src/App.jsx`)
- Login and registration → HTTP client: authenticates through (evidence: `frontend/src/components/AuthForm.jsx`)
- Task and run UI → HTTP client: requests runs (evidence: `frontend/src/App.jsx`)
- Task and run UI → Approval and results: renders approval (evidence: `frontend/src/App.jsx`)
- Task and run UI → Run history: renders history (evidence: `frontend/src/App.jsx`)
- Task and run UI → GitHub connection UI: renders connection (evidence: `frontend/src/App.jsx`)
- HTTP client → API routing: calls API routes (evidence: `README.md`)
- API routing → REST endpoints: routes requests (evidence: `backend/config/urls.py`)
- API routing → JWT authentication: routes registration (evidence: `backend/config/urls.py`)
- REST endpoints → Background jobs: queues long runs
- Background jobs → Run orchestration: runs or resumes (evidence: `backend/core/tasks.py`)
- Background jobs → Run records: claims and records status (evidence: `backend/core/tasks.py`)
- Run orchestration → Agent workflow: invokes or resumes (evidence: `backend/core/agent_service.py`)
- Run orchestration → Sandbox and code tools: configures tool access (evidence: `backend/core/agent_service.py`)
- Run orchestration → GitHub operations: uses GitHub operations (evidence: `backend/core/agent_service.py`)
- Run orchestration → Run records: reads and updates runs (evidence: `backend/core/agent_service.py`)
- Agent workflow → Sandbox and code tools: uses sandbox tools (evidence: `README.md`)
- Agent workflow → Provider fallback: requests model responses
- Sandbox and code tools → Target repository: reads and changes (evidence: `README.md`)
- Agent workflow → Engineer: requests approval (evidence: `README.md`)
- Agent workflow → Provider fallback: proposes fixes (evidence: `README.md`)
- Agent workflow → Target repository: tests and commits (evidence: `README.md`)
- Agent workflow → GitHub operations: pushes and opens PR (evidence: `README.md`)
- GitHub operations → GitHub: uses
- GitHub connection UI → HTTP client: uses client
- One-shot chat → Provider fallback: invokes fallback (evidence: `backend/core/ai_service.py`)
- Provider fallback → LLM providers: tries configured providers (evidence: `backend/core/llm_providers.py`)
- Task queue configuration → Background jobs: configures queue (evidence: `backend/core/tasks.py`)
