Repository Layout

Top-level tree from docs/SYSTEM_OVERVIEW.md § Repository layout.

src/

  • api/ — REST API server (Bun.serve, port 3000)
  • enrichment/pipeline.ts — main orchestrator, exports EnrichV7
  • enrichment/sources/crawlee.ts — primary scraper, ~500 lines, 6 strategies. See Crawlee Scraper.
  • enrichment/sources/domain.ts — see Domain Discovery
  • enrichment/sources/maps.ts — see Google Places
  • enrichment/sources/firecrawl.ts — see Firecrawl (feature-flagged, off by default)
  • enrichment/processors/nameUtils.ts — see Name Validation
  • enrichment/processors/emailUtils.ts — email extraction and pattern detection
  • enrichment/processors/scoring.ts — see Lead Scoring
  • enrichment/config.ts — block lists (~790 lines)
  • enrichment/types.ts — shared interfaces
  • import/bolagsverket-import.ts — see Bolagsverket Import
  • import/scb-import.ts — see SCB Import
  • db/schema.ts — table DDL and indexes
  • queues/workers.ts — BullMQ workers (see Pipeline)
  • compliance/ — GDPR gates: Reklamspärr, Opt-Out Hashes, RoPA Log
  • mocks/validation.ts — placeholder validation layers (P0, see Known Issues)

Other top-level dirs

  • migrations/ — SQL migrations, applied via bun run migrate. See Schema Migrations.
  • autoresearch/ — autonomous experiment loop. See Autoresearch Loop.
  • scripts/ — utility scripts including migrate.ts
  • docs/ — long-form documentation (SYSTEM_OVERVIEW.md is canonical)
  • tests/bun test files

See also

Stack, System Overview, Local Development.