System map

Ad spend buys leads, leads become cases, firms read CPSC. Drawn from the code on November 8, 2026.

The short version

  1. Every number the Terminal shows reads from Neon; BigQuery only carries Google and TikTok spend.
  2. A GitHub release is the only path to production for the app and its jobs.
  3. Blue lines are the main path: spend, leads and signings flow in, firms read CPSC out.
Tort Terminal: ad spend buys leads, leads become cases, firms read CPSC An architecture diagram generated by Archify. Meta Graph API v22 · ad accounts, insights, demographics · Architecture component · Meta Meta Graph API v22 ad accounts, insights, demographics AppLovin Reporting API · advertiser report, trailing 45 days · Architecture component AppLovin Reporting API advertiser report, trailing 45 days BigQuery levy-law-jdc · Hevo-landed Google + TikTok, transport only · Architecture component BigQuery levy-law-jdc Hevo-landed Google + TikTok, transport only Schema migrations · 758 files to 852; prod needs two signatures · GitHub Actions (.github/workflows): the deploy boundary Schema migrations 758 files to 852; prod needs two signatures GitHub Actions · PR gate; Release ships Vercel, image, Terraform · GitHub Actions (.github/workflows): the deploy boundary · GitHub Actions GitHub Actions PR gate; Release ships Vercel, image, Terraform Direct spend ingest jobs · meta :07 hourly + 02:37 restatement; applovin :13 · GCP project zenith-jobs, us-east4 (Terraform infra/) › Cloud Run Jobs, one cron-jobs image Direct spend ingest jobs meta :07 hourly + 02:37 restatement; applovin :13 BQ mirror jobs (Google, TikTok) · twice daily, __hevo__loaded_at watermark · GCP project zenith-jobs, us-east4 (Terraform infra/) › Cloud Run Jobs, one cron-jobs image BQ mirror jobs (Google, TikTok) twice daily, __hevo__loaded_at watermark refresh-campaign-daily-spend · hourly :25, REFRESH MATVIEW CONCURRENTLY · GCP project zenith-jobs, us-east4 (Terraform infra/) › Cloud Run Jobs, one cron-jobs image refresh-campaign-daily-spend hourly :25, REFRESH MATVIEW CONCURRENTLY ghl-sync + ghl-*-sync jobs · poll every 15 min, 10 shards, token keeper · GCP project zenith-jobs, us-east4 (Terraform infra/) › Cloud Run Jobs, one cron-jobs image ghl-sync + ghl-*-sync jobs poll every 15 min, 10 shards, token keeper Cloud Run Jobs runner · entrypoint -> jobs/<name>; Slack alert on failure · GCP project zenith-jobs, us-east4 (Terraform infra/) › Cloud Run Jobs, one cron-jobs image · Google Cloud Cloud Run Jobs runner entrypoint -> jobs/<name>; Slack alert on failure Cloud Scheduler · POST :run per job · GCP project zenith-jobs, us-east4 (Terraform infra/) Cloud Scheduler POST :run per job Secret Manager · DATABASE_URL + tokens · GCP project zenith-jobs, us-east4 (Terraform infra/) Secret Manager DATABASE_URL + tokens ad_spend.* raw mirrors · meta_*, applovin_* direct; google_*, tiktok_* via BQ · Neon Postgres: zenith DB (@neondatabase/serverless) ad_spend.* raw mirrors meta_*, applovin_* direct; google_*, tiktok_* via BQ ops.* canonical (ADR-007) · campaigns, lead_submissions, cases, campaign_daily_spend · Neon Postgres: zenith DB (@neondatabase/serverless) · Neon ops.* canonical (ADR-007) campaigns, lead_submissions, cases, campaign_daily_spend ghl.* CRM mirror · contacts, opportunities, messages, tasks · Neon Postgres: zenith DB (@neondatabase/serverless) ghl.* CRM mirror contacts, opportunities, messages, tasks GoHighLevel CRM · services.leadconnectorhq.com, OAuth · Architecture component GoHighLevel CRM services.leadconnectorhq.com, OAuth Public + partner routes · /api/forms public; /api/partner LK pull keys · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ Public + partner routes /api/forms public; /api/partner LK pull keys Clerk + authorize() ADR-016 · pillar, role, permission, resource · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ Clerk + authorize() ADR-016 pillar, role, permission, resource API routes (546 route.ts) · audit:acl gate; repositoryHandler; Neon SQL · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ API routes (546 route.ts) audit:acl gate; repositoryHandler; Neon SQL Webhook receivers · OIDC Pub/Sub, Clerk, Trulioo, Twilio status · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ Webhook receivers OIDC Pub/Sub, Clerk, Trulioo, Twilio status Integration clients (ADR-018) · GHL, R2, SendGrid, Slack, Twilio, Trulioo · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ Integration clients (ADR-018) GHL, R2, SendGrid, Slack, Twilio, Trulioo Tort Terminal web (Next.js 16) · capital, ops, claimant, intel pillar hosts · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ · Next.js Tort Terminal web (Next.js 16) capital, ops, claimant, intel pillar hosts Metrics: signed cases + CPSC · active, not excluded; all-in cost / signed · Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ Metrics: signed cases + CPSC active, not excluded; all-in cost / signed Claimant · intake.levylaw.com page · Architecture component Claimant intake.levylaw.com page tt-agent-mcp · separate repo · Architecture component tt-agent-mcp separate repo Law firm investors + Zenith staff · browser, Clerk session · Architecture component Law firm investors + Zenith staff browser, Clerk session zenith-events (GCP, separate repo) · events.tortterminal.com; Pub/Sub push + OIDC · Architecture component zenith-events (GCP, separate repo) events.tortterminal.com; Pub/Sub push + OIDC Cloudflare R2 · documents · Architecture component · Cloudflare Cloudflare R2 documents Vendor APIs · SendGrid Slack Twilio Trulioo · Architecture component Vendor APIs SendGrid Slack Twilio Trulioo verify-page service · /v/:token government-ID upload · GCP zenith-jobs: Cloud Run services (same image) verify-page service /v/:token government-ID upload lk-pull-api service · api.tortterminal.com; same LK handlers · GCP zenith-jobs: Cloud Run services (same image) lk-pull-api service api.tortterminal.com; same LK handlers LK partner systems · per-org bearer key · Architecture component LK partner systems per-org bearer key Graph insights, 3-day lookback advertiser report SELECT since watermark upsert meta_*, applovin_* upsert google_*, tiktok_* REFRESH campaign_daily_spend poll contacts shadow rows leads, claimants POST :run mounted env image + terraform on Release form_submissions; LK reads SQL over HTTP, withTransaction signings -> ops.cases authorize() Clerk session cpsc(), signed predicate clients + outbox REST writes: fields, tags, upserts presigned URLs email, alerts, SMS, KYC HTTPS, CPSC dashboards intake form posts API keys, service accounts Pub/Sub push, OIDC SMS link /v/:token GET cases, government IDs GitHub Actions (.github/workflows): the deploy boundary GCP project zenith-jobs, us-east4 (Terraform infra/) Cloud Run Jobs, one cron-jobs image Neon Postgres: zenith DB (@neondatabase/serverless) Vercel: tortterminal.com (prod, Release only) and tortterminal-dev.com (beta), root app/ GCP zenith-jobs: Cloud Run services (same image) Legend Frontend Backend Database Cloud Security External

From you

nothing