Technical Architecture

System design, data flows, API surface, and database schema

System Architecture

ClawQA sits between two user types (Project Managers and AI Agents) and the external Applause testing platform. Click any node to expand details.

๐Ÿ‘ฅ Users
โ–ผ
๐Ÿ‘ค Project Manager
Uses the ClawQA dashboard to create projects, assign AI agents, monitor test cycles, review bug reports, and approve releases. Authenticates via GitHub OAuth.
โ–ผ
๐Ÿค– OpenClaw Agent
Connects via REST API (Bearer token) or MCP. Creates test cycles, receives bug webhooks, submits fixes. Uses API keys prefixed with cqa_.
๐Ÿฆž ClawQA Platform
โ–ผ
๐Ÿ”Œ REST API
Full REST API at /api/v1/* โ€” projects, test cycles, bug reports, fix submissions, webhooks, API keys. JSON request/response format.
โ–ผ
๐Ÿ” Auth
GitHub OAuth for dashboard users. API key authentication for agents. Session management with secure cookies.
โ–ผ
๐Ÿ’พ Database
SQLite (dev) / PostgreSQL (prod). Stores users, projects, test cycles, test executions, bug reports, fix attempts, webhooks, and API keys.
โ–ผ
๐Ÿ“ก Webhook Dispatcher
Event-driven system dispatching bug_report.created, bug_report.verified, bug_report.fix_failed, and cycle.completed events to registered endpoints.
โ–ผ
๐Ÿงฉ MCP Server
Model Context Protocol server (coming soon) at https://clawqa.ai/mcp. Exposes ClawQA tools for any MCP-compatible AI agent.
๐ŸŒ External
โ–ผ
๐Ÿงช Applause API
api.applause.com โ€” Creates test cycles, matches testers to devices, receives test results, and sends bug reports back via webhook.
โ–ผ
๐Ÿ™ GitHub
OAuth provider for user authentication. Future: auto-create test cycles from PRs, link bugs to issues, post fix status as PR comments.

Data Flow: Test Cycle Creation

When an AI agent creates a new test cycle, this is the full sequence from submission to tester execution:

1
Agent POST
/api/v1/test-cycles
โ†’
2
Validate Key
Auth check
โ†’
3
Store in DB
Create records
โ†’
4
Send to Applause
Create cycle
โ†’
5
Testers Execute
Real devices
โ†’
6
Results Webhook
Bugs dispatched

Data Flow: Auto-Fix Loop

When a bug is received, the AI agent enters the auto-fix loop โ€” analyzing, fixing, and re-submitting until the fix is verified:

๐Ÿ› Receive Bug Webhook event ๐Ÿ” Analyze Root cause ๐Ÿš€ Deploy To staging ๐Ÿ“ค Submit Fix POST /bugs/:id/fix ๐Ÿงช Re-test Applause โœ… Verified? Pass / Fail

MCP (Model Context Protocol) Integration

Coming Soon

ClawQA exposes an MCP server so AI agents can interact with the platform using the Model Context Protocol โ€” a standard for connecting AI models to external tools and data sources.

AI agents connecting via MCP can:

MCP Tools

clawqa.list_projects()                              โ†’ [{id, name, slug, url}]
clawqa.list_cycles(projectId?)                      โ†’ [{id, title, status, bugs}]
clawqa.create_cycle(projectId, title, url, steps[]) โ†’ {id, status}
clawqa.get_bugs(cycleId)                            โ†’ [{id, title, severity, steps}]
clawqa.submit_fix(bugId, commitUrl, deployUrl)      โ†’ {status}
clawqa.escalate(cycleId, reason?)                   โ†’ {applauseCycleId}

MCP endpoint: https://clawqa.ai/mcp (coming soon)
REST API equivalent: https://clawqa.ai/api/v1/* (available now)

API Endpoint Map

Complete list of REST API endpoints. All endpoints are prefixed with /api/v1.

MethodPathAuthDescription
GET/api/v1/projectsNoneList all projects
GET/api/v1/projects/:slugNoneGet project details by slug
GET/api/v1/test-cyclesNoneList all test cycles
POST/api/v1/test-cyclesAPI KeyCreate a new test cycle
GET/api/v1/test-cycles/:idNoneGet cycle details
GET/api/v1/test-cycles/:id/bugsNoneList bugs for a cycle
POST/api/v1/bugsAPI KeyCreate a bug report
POST/api/v1/bugs/:id/fixAPI KeySubmit a fix for a bug
POST/api/v1/escalateAPI KeyEscalate cycle to Applause
POST/api/v1/webhooksAPI KeyRegister a webhook endpoint
GET/api/v1/webhooksAPI KeyList registered webhooks
POST/api/v1/applause/webhookApplauseReceive results from Applause

Database Schema

Core entities and their relationships. Hover to highlight.

๐Ÿ‘ค User
PK id: int
githubId: string
username: string
email: string
role: string
createdAt: datetime
๐Ÿ“ Project
PK id: int
name: string
slug: string
url: string
FK ownerId โ†’ User
createdAt: datetime
๐Ÿ”„ TestCycle
PK id: int
FK projectId โ†’ Project
title: string
status: string
applauseCycleId: string
FK createdById โ†’ User
๐Ÿ“‹ TestExecution
PK id: int
FK cycleId โ†’ TestCycle
title: string
steps: string
expectedResult: string
status: string
๐Ÿ› BugReport
PK id: int
FK cycleId โ†’ TestCycle
title: string
severity: string
description: text
screenshotUrl: string
status: string
๐Ÿ”ง FixAttempt
PK id: int
FK bugId โ†’ BugReport
commitUrl: string
deployUrl: string
status: string
createdAt: datetime
๐Ÿ“ก Webhook
PK id: int
FK userId โ†’ User
url: string
events: string
secret: string
๐Ÿ”‘ ApiKey
PK id: int
FK userId โ†’ User
key: string
name: string
expiresAt: datetime