TypeScript 61.9%
HTML 37.2%
SQL 0.7%
1# ADR 0001 — TypeScript end-to-end, pnpm monorepo, PostgreSQL-backed queue23Date: 2026-09-07 · Status: accepted45## Context6CLAUDE.md allows Node/TypeScript or Python services (§167) and suggests a layout (§195). The launch7wedge must ship quickly on a single node while the architecture must scale to hundreds of millions8of observations.910## Decision111. **TypeScript everywhere** (web, API, workers, connectors). One runtime, shared Zod schemas between12 pipeline and UI, Drizzle typed queries, and the connector interface exactly as specified (§102).132. **pnpm workspaces**, packages consumed as TS sources (`transpilePackages` in Next, `tsx` for workers).143. **PostgreSQL 17** as system of record (pg_trgm, unaccent, pgvector). No Timescale for now; time15 series tables (`price_snapshots`, `index_values`) use composite PKs and date indexes; partitioning16 can be added by migration.174. **pg-boss** as the queue (Postgres-backed), wrapped by a small `Queue` interface in `workers/lib`18 so Redis Streams/Kafka can be substituted without touching connectors or handlers (§140).195. **Admin UI lives inside `apps/web` under `/admin`** (token-protected) instead of a separate20 `apps/admin`, to avoid duplicating the design system in Phase 1. It can be split later.216. **Registry from meta files**: `connectors/registry.json` is generated from per-connector22 `meta.json` (avoids merge conflicts between parallel contributors) — it remains the artefact §106 asks for.2324## Consequences25- Data-science-heavy methods (hedonic regression, repeat-sales) are implemented in TS with small26 numerical helpers; a Python research service can be added later behind the same tables.27- Everything deploys as PM2 processes on one node via `mld`; horizontal scale = more worker processes28 pointed at the same Postgres/pg-boss.29