# jimmytoan/qa-agent architecture

> Architecture diagram of the GitHub repository jimmytoan/qa-agent, 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/jimmytoan/qa-agent
- Repository: https://github.com/jimmytoan/qa-agent

## Overview

QA Agent is a natural-language browser E2E testing platform. Users organize products, suites, and tests, start individual or suite runs, watch SSE progress, and review run history and screenshot/GIF artifacts. The graph distinguishes authoring, execution, and review stages. Runtime wiring is supported by the sampled router, runner, and UI excerpts plus README architecture statements; several feature routes and pages were not sampled, so their links are limited to documented capabilities.

Main entry points: [`backend/app/services/runner.py`](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/runner.py) (Browser run engine), [`backend/app/main.py`](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/App.tsx`](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/App.tsx) (Web application), [`frontend/src/lib/api.ts`](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/lib/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Test authoring"]
  node_products_ui["Products<br/>[ProductsPage.tsx]"]
  node_suites_ui["Suites and import<br/>[SuitesPage.tsx]"]
  node_import_dialog["Excel import"]
  node_tests_ui["Natural-language tests<br/>[TestsPage.tsx]"]
  node_product_routes["Product routes<br/>[products.py]"]
  node_suite_routes["Suite routes<br/>[suites.py]"]
  node_test_routes["Test routes<br/>[tests.py]"]
end

subgraph group_execution["Run execution"]
  node_suite_run_routes["Suite-run orchestration<br/>[suite_runs.py]"]
  node_run_routes["Run and SSE routes<br/>[runs.py]"]
  node_runner["Browser run engine<br/>[runner.py]"]
  node_run_state["Live run queues<br/>[state.py]"]
end

subgraph group_review["Run review"]
  node_artifact_service["Artifact capture<br/>[artifacts.py]"]
  node_artifact_files["Screenshots and GIFs<br/>[artifacts.py]"]
  node_reports_ui["Reports and history<br/>[ReportsPage.tsx]"]
  node_run_detail["Run detail viewer<br/>[RunDetailModal.tsx]"]
end

subgraph group_platform["Application platform"]
  node_frontend["Web application<br/>[App.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_database[("PostgreSQL<br/>[database.py]")]
  node_models["Run and test records<br/>[models.py]"]
end

node_qa_user(("QA user"))
node_browser_agent["Browser-use agent"]
node_llm_provider["LLM providers"]

node_qa_user -->|"uses"| node_frontend
node_frontend -->|"routes to"| node_products_ui
node_frontend -->|"routes to"| node_suites_ui
node_frontend -->|"routes to"| node_tests_ui
node_frontend -->|"routes to"| node_reports_ui
node_suites_ui -->|"opens"| node_import_dialog
node_products_ui -.->|"requests data"| node_api_client
node_suites_ui -->|"requests data"| node_api_client
node_tests_ui -->|"creates tests"| node_api_client
node_reports_ui -->|"loads reports"| node_api_client
node_api_client -->|"REST and SSE"| node_backend
node_backend -->|"registers"| node_product_routes
node_backend -->|"registers"| node_suite_routes
node_backend -->|"registers"| node_test_routes
node_backend -->|"registers"| node_run_routes
node_backend -->|"registers"| node_suite_run_routes
node_product_routes -.->|"queries"| node_database
node_suite_routes -->|"queries"| node_database
node_test_routes -->|"queries"| node_database
node_test_routes -->|"starts test run"| node_runner
node_suite_run_routes -.->|"starts suite run"| node_runner
node_run_routes -->|"creates run"| node_runner
node_run_routes -->|"streams events"| node_run_state
node_runner -->|"publishes events"| node_run_state
node_runner -->|"executes browser"| node_browser_agent
node_runner -->|"uses model"| node_llm_provider
node_runner -.->|"captures artifacts"| node_artifact_service
node_artifact_service -->|"writes files"| node_artifact_files
node_run_routes -.->|"serves artifacts"| node_artifact_files
node_reports_ui -->|"opens details"| node_run_detail
node_runner -->|"updates runs"| node_database
node_database -.->|"stores records"| node_models

click node_frontend "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/App.tsx"
click node_products_ui "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/ProductsPage.tsx"
click node_suites_ui "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/SuitesPage.tsx"
click node_import_dialog "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/components/ImportExcelDialog.tsx"
click node_tests_ui "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/TestsPage.tsx"
click node_api_client "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/lib/api.ts"
click node_backend "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/main.py"
click node_product_routes "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/products.py"
click node_suite_routes "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/suites.py"
click node_test_routes "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/tests.py"
click node_suite_run_routes "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/suite_runs.py"
click node_run_routes "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/runs.py"
click node_runner "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/runner.py"
click node_run_state "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/state.py"
click node_artifact_service "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/artifacts.py"
click node_artifact_files "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/artifacts.py"
click node_reports_ui "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/ReportsPage.tsx"
click node_run_detail "https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/components/RunDetailModal.tsx"
click node_database "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/database.py"
click node_models "https://github.com/jimmytoan/qa-agent/blob/main/backend/app/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_products_ui,node_suites_ui,node_import_dialog,node_tests_ui,node_product_routes,node_suite_routes,node_test_routes,node_qa_user,node_browser_agent toneBlue
class node_suite_run_routes,node_run_routes,node_runner,node_run_state toneAmber
class node_artifact_service,node_artifact_files,node_reports_ui,node_run_detail toneMint
class node_frontend,node_api_client,node_backend,node_database,node_models toneRose
class node_llm_provider toneIndigo
```

## Components

### Test authoring

- [Products](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/ProductsPage.tsx): `frontend/src/pages/ProductsPage.tsx`
- [Suites and import](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/SuitesPage.tsx): `frontend/src/pages/SuitesPage.tsx`
- [Excel import](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/components/ImportExcelDialog.tsx): `frontend/src/components/ImportExcelDialog.tsx`
- [Natural-language tests](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/TestsPage.tsx): `frontend/src/pages/TestsPage.tsx`
- [Product routes](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/products.py): `backend/app/routers/products.py`
- [Suite routes](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/suites.py): `backend/app/routers/suites.py`
- [Test routes](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/tests.py): `backend/app/routers/tests.py`

### Run execution

- [Suite-run orchestration](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/suite_runs.py): `backend/app/routers/suite_runs.py`
- [Run and SSE routes](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/routers/runs.py): `backend/app/routers/runs.py`
- [Browser run engine](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/runner.py): `backend/app/services/runner.py`
- [Live run queues](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/state.py): `backend/app/state.py`

### Run review

- [Artifact capture](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/artifacts.py): `backend/app/services/artifacts.py`
- [Screenshots and GIFs](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/services/artifacts.py): `backend/app/services/artifacts.py`
- [Reports and history](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/pages/ReportsPage.tsx): `frontend/src/pages/ReportsPage.tsx`
- [Run detail viewer](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/components/RunDetailModal.tsx): `frontend/src/components/RunDetailModal.tsx`

### Application platform

- [Web application](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/jimmytoan/qa-agent/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`
- [FastAPI application](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/main.py): `backend/app/main.py`
- [PostgreSQL](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/database.py): `backend/app/database.py`
- [Run and test records](https://github.com/jimmytoan/qa-agent/blob/main/backend/app/models.py): `backend/app/models.py`

### Other components

- **QA user**
- **Browser-use agent**
- **LLM providers**

## Connections

- QA user → Web application: uses (evidence: `frontend/src/App.tsx`)
- Web application → Products: routes to (evidence: `frontend/src/App.tsx`)
- Web application → Suites and import: routes to (evidence: `frontend/src/App.tsx`)
- Web application → Natural-language tests: routes to (evidence: `frontend/src/App.tsx`)
- Web application → Reports and history: routes to (evidence: `frontend/src/App.tsx`)
- Suites and import → Excel import: opens (evidence: `frontend/src/pages/SuitesPage.tsx`)
- Products → API client: requests data
- Suites and import → API client: requests data (evidence: `frontend/src/pages/SuitesPage.tsx`)
- Natural-language tests → API client: creates tests (evidence: `frontend/src/pages/TestsPage.tsx`)
- Reports and history → API client: loads reports (evidence: `frontend/src/pages/ReportsPage.tsx`)
- API client → FastAPI application: REST and SSE (evidence: `README.md`)
- FastAPI application → Product routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Suite routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Test routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Run and SSE routes: registers (evidence: `backend/app/main.py`)
- FastAPI application → Suite-run orchestration: registers (evidence: `backend/app/main.py`)
- Product routes → PostgreSQL: queries
- Suite routes → PostgreSQL: queries (evidence: `backend/app/routers/suites.py`)
- Test routes → PostgreSQL: queries (evidence: `backend/app/routers/tests.py`)
- Test routes → Browser run engine: starts test run (evidence: `backend/app/routers/tests.py`)
- Suite-run orchestration → Browser run engine: starts suite run
- Run and SSE routes → Browser run engine: creates run (evidence: `backend/app/routers/runs.py`)
- Run and SSE routes → Live run queues: streams events (evidence: `backend/app/routers/runs.py`)
- Browser run engine → Live run queues: publishes events (evidence: `backend/app/services/runner.py`)
- Browser run engine → Browser-use agent: executes browser (evidence: `README.md`)
- Browser run engine → LLM providers: uses model (evidence: `README.md`)
- Browser run engine → Artifact capture: captures artifacts (evidence: `backend/app/services/runner.py`)
- Artifact capture → Screenshots and GIFs: writes files (evidence: `backend/app/services/artifacts.py`)
- Run and SSE routes → Screenshots and GIFs: serves artifacts
- Reports and history → Run detail viewer: opens details (evidence: `frontend/src/pages/ReportsPage.tsx`)
- Browser run engine → PostgreSQL: updates runs (evidence: `backend/app/services/runner.py`)
- PostgreSQL → Run and test records: stores records
