# f0xhopper/acta architecture

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

- Interactive diagram: https://gitdiagram.com/f0xhopper/acta
- Repository: https://github.com/f0xhopper/acta

## Overview

Acta is a lead-generation and qualification pipeline for a build-first web studio. Its v1 workflow turns a search query into discovered business leads, website and company checks, ranked scores, and shortlist/pitch-pack outputs; operators choose leads and carry out site building and outreach manually. The README also describes later build, outreach, and sales stages, but the supplied tree does not include the build-agent implementation. Edges reflect the README and shown source references; several audit and integration internals are represented at subsystem level because their source was not sampled.

Main entry points: [`src/cli.ts`](https://github.com/f0xhopper/acta/blob/main/src/cli.ts) (Pipeline CLI), [`src/audit/index.ts`](https://github.com/f0xhopper/acta/blob/main/src/audit/index.ts) (Website audit), [`src/db/index.ts`](https://github.com/f0xhopper/acta/blob/main/src/db/index.ts) (Lead database), [`src/loop/week.ts`](https://github.com/f0xhopper/acta/blob/main/src/loop/week.ts) (Weekly run loop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Lead discovery"]
  node_query["Query parsing<br/>[parse-query.ts]"]
  node_sweep["Search scheduler<br/>[index.ts]"]
  node_places["Places discovery<br/>[places.ts]"]
  node_lead_ingest["Lead normalization<br/>[index.ts]"]
end

subgraph group_qualification["Lead qualification"]
  node_audit["Website audit<br/>[index.ts]"]
  node_site_checks["Site checks<br/>[html-checks.ts]"]
  node_browser_capture["Browser screenshots<br/>[screenshot.ts]"]
  node_companies["Company matching<br/>[entity.ts]"]
  node_scoring["Opportunity scoring<br/>[score.ts]"]
end

subgraph group_operations["Pipeline operations"]
  node_cli["Pipeline CLI<br/>[cli.ts]"]
  node_database[("Lead database<br/>[index.ts]")]
  node_shortlist["Shortlist and packs<br/>[shortlist.ts]"]
  node_pitch_pack["Lead pitch packs<br/>[pack.ts]"]
  node_leaderboard["Lead leaderboard<br/>[leaderboard.ts]"]
  node_crm["Lead status tracking<br/>[status.ts]"]
  node_weekly_loop["Weekly run loop<br/>[week.ts]"]
end

subgraph group_delivery["Site delivery"]
  node_starter_site["Business-site starter<br/>[page.tsx]"]
end

node_operator(("Studio operator"))
node_places_api{{"Google Places"}}
node_psi{{"PageSpeed Insights"}}
node_companies_house{{"Companies House"}}

node_operator -->|"runs commands"| node_cli
node_cli -->|"parses searches"| node_query
node_cli -->|"runs scheduled searches"| node_sweep
node_sweep -->|"expands queries"| node_query
node_sweep -->|"dispatches discovery"| node_places
node_places -->|"searches listings"| node_places_api
node_places -->|"returns place results"| node_lead_ingest
node_lead_ingest -->|"stores leads"| node_database
node_cli -->|"runs audits"| node_audit
node_audit -->|"checks HTML"| node_site_checks
node_audit -->|"renders screenshots"| node_browser_capture
node_audit -->|"requests mobile scores"| node_psi
node_audit -->|"reads audit candidates"| node_database
node_cli -->|"matches entities"| node_companies
node_companies -->|"checks company records"| node_companies_house
node_cli -->|"scores leads"| node_scoring
node_scoring -->|"saves scores"| node_database
node_cli -->|"creates shortlists"| node_shortlist
node_cli -->|"builds lead packs"| node_pitch_pack
node_cli -->|"refreshes rankings"| node_leaderboard
node_leaderboard -->|"reads lead records"| node_database
node_cli -->|"updates lead status"| node_crm
node_crm -->|"persists status"| node_database
node_weekly_loop -->|"runs audits"| node_audit
node_weekly_loop -->|"matches entities"| node_companies
node_weekly_loop -->|"scores leads"| node_scoring
node_weekly_loop -->|"refreshes rankings"| node_leaderboard
node_operator -.->|"builds manually"| node_starter_site

click node_cli "https://github.com/f0xhopper/acta/blob/main/src/cli.ts"
click node_query "https://github.com/f0xhopper/acta/blob/main/src/discover/parse-query.ts"
click node_sweep "https://github.com/f0xhopper/acta/blob/main/src/sweep/index.ts"
click node_places "https://github.com/f0xhopper/acta/blob/main/src/discover/places.ts"
click node_lead_ingest "https://github.com/f0xhopper/acta/blob/main/src/discover/index.ts"
click node_database "https://github.com/f0xhopper/acta/blob/main/src/db/index.ts"
click node_audit "https://github.com/f0xhopper/acta/blob/main/src/audit/index.ts"
click node_site_checks "https://github.com/f0xhopper/acta/blob/main/src/audit/html-checks.ts"
click node_browser_capture "https://github.com/f0xhopper/acta/blob/main/src/audit/screenshot.ts"
click node_companies "https://github.com/f0xhopper/acta/blob/main/src/discover/entity.ts"
click node_scoring "https://github.com/f0xhopper/acta/blob/main/src/score/score.ts"
click node_shortlist "https://github.com/f0xhopper/acta/blob/main/src/report/shortlist.ts"
click node_pitch_pack "https://github.com/f0xhopper/acta/blob/main/src/report/pack.ts"
click node_leaderboard "https://github.com/f0xhopper/acta/blob/main/src/report/leaderboard.ts"
click node_crm "https://github.com/f0xhopper/acta/blob/main/src/crm/status.ts"
click node_weekly_loop "https://github.com/f0xhopper/acta/blob/main/src/loop/week.ts"
click node_starter_site "https://github.com/f0xhopper/acta/blob/main/starter/src/app/page.tsx"

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_query,node_sweep,node_places,node_lead_ingest toneBlue
class node_audit,node_site_checks,node_browser_capture,node_companies,node_scoring toneAmber
class node_cli,node_database,node_shortlist,node_pitch_pack,node_leaderboard,node_crm,node_weekly_loop toneMint
class node_starter_site toneRose
class node_operator,node_places_api,node_psi,node_companies_house toneIndigo
```

## Components

### Lead discovery

- [Query parsing](https://github.com/f0xhopper/acta/blob/main/src/discover/parse-query.ts): `src/discover/parse-query.ts`
- [Search scheduler](https://github.com/f0xhopper/acta/blob/main/src/sweep/index.ts): `src/sweep/index.ts`
- [Places discovery](https://github.com/f0xhopper/acta/blob/main/src/discover/places.ts): `src/discover/places.ts`
- [Lead normalization](https://github.com/f0xhopper/acta/blob/main/src/discover/index.ts): `src/discover/index.ts`

### Lead qualification

- [Website audit](https://github.com/f0xhopper/acta/blob/main/src/audit/index.ts): `src/audit/index.ts`
- [Site checks](https://github.com/f0xhopper/acta/blob/main/src/audit/html-checks.ts): `src/audit/html-checks.ts`
- [Browser screenshots](https://github.com/f0xhopper/acta/blob/main/src/audit/screenshot.ts): `src/audit/screenshot.ts`
- [Company matching](https://github.com/f0xhopper/acta/blob/main/src/discover/entity.ts): `src/discover/entity.ts`
- [Opportunity scoring](https://github.com/f0xhopper/acta/blob/main/src/score/score.ts): `src/score/score.ts`

### Pipeline operations

- [Pipeline CLI](https://github.com/f0xhopper/acta/blob/main/src/cli.ts): `src/cli.ts`
- [Lead database](https://github.com/f0xhopper/acta/blob/main/src/db/index.ts): `src/db/index.ts`
- [Shortlist and packs](https://github.com/f0xhopper/acta/blob/main/src/report/shortlist.ts): `src/report/shortlist.ts`
- [Lead pitch packs](https://github.com/f0xhopper/acta/blob/main/src/report/pack.ts): `src/report/pack.ts`
- [Lead leaderboard](https://github.com/f0xhopper/acta/blob/main/src/report/leaderboard.ts): `src/report/leaderboard.ts`
- [Lead status tracking](https://github.com/f0xhopper/acta/blob/main/src/crm/status.ts): `src/crm/status.ts`
- [Weekly run loop](https://github.com/f0xhopper/acta/blob/main/src/loop/week.ts): `src/loop/week.ts`

### Site delivery

- [Business-site starter](https://github.com/f0xhopper/acta/blob/main/starter/src/app/page.tsx): `starter/src/app/page.tsx`

### Other components

- **Studio operator**
- **Google Places**
- **PageSpeed Insights**
- **Companies House**

## Connections

- Studio operator → Pipeline CLI: runs commands (evidence: `README.md`)
- Pipeline CLI → Query parsing: parses searches
- Pipeline CLI → Search scheduler: runs scheduled searches (evidence: `src/cli.ts`)
- Search scheduler → Query parsing: expands queries (evidence: `src/sweep/index.ts`)
- Search scheduler → Places discovery: dispatches discovery (evidence: `src/sweep/index.ts`)
- Places discovery → Google Places: searches listings (evidence: `README.md`)
- Places discovery → Lead normalization: returns place results (evidence: `src/discover/index.ts`)
- Lead normalization → Lead database: stores leads (evidence: `src/discover/index.ts`)
- Pipeline CLI → Website audit: runs audits (evidence: `src/cli.ts`)
- Website audit → Site checks: checks HTML (evidence: `src/audit/index.ts`)
- Website audit → Browser screenshots: renders screenshots (evidence: `src/audit/index.ts`)
- Website audit → PageSpeed Insights: requests mobile scores (evidence: `README.md`)
- Website audit → Lead database: reads audit candidates (evidence: `src/audit/index.ts`)
- Pipeline CLI → Company matching: matches entities (evidence: `src/cli.ts`)
- Company matching → Companies House: checks company records (evidence: `README.md`)
- Pipeline CLI → Opportunity scoring: scores leads (evidence: `src/cli.ts`)
- Opportunity scoring → Lead database: saves scores (evidence: `src/score/score.ts`)
- Pipeline CLI → Shortlist and packs: creates shortlists (evidence: `README.md`)
- Pipeline CLI → Lead pitch packs: builds lead packs (evidence: `README.md`)
- Pipeline CLI → Lead leaderboard: refreshes rankings (evidence: `src/cli.ts`)
- Lead leaderboard → Lead database: reads lead records (evidence: `src/report/leaderboard.ts`)
- Pipeline CLI → Lead status tracking: updates lead status (evidence: `src/cli.ts`)
- Lead status tracking → Lead database: persists status (evidence: `src/crm/status.ts`)
- Weekly run loop → Website audit: runs audits (evidence: `src/loop/week.ts`)
- Weekly run loop → Company matching: matches entities (evidence: `src/loop/week.ts`)
- Weekly run loop → Opportunity scoring: scores leads (evidence: `src/loop/week.ts`)
- Weekly run loop → Lead leaderboard: refreshes rankings (evidence: `src/loop/week.ts`)
- Studio operator → Business-site starter: builds manually (evidence: `README.md`)
