# harikch2209/aitestagent architecture

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

- Interactive diagram: https://gitdiagram.com/harikch2209/aitestagent
- Repository: https://github.com/harikch2209/aitestagent

## Overview

AI Test Agent turns plain-language web or mobile scenarios into executable tests, runs them against real browsers or native devices, and returns live progress and results. The main web flow is coordinated by the chat service; a separate agent mode performs autonomous browser exploration. The platform also manages projects, cases, suites, stories, schedules, authentication, and CI integrations. The README documents these capabilities, but sampled excerpts do not expose every route-to-service call, so uncertain wiring is omitted.

Main entry points: [`web/services/chatService.ts`](https://github.com/harikch2209/aitestagent/blob/main/web/services/chatService.ts) (Chat orchestration), [`web/server.ts`](https://github.com/harikch2209/aitestagent/blob/main/web/server.ts) (Web server), [`web/services/agentService.ts`](https://github.com/harikch2209/aitestagent/blob/main/web/services/agentService.ts) (Agent service), [`src/executor/actionHandler.ts`](https://github.com/harikch2209/aitestagent/blob/main/src/executor/actionHandler.ts) (Action handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Test execution"]
  node_server["Web server<br/>[server.ts]"]
  node_chat["Chat orchestration<br/>[chatService.ts]"]
  node_ai["AI engine<br/>[aiEngine.ts]"]
  node_parser["Test parser<br/>[markdownParser.ts]"]
  node_scanner["Page scanner<br/>[pageScanner.ts]"]
  node_executor["Step executor<br/>[stepExecutor.ts]"]
  node_actions["Action handler<br/>[actionHandler.ts]"]
  node_locators["Locator healing<br/>[selfHealer.ts]"]
  node_agent_service["Agent service<br/>[agentService.ts]"]
  node_web_agent["Autonomous agent<br/>[webAgent.ts]"]
end

subgraph group_platform["Team platform"]
  node_routes["Product APIs"]
  node_scheduler["Scheduled runs<br/>[scheduler.ts]"]
  node_webhooks["Webhook delivery<br/>[webhookService.ts]"]
end

subgraph group_integrations["Runtime integrations"]
  node_providers["LLM providers<br/>[index.ts]"]
  node_browser["Browser drivers"]
  node_browser_runtime["Web browsers"]
  node_mobile["Mobile lifecycle<br/>[deviceManager.ts]"]
  node_appium["Appium driver<br/>[appiumDriver.ts]"]
  node_native_apps["iOS and Android apps"]
  node_ci["CI systems"]
  node_llm["LLM services"]
end

subgraph group_state["Persistence and results"]
  node_reporter["Run reports<br/>[htmlReporter.ts]"]
  node_storage["Database service<br/>[dbService.ts]"]
  node_sqlite[("Local settings store<br/>[sqliteStore.ts]")]
  node_database[("Application database")]
end

node_user(("Tester"))

node_user -->|"starts session"| node_server
node_server -->|"dispatches chat"| node_chat
node_chat -->|"requests plans"| node_ai
node_ai -->|"selects provider"| node_providers
node_providers -.->|"sends prompts"| node_llm
node_chat -->|"parses tests"| node_parser
node_chat -->|"scans pages"| node_scanner
node_chat -->|"runs steps"| node_executor
node_executor -->|"dispatches actions"| node_actions
node_actions -->|"heals locators"| node_locators
node_actions -->|"uses driver"| node_browser
node_browser -->|"controls browser"| node_browser_runtime
node_chat -->|"manages devices"| node_mobile
node_chat -->|"runs mobile steps"| node_appium
node_appium -->|"controls app"| node_native_apps
node_chat -->|"produces results"| node_reporter
node_user -->|"starts exploration"| node_agent_service
node_agent_service -->|"interprets goal"| node_ai
node_agent_service -->|"runs agent"| node_web_agent
node_agent_service -->|"launches browser"| node_browser_runtime
node_user -->|"manages tests"| node_routes
node_routes -->|"uses persistence"| node_storage
node_storage -->|"reads and writes"| node_database
node_server -->|"stores settings"| node_sqlite
node_scheduler -.->|"starts scheduled runs"| node_chat
node_server -->|"stops schedules"| node_scheduler
node_ci -.->|"triggers runs"| node_routes
node_chat -.->|"notifies completion"| node_webhooks

click node_server "https://github.com/harikch2209/aitestagent/blob/main/web/server.ts"
click node_chat "https://github.com/harikch2209/aitestagent/blob/main/web/services/chatService.ts"
click node_ai "https://github.com/harikch2209/aitestagent/blob/main/src/ai/aiEngine.ts"
click node_providers "https://github.com/harikch2209/aitestagent/blob/main/src/ai/providers/index.ts"
click node_parser "https://github.com/harikch2209/aitestagent/blob/main/src/parser/markdownParser.ts"
click node_scanner "https://github.com/harikch2209/aitestagent/blob/main/src/scanner/pageScanner.ts"
click node_executor "https://github.com/harikch2209/aitestagent/blob/main/src/executor/stepExecutor.ts"
click node_actions "https://github.com/harikch2209/aitestagent/blob/main/src/executor/actionHandler.ts"
click node_locators "https://github.com/harikch2209/aitestagent/blob/main/src/locators/selfHealer.ts"
click node_browser "https://github.com/harikch2209/aitestagent/blob/main/src/drivers/playwrightDriver.ts"
click node_reporter "https://github.com/harikch2209/aitestagent/blob/main/src/reporter/htmlReporter.ts"
click node_agent_service "https://github.com/harikch2209/aitestagent/blob/main/web/services/agentService.ts"
click node_web_agent "https://github.com/harikch2209/aitestagent/blob/main/src/agent/webAgent.ts"
click node_mobile "https://github.com/harikch2209/aitestagent/blob/main/src/mobile/deviceManager.ts"
click node_appium "https://github.com/harikch2209/aitestagent/blob/main/src/drivers/appiumDriver.ts"
click node_routes "https://github.com/harikch2209/aitestagent/tree/main/web/routes"
click node_scheduler "https://github.com/harikch2209/aitestagent/blob/main/web/services/scheduler.ts"
click node_webhooks "https://github.com/harikch2209/aitestagent/blob/main/web/services/webhookService.ts"
click node_storage "https://github.com/harikch2209/aitestagent/blob/main/web/services/dbService.ts"
click node_sqlite "https://github.com/harikch2209/aitestagent/blob/main/web/services/sqliteStore.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_server,node_chat,node_ai,node_parser,node_scanner,node_executor,node_actions,node_locators,node_agent_service,node_web_agent toneBlue
class node_routes,node_scheduler,node_webhooks toneAmber
class node_providers,node_browser,node_browser_runtime,node_mobile,node_appium,node_native_apps,node_ci,node_llm toneMint
class node_reporter,node_storage,node_sqlite,node_database toneRose
class node_user toneIndigo
```

## Components

### Test execution

- [Web server](https://github.com/harikch2209/aitestagent/blob/main/web/server.ts): `web/server.ts`
- [Chat orchestration](https://github.com/harikch2209/aitestagent/blob/main/web/services/chatService.ts): `web/services/chatService.ts`
- [AI engine](https://github.com/harikch2209/aitestagent/blob/main/src/ai/aiEngine.ts): `src/ai/aiEngine.ts`
- [Test parser](https://github.com/harikch2209/aitestagent/blob/main/src/parser/markdownParser.ts): `src/parser/markdownParser.ts`
- [Page scanner](https://github.com/harikch2209/aitestagent/blob/main/src/scanner/pageScanner.ts): `src/scanner/pageScanner.ts`
- [Step executor](https://github.com/harikch2209/aitestagent/blob/main/src/executor/stepExecutor.ts): `src/executor/stepExecutor.ts`
- [Action handler](https://github.com/harikch2209/aitestagent/blob/main/src/executor/actionHandler.ts): `src/executor/actionHandler.ts`
- [Locator healing](https://github.com/harikch2209/aitestagent/blob/main/src/locators/selfHealer.ts): `src/locators/selfHealer.ts`
- [Agent service](https://github.com/harikch2209/aitestagent/blob/main/web/services/agentService.ts): `web/services/agentService.ts`
- [Autonomous agent](https://github.com/harikch2209/aitestagent/blob/main/src/agent/webAgent.ts): `src/agent/webAgent.ts`

### Team platform

- [Product APIs](https://github.com/harikch2209/aitestagent/tree/main/web/routes): `web/routes`
- [Scheduled runs](https://github.com/harikch2209/aitestagent/blob/main/web/services/scheduler.ts): `web/services/scheduler.ts`
- [Webhook delivery](https://github.com/harikch2209/aitestagent/blob/main/web/services/webhookService.ts): `web/services/webhookService.ts`

### Runtime integrations

- [LLM providers](https://github.com/harikch2209/aitestagent/blob/main/src/ai/providers/index.ts): `src/ai/providers/index.ts`
- [Browser drivers](https://github.com/harikch2209/aitestagent/blob/main/src/drivers/playwrightDriver.ts): `src/drivers/playwrightDriver.ts`
- **Web browsers**
- [Mobile lifecycle](https://github.com/harikch2209/aitestagent/blob/main/src/mobile/deviceManager.ts): `src/mobile/deviceManager.ts`
- [Appium driver](https://github.com/harikch2209/aitestagent/blob/main/src/drivers/appiumDriver.ts): `src/drivers/appiumDriver.ts`
- **iOS and Android apps**
- **CI systems**
- **LLM services**

### Persistence and results

- [Run reports](https://github.com/harikch2209/aitestagent/blob/main/src/reporter/htmlReporter.ts): `src/reporter/htmlReporter.ts`
- [Database service](https://github.com/harikch2209/aitestagent/blob/main/web/services/dbService.ts): `web/services/dbService.ts`
- [Local settings store](https://github.com/harikch2209/aitestagent/blob/main/web/services/sqliteStore.ts): `web/services/sqliteStore.ts`
- **Application database**

### Other components

- **Tester**

## Connections

- Tester → Web server: starts session
- Web server → Chat orchestration: dispatches chat
- Chat orchestration → AI engine: requests plans
- AI engine → LLM providers: selects provider
- LLM providers → LLM services: sends prompts
- Chat orchestration → Test parser: parses tests
- Chat orchestration → Page scanner: scans pages
- Chat orchestration → Step executor: runs steps
- Step executor → Action handler: dispatches actions
- Action handler → Locator healing: heals locators
- Action handler → Browser drivers: uses driver
- Browser drivers → Web browsers: controls browser
- Chat orchestration → Mobile lifecycle: manages devices
- Chat orchestration → Appium driver: runs mobile steps
- Appium driver → iOS and Android apps: controls app
- Chat orchestration → Run reports: produces results
- Tester → Agent service: starts exploration
- Agent service → AI engine: interprets goal
- Agent service → Autonomous agent: runs agent
- Agent service → Web browsers: launches browser
- Tester → Product APIs: manages tests
- Product APIs → Database service: uses persistence
- Database service → Application database: reads and writes
- Web server → Local settings store: stores settings
- Scheduled runs → Chat orchestration: starts scheduled runs
- Web server → Scheduled runs: stops schedules
- CI systems → Product APIs: triggers runs
- Chat orchestration → Webhook delivery: notifies completion
