# ps9151299-coder/testforge-ai architecture

> Architecture diagram of the GitHub repository ps9151299-coder/testforge-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ps9151299-coder/testforge-ai
- Repository: https://github.com/ps9151299-coder/testforge-ai

## Overview

TestForge AI is a web application for turning software requirements documents into structured requirements, test plans, cases, task roadmaps and Playwright automation, with workspace, authentication and execution/reporting features. The primary workflow runs from project selection and document upload through extraction and synthesis to automation and reports. The excerpts confirm frontend upload and generation-service calls, backend route registration, and authentication/security calls; several execution and persistence details are only indexed, so uncertain connections are omitted or shown as unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/App.tsx) (Route application), [`backend/app/main.py`](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/api/documents.py`](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/documents.py) (Document endpoints), [`frontend/src/pages/ProjectDetail.tsx`](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/ProjectDetail.tsx) (Requirement workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Route application<br/>[App.tsx]"]
  node_dashboard["Project dashboard<br/>[Dashboard.tsx]"]
  node_project["Requirement workspace<br/>[ProjectDetail.tsx]"]
  node_docclient["Document upload client<br/>[documentService.ts]"]
  node_genclient["Generation client<br/>[generateService.ts]"]
  node_httpclient["HTTP client<br/>[api.ts]"]
  node_generator["Test synthesis workspace<br/>[TestGenerator.tsx]"]
  node_tracker["Work tracker"]
  node_reportview["Playwright report view"]
  node_login["Login screen<br/>[Login.tsx]"]
  node_register["Registration screen<br/>[Register.tsx]"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI application<br/>[main.py]"]
  node_execution["Test execution<br/>[execution.py]"]
  node_reportfiles["HTML report files<br/>[index.html]"]
end

subgraph group_services["Requirement processing"]
  node_documents["Document endpoints<br/>[documents.py]"]
  node_chunking["Document chunking"]
  node_filter["Boilerplate filtering<br/>[filter_service.py]"]
  node_generateapi["Generation endpoints<br/>[generate.py]"]
  node_ai["Requirement synthesis<br/>[ai_service.py]"]
end

subgraph group_identity["Identity and workspace"]
  node_authapi["Authentication endpoints<br/>[auth.py]"]
  node_userfile[("User file store<br/>[auth.py]")]
  node_security["Password and tokens<br/>[security.py]"]
  node_workspaceapi["Workspace endpoints<br/>[workspaces.py]"]
  node_workspace["Workspace model<br/>[workspace.py]"]
  node_dbsession[("Database session<br/>[session.py]")]
end

node_user(("Project user"))

node_user -->|"uses"| node_app
node_app -->|"routes"| node_login
node_app -->|"routes"| node_register
node_app -->|"routes"| node_dashboard
node_app -->|"routes"| node_project
node_app -->|"routes"| node_generator
node_app -->|"routes"| node_reportview
node_project -->|"uploads through"| node_docclient
node_project -->|"requests extraction"| node_genclient
node_docclient -->|"sends request"| node_httpclient
node_genclient -->|"sends requests"| node_httpclient
node_backend -->|"registers router"| node_authapi
node_backend -->|"registers router"| node_workspaceapi
node_backend -->|"registers router"| node_documents
node_backend -->|"registers router"| node_generateapi
node_backend -->|"registers router"| node_execution
node_authapi -->|"reads and writes"| node_userfile
node_authapi -->|"verifies and signs"| node_security
node_workspaceapi -->|"uses sessions"| node_dbsession
node_workspaceapi -->|"uses model"| node_workspace
node_documents -.->|"uses"| node_chunking
node_documents -.->|"uses"| node_filter
node_generateapi -.->|"uses synthesis"| node_ai
node_docclient -.->|"uploads document"| node_documents
node_genclient -.->|"requests synthesis"| node_generateapi
node_generator -.->|"runs suite"| node_execution
node_backend -->|"serves reports"| node_reportfiles

click node_app "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/App.tsx"
click node_dashboard "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/Dashboard.tsx"
click node_project "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/ProjectDetail.tsx"
click node_docclient "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/services/documentService.ts"
click node_genclient "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/services/generateService.ts"
click node_httpclient "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/services/api.ts"
click node_generator "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/TestGenerator.tsx"
click node_tracker "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/components/WorkTrackerModal.tsx"
click node_reportview "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/PlaywrightReport.tsx"
click node_login "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/Login.tsx"
click node_register "https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/Register.tsx"
click node_backend "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/main.py"
click node_authapi "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/auth.py"
click node_userfile "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/auth.py"
click node_security "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/core/security.py"
click node_workspaceapi "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/workspaces.py"
click node_workspace "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/models/workspace.py"
click node_dbsession "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/db/session.py"
click node_documents "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/documents.py"
click node_chunking "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/services/chunking_service.py"
click node_filter "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/services/filter_service.py"
click node_generateapi "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/generate.py"
click node_ai "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/services/ai_service.py"
click node_execution "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/execution.py"
click node_reportfiles "https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/reports/index.html"

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_dashboard,node_project,node_docclient,node_genclient,node_httpclient,node_generator,node_tracker,node_reportview,node_login,node_register,node_user toneBlue
class node_backend,node_execution,node_reportfiles toneAmber
class node_documents,node_chunking,node_filter,node_generateapi,node_ai toneMint
class node_authapi,node_userfile,node_security,node_workspaceapi,node_workspace,node_dbsession toneRose
```

## Components

### Web application

- [Route application](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Project dashboard](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`
- [Requirement workspace](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/ProjectDetail.tsx): `frontend/src/pages/ProjectDetail.tsx`
- [Document upload client](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/services/documentService.ts): `frontend/src/services/documentService.ts`
- [Generation client](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/services/generateService.ts): `frontend/src/services/generateService.ts`
- [HTTP client](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [Test synthesis workspace](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/TestGenerator.tsx): `frontend/src/pages/TestGenerator.tsx`
- [Work tracker](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/components/WorkTrackerModal.tsx): `frontend/src/components/WorkTrackerModal.tsx`
- [Playwright report view](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/PlaywrightReport.tsx): `frontend/src/pages/PlaywrightReport.tsx`
- [Login screen](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Registration screen](https://github.com/ps9151299-coder/testforge-ai/blob/main/frontend/src/pages/Register.tsx): `frontend/src/pages/Register.tsx`

### Backend API

- [FastAPI application](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/main.py): `backend/app/main.py`
- [Test execution](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/execution.py): `backend/app/api/execution.py`
- [HTML report files](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/reports/index.html): `backend/reports/index.html`

### Requirement processing

- [Document endpoints](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/documents.py): `backend/app/api/documents.py`
- [Document chunking](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/services/chunking_service.py): `backend/app/services/chunking_service.py`
- [Boilerplate filtering](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/services/filter_service.py): `backend/app/services/filter_service.py`
- [Generation endpoints](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/generate.py): `backend/app/api/generate.py`
- [Requirement synthesis](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/services/ai_service.py): `backend/app/services/ai_service.py`

### Identity and workspace

- [Authentication endpoints](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [User file store](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/auth.py): `backend/app/api/auth.py`
- [Password and tokens](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Workspace endpoints](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/api/workspaces.py): `backend/app/api/workspaces.py`
- [Workspace model](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/models/workspace.py): `backend/app/models/workspace.py`
- [Database session](https://github.com/ps9151299-coder/testforge-ai/blob/main/backend/app/db/session.py): `backend/app/db/session.py`

### Other components

- **Project user**

## Connections

- Project user → Route application: uses
- Route application → Login screen: routes (evidence: `frontend/src/App.tsx`)
- Route application → Registration screen: routes (evidence: `frontend/src/App.tsx`)
- Route application → Project dashboard: routes (evidence: `frontend/src/App.tsx`)
- Route application → Requirement workspace: routes (evidence: `frontend/src/App.tsx`)
- Route application → Test synthesis workspace: routes (evidence: `frontend/src/App.tsx`)
- Route application → Playwright report view: routes (evidence: `frontend/src/App.tsx`)
- Requirement workspace → Document upload client: uploads through (evidence: `frontend/src/pages/ProjectDetail.tsx`)
- Requirement workspace → Generation client: requests extraction (evidence: `frontend/src/pages/ProjectDetail.tsx`)
- Document upload client → HTTP client: sends request (evidence: `frontend/src/services/documentService.ts`)
- Generation client → HTTP client: sends requests (evidence: `frontend/src/services/generateService.ts`)
- FastAPI application → Authentication endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Workspace endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Document endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Generation endpoints: registers router (evidence: `backend/app/main.py`)
- FastAPI application → Test execution: registers router (evidence: `backend/app/main.py`)
- Authentication endpoints → User file store: reads and writes (evidence: `backend/app/api/auth.py`)
- Authentication endpoints → Password and tokens: verifies and signs (evidence: `backend/app/api/auth.py`)
- Workspace endpoints → Database session: uses sessions (evidence: `backend/app/api/workspaces.py`)
- Workspace endpoints → Workspace model: uses model (evidence: `backend/app/api/workspaces.py`)
- Document endpoints → Document chunking: uses (evidence: `backend/app/api/documents.py`)
- Document endpoints → Boilerplate filtering: uses (evidence: `backend/app/api/documents.py`)
- Generation endpoints → Requirement synthesis: uses synthesis (evidence: `backend/app/api/generate.py`)
- Document upload client → Document endpoints: uploads document
- Generation client → Generation endpoints: requests synthesis
- Test synthesis workspace → Test execution: runs suite
- FastAPI application → HTML report files: serves reports (evidence: `backend/app/main.py`)
