Commit graph

3 commits

Author SHA1 Message Date
Kisa
ec2cd24bd7 Add Phase 3: Clerk auth with org-scoped data isolation
Backend: JWT middleware validates Clerk tokens on every request,
extracts org ID from claims, enforces org-scoped queries via
Supabase RLS. Frontend: ClerkProvider wraps the app, auth gate
blocks unauthenticated access, UserButton in header, token
injected into every API call. Supabase production wired to trust
Clerk JWTs via Third-Party Auth integration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 12:12:17 -04:00
Kisa
4a0e043a6d add phase 2 supabase persistence layer
- supabase_client.py: lazy singleton client (no-ops when env vars absent)
- persistence.py: persist_upload writes batch, source_files, normalized_records,
  mapping_decisions, report_runs; persist_export records export_files
- schema.sql: 11-table schema with RLS + WORM rules for audit/raw tables
- main.py: wire persist_upload/persist_export; add ExportRequest body model
  so export accepts {records, batch_id}; batch_id returned on upload response
- api.js: add exportFromBackend helper passing batch_id through
- requirements.txt: add supabase>=2.0.0
- smoke_test.py: update export call to new body format

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 06:50:34 -04:00
Kisa
e3afd9038c feat: FastAPI backend + full deployment stack (Railway + Vercel)
- FastAPI backend: /health, /api/upload (CSV parse + score), /api/export (work queue CSV)
- CSV normalizer: tolerates 10+ header aliases per field, 8 date formats, all 5 devices, all major payers
- Python coverage_calculator wired as the authoritative scoring engine
- Frontend: backend-first upload with local fallback, export CSV wired, J. Sullivan placeholder removed
- Dockerfile + railway.toml for Railway deploy
- vercel.json for static frontend deploy
- Railway MCP installed for future sessions

Backend live: https://signal-api-production-91c2.up.railway.app
Frontend live: https://signal-ui-xi.vercel.app

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 19:01:35 -04:00