Complied
Internal NYC lead-paint compliance platform for Secure Environmental Group (inspections) and Abated NYC (abatement). It manages HPD lead-paint violations, inspections (XRF / dust-wipe / paint-chip / abatement), document & affidavit generation, a compliance-intelligence layer over NYC public data, and a white-label client portal.
Stack: React + Vite + TypeScript + shadcn-ui + Tailwind, deployed on Cloudflare Pages, backed by Supabase (Postgres + edge functions).
Status: the rebuild (Phases 2–8 + Rungs 1–6 + Work-tab rework) is the app now. All work has been on
mainfrom the start. The pre-rebuild app is underarchive/. Hosting is live, the schema and edge functions are deployed to production, and the citywide public-data layer is loaded there (Layer 1 buildings plus a nightlypg_cronLayer 2 delta sync, with the historical backfill still running). What remains is indocs/LIFECYCLE_ASSESSMENT.md§8 — the single ranked next-fix list. SeeCLAUDE.mdfor guardrails.
Can we run a real project today? Read docs/LIFECYCLE_ASSESSMENT.md — that is the honest pass/fail, including silent $0 invoices and XRF-only report generation.
📚 Documentation
| Doc | Role |
|---|---|
REQUIREMENTS.md | Locked decisions (D1–D21), glossary, tenancy, program abstraction |
docs/domain/ | Current system — layers, tables, DFDs, swimlanes, production gaps |
docs/LIFECYCLE_ASSESSMENT.md | Living "what works" walk-through — §8 is the ranked next-fix list |
docs/PROJECT_LIFECYCLE_GUIDE.md | How a project runs, initiation → close, with worked multi-order examples |
docs/RULEBOOK.md + docs/HPD_SYSTEM_MODEL.md | HPD legal/operational truth |
docs/CLEARANCE_INDEPENDENCE.md | The clearance-independence rule, and why it is warn-only today |
docs/compliance-ingestion-layers.md | Layer 1–5 public-data ingestion architecture |
docs/NYC_API_DATA_DICTIONARY.md | Socrata field reference (not live feed status) |
docs/DESIGN-AUTHORITY.md | Command design tokens |
docs/history/ | Index of retired rebuild documents + change log + the DESIGN-C proposal |
Staff surfaces that exist: /projects (Decide / Work / File / Money on detail), /buildings, /clients, /violations, /map, /field, /settings. Portal: /portal/*.
Local development
Requires Node.js + npm.
npm install
npm run dev # Vite dev server (localhost:8080)
npm run build # production build — a primary verification gate (must stay green)
npm run lint # eslint
npm run test # vitest run (unit tests; also `npm run test:watch`)
npm run preview # serve the production build locally
npm run build + npm run test are the two green-must-stay gates (enforced by CI in .github/workflows/ci.yml). Test coverage is still thin — grow it for pure domain logic. Tests prove logic, not end-to-end behavior, so also exercise the running app / Pages preview.
Deploying
- Frontend: Cloudflare Pages, auto-deploys on push to
main. - Supabase edge functions: deployed via the Supabase CLI (see
supabase/functions/CLAUDE.md). The production Supabase project is distinct from whatever the local CLI has linked — confirm the project ref before pushing migrations or deploying functions against prod.
Repository layout
| Path | What it is |
|---|---|
src/ | React app (pages, components, hooks, data/ repository layer, auth/) |
domain/ | Pure-TS compliance-logic package (zero I/O), aliased in via @complied/domain |
supabase/ | Migrations + edge functions (data syncs, document/report generators, notifications) |
db-tests/ | Local-Postgres regression suite (cross-tenant leakage + ingestion), needs supabase start |
docs/ | HPD rulebook domain truth + operational references (see Documentation above) |
docs/history/ | Change log, the DESIGN-C proposal, and an index of the rebuild-era documents retired on 2026-09-03 (still cited from migration headers; retrievable from git) |
archive/ | The pre-rebuild app (src/, api/, report-renderer/, old public/), kept for reference |
scripts/ | Maintenance / guard scripts |