# mechlintech/agent-hub architecture

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

- Interactive diagram: https://gitdiagram.com/mechlintech/agent-hub
- Repository: https://github.com/mechlintech/agent-hub

## Overview

Agent Hub combines JMeter script review, performance-results analysis, project scaffolding, and executor/integration workflows behind authenticated, permission-aware app routes. The principal flow is script upload and review, followed by findings and report/export. The README documents product capabilities; sampled excerpts and the SOURCE INDEX support only some internal calls, so unsampled connections are omitted rather than inferred.

Main entry points: [`src/lib/supabase/get-auth-context.ts`](https://github.com/mechlintech/agent-hub/blob/main/src/lib/supabase/get-auth-context.ts) (Auth and Permissions), [`src/app/(app)/agents/script-review/new/page.tsx`](https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/script-review/new/page.tsx) (Review Workspace), [`src/lib/review-service.ts`](https://github.com/mechlintech/agent-hub/blob/main/src/lib/review-service.ts) (Review Service), [`src/lib/jmx/review-runner.ts`](https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/review-runner.ts) (JMX Review Runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review["Script Review"]
  node_review_ui["Review Workspace<br/>[page.tsx]"]
  node_review_service["Review Service<br/>[review-service.ts]"]
  node_jmx_runner["JMX Review Runner<br/>[review-runner.ts]"]
  node_jmx_parser["JMX Parser<br/>[parser.ts]"]
  node_jmx_rules["Rules and Scoring<br/>[rules.ts]"]
  node_review_results["Findings and Reports<br/>[page.tsx]"]
  node_report_exports["Report Export<br/>[generator.ts]"]
end

subgraph group_analysis["Performance Analysis"]
  node_results_ui["Analysis Workspace<br/>[page.tsx]"]
  node_results_api["Analysis API<br/>[route.ts]"]
  node_results_service["Analysis Service"]
  node_results_engine["Analysis Engines<br/>[analysis-runner.ts]"]
end

subgraph group_setup["Project Scaffolding"]
  node_project_ui["Setup Wizard"]
  node_project_api["Project Setup API<br/>[route.ts]"]
  node_project_service["Setup Service"]
  node_setup_planner["Scaffold Planner<br/>[planner.ts]"]
end

subgraph group_platform["Access and Storage"]
  node_auth["Auth and Permissions"]
  node_permission_rules["Permission Rules<br/>[permissions.ts]"]
  node_supabase[("Supabase<br/>[server.ts]")]
  node_asset_storage[("Script Asset Storage<br/>[storage.ts]")]
end

subgraph group_integrations["Executors and Integrations"]
  node_blazemeter["BlazeMeter Integration<br/>[client.ts]"]
  node_local_executor["Local Executor<br/>[server.ts]"]
  node_executor_orchestrator["Generation Orchestrator<br/>[orchestrator.ts]"]
end

node_engineer(("Performance Engineer"))

node_engineer -->|"starts review"| node_review_ui
node_review_ui -.->|"submits script"| node_review_service
node_review_service -->|"runs review"| node_jmx_runner
node_jmx_runner -->|"parses JMX"| node_jmx_parser
node_jmx_runner -->|"applies rules"| node_jmx_rules
node_review_service -->|"uploads assets"| node_asset_storage
node_review_ui -->|"views findings"| node_review_results
node_review_results -->|"exports reports"| node_report_exports
node_engineer -->|"analyzes run"| node_results_ui
node_results_ui -.->|"creates analysis"| node_results_api
node_results_api -->|"checks access"| node_auth
node_results_api -->|"creates analysis"| node_results_service
node_results_service -.->|"analyzes results"| node_results_engine
node_results_ui -.->|"imports test runs"| node_blazemeter
node_engineer -->|"configures scaffold"| node_project_ui
node_project_ui -.->|"submits config"| node_project_api
node_project_api -->|"checks access"| node_auth
node_project_api -->|"creates setup"| node_project_service
node_project_service -.->|"plans scaffold"| node_setup_planner
node_project_ui -.->|"connects executor"| node_local_executor
node_local_executor -->|"runs generation"| node_executor_orchestrator
node_executor_orchestrator -->|"builds plan"| node_setup_planner
node_auth -->|"authenticates user"| node_supabase
node_auth -->|"resolves access"| node_permission_rules

click node_review_ui "https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/script-review/new/page.tsx"
click node_review_service "https://github.com/mechlintech/agent-hub/blob/main/src/lib/review-service.ts"
click node_jmx_runner "https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/review-runner.ts"
click node_jmx_parser "https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/parser.ts"
click node_jmx_rules "https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/rules.ts"
click node_review_results "https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/script-review/%5Bid%5D/results/page.tsx"
click node_report_exports "https://github.com/mechlintech/agent-hub/blob/main/src/lib/reports/generator.ts"
click node_results_ui "https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/results-analysis/new/page.tsx"
click node_results_api "https://github.com/mechlintech/agent-hub/blob/main/src/app/api/results-analysis/route.ts"
click node_results_service "https://github.com/mechlintech/agent-hub/blob/main/src/lib/results-analysis-service-server.ts"
click node_results_engine "https://github.com/mechlintech/agent-hub/blob/main/src/lib/results-analysis/analysis-runner.ts"
click node_blazemeter "https://github.com/mechlintech/agent-hub/blob/main/src/lib/blazemeter/client.ts"
click node_project_ui "https://github.com/mechlintech/agent-hub/blob/main/src/components/project-setup/ProjectSetupWizard.tsx"
click node_project_api "https://github.com/mechlintech/agent-hub/blob/main/src/app/api/project-setup/route.ts"
click node_project_service "https://github.com/mechlintech/agent-hub/blob/main/src/lib/project-setup-service-server.ts"
click node_setup_planner "https://github.com/mechlintech/agent-hub/blob/main/src/lib/project-setup/planner.ts"
click node_local_executor "https://github.com/mechlintech/agent-hub/blob/main/packages/local-executor/server.ts"
click node_executor_orchestrator "https://github.com/mechlintech/agent-hub/blob/main/packages/local-executor/orchestrator.ts"
click node_auth "https://github.com/mechlintech/agent-hub/blob/main/src/lib/supabase/get-auth-context.ts"
click node_permission_rules "https://github.com/mechlintech/agent-hub/blob/main/src/lib/permissions.ts"
click node_supabase "https://github.com/mechlintech/agent-hub/blob/main/src/lib/supabase/server.ts"
click node_asset_storage "https://github.com/mechlintech/agent-hub/blob/main/src/lib/storage.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_review_ui,node_review_service,node_jmx_runner,node_jmx_parser,node_jmx_rules,node_review_results,node_report_exports toneBlue
class node_results_ui,node_results_api,node_results_service,node_results_engine toneAmber
class node_project_ui,node_project_api,node_project_service,node_setup_planner toneMint
class node_auth,node_permission_rules,node_supabase,node_asset_storage toneRose
class node_blazemeter,node_local_executor,node_executor_orchestrator,node_engineer toneIndigo
```

## Components

### Script Review

- [Review Workspace](https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/script-review/new/page.tsx): `src/app/(app)/agents/script-review/new/page.tsx`
- [Review Service](https://github.com/mechlintech/agent-hub/blob/main/src/lib/review-service.ts): `src/lib/review-service.ts`
- [JMX Review Runner](https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/review-runner.ts): `src/lib/jmx/review-runner.ts`
- [JMX Parser](https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/parser.ts): `src/lib/jmx/parser.ts`
- [Rules and Scoring](https://github.com/mechlintech/agent-hub/blob/main/src/lib/jmx/rules.ts): `src/lib/jmx/rules.ts`
- [Findings and Reports](https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/script-review/%5Bid%5D/results/page.tsx): `src/app/(app)/agents/script-review/[id]/results/page.tsx`
- [Report Export](https://github.com/mechlintech/agent-hub/blob/main/src/lib/reports/generator.ts): `src/lib/reports/generator.ts`

### Performance Analysis

- [Analysis Workspace](https://github.com/mechlintech/agent-hub/blob/main/src/app/(app)/agents/results-analysis/new/page.tsx): `src/app/(app)/agents/results-analysis/new/page.tsx`
- [Analysis API](https://github.com/mechlintech/agent-hub/blob/main/src/app/api/results-analysis/route.ts): `src/app/api/results-analysis/route.ts`
- [Analysis Service](https://github.com/mechlintech/agent-hub/blob/main/src/lib/results-analysis-service-server.ts): `src/lib/results-analysis-service-server.ts`
- [Analysis Engines](https://github.com/mechlintech/agent-hub/blob/main/src/lib/results-analysis/analysis-runner.ts): `src/lib/results-analysis/analysis-runner.ts`

### Project Scaffolding

- [Setup Wizard](https://github.com/mechlintech/agent-hub/blob/main/src/components/project-setup/ProjectSetupWizard.tsx): `src/components/project-setup/ProjectSetupWizard.tsx`
- [Project Setup API](https://github.com/mechlintech/agent-hub/blob/main/src/app/api/project-setup/route.ts): `src/app/api/project-setup/route.ts`
- [Setup Service](https://github.com/mechlintech/agent-hub/blob/main/src/lib/project-setup-service-server.ts): `src/lib/project-setup-service-server.ts`
- [Scaffold Planner](https://github.com/mechlintech/agent-hub/blob/main/src/lib/project-setup/planner.ts): `src/lib/project-setup/planner.ts`

### Access and Storage

- [Auth and Permissions](https://github.com/mechlintech/agent-hub/blob/main/src/lib/supabase/get-auth-context.ts): `src/lib/supabase/get-auth-context.ts`
- [Permission Rules](https://github.com/mechlintech/agent-hub/blob/main/src/lib/permissions.ts): `src/lib/permissions.ts`
- [Supabase](https://github.com/mechlintech/agent-hub/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`
- [Script Asset Storage](https://github.com/mechlintech/agent-hub/blob/main/src/lib/storage.ts): `src/lib/storage.ts`

### Executors and Integrations

- [BlazeMeter Integration](https://github.com/mechlintech/agent-hub/blob/main/src/lib/blazemeter/client.ts): `src/lib/blazemeter/client.ts`
- [Local Executor](https://github.com/mechlintech/agent-hub/blob/main/packages/local-executor/server.ts): `packages/local-executor/server.ts`
- [Generation Orchestrator](https://github.com/mechlintech/agent-hub/blob/main/packages/local-executor/orchestrator.ts): `packages/local-executor/orchestrator.ts`

### Other components

- **Performance Engineer**

## Connections

- Performance Engineer → Review Workspace: starts review (evidence: `README.md`)
- Review Workspace → Review Service: submits script
- Review Service → JMX Review Runner: runs review (evidence: `src/lib/review-service.ts`)
- JMX Review Runner → JMX Parser: parses JMX (evidence: `src/lib/jmx/review-runner.ts`)
- JMX Review Runner → Rules and Scoring: applies rules (evidence: `src/lib/jmx/review-runner.ts`)
- Review Service → Script Asset Storage: uploads assets (evidence: `src/lib/review-service.ts`)
- Review Workspace → Findings and Reports: views findings (evidence: `README.md`)
- Findings and Reports → Report Export: exports reports (evidence: `README.md`)
- Performance Engineer → Analysis Workspace: analyzes run (evidence: `README.md`)
- Analysis Workspace → Analysis API: creates analysis
- Analysis API → Auth and Permissions: checks access (evidence: `src/app/api/results-analysis/route.ts`)
- Analysis API → Analysis Service: creates analysis (evidence: `src/app/api/results-analysis/route.ts`)
- Analysis Service → Analysis Engines: analyzes results
- Analysis Workspace → BlazeMeter Integration: imports test runs
- Performance Engineer → Setup Wizard: configures scaffold (evidence: `README.md`)
- Setup Wizard → Project Setup API: submits config
- Project Setup API → Auth and Permissions: checks access (evidence: `src/app/api/project-setup/route.ts`)
- Project Setup API → Setup Service: creates setup (evidence: `src/app/api/project-setup/route.ts`)
- Setup Service → Scaffold Planner: plans scaffold
- Setup Wizard → Local Executor: connects executor
- Local Executor → Generation Orchestrator: runs generation (evidence: `packages/local-executor/server.ts`)
- Generation Orchestrator → Scaffold Planner: builds plan (evidence: `packages/local-executor/orchestrator.ts`)
- Auth and Permissions → Supabase: authenticates user (evidence: `src/lib/supabase/get-auth-context.ts`)
- Auth and Permissions → Permission Rules: resolves access (evidence: `src/lib/supabase/get-auth-context.ts`)
