Metrica keeps a durable decision log. Every choice that outlives today’s task —
a library, an architecture pattern, an API shape, or a deliberate not -to-do —
is written up in the repo under /decisions/YYYY-MM-DD-{topic}.md using a
fixed template (Decision / Context / Alternatives / Reasoning / Trade-offs).
Before you decide something similar
Grep /decisions/ first. Follow the prior choice unless new information
invalidates its reasoning — then write a new record that supersedes it.
Date
Decision
Gist
2026-07-02
Auth ↔ data split
Supabase Auth for identity only; app data in Neon Postgres . stores.owner_id = Supabase user UUID; no cross-system FK.
2026-07-02
Track identity
The raw ByteTrack int is never a foreign key . MVP drops the tracks table; tracker_id is a debug column scoped to camera_id.
2026-07-03
Store-local rollups
Daily/hourly rollups computed in each store’s local timezone (Store.timezone), not UTC.
2026-07-04
Little’s Law dwell
Average visit = area under the occupancy curve ÷ entries — no sessions table, no per-person tracking .
Date
Decision
Gist
2026-07-02
Single-line counting
MVP counts crossings with one virtual line (2D cross-product + sign flip) + invert flag. Two-line tripwire deferred to Phase 2.
2026-07-02
YOLO license deferred
Use Ultralytics YOLO (AGPL) for MVP; swap to an Apache-2.0 detector before the first proprietary sale . Still open.
2026-07-03
Multi-camera counting
Footfall only on cameras flagged is_counting_line; no cross-camera Re-ID (count crossings/occupancy, not unique visitors).
2026-07-03
Free-threaded Python
Stay on standard CPython; do not adopt the no-GIL build until CPU-worker scale + stable CV wheels justify it.
Date
Decision
Gist
2026-07-02
Deployment stack
Cloudflare Pages (frontends) · FastAPI backend · Neon · Supabase Auth. (Backend host later superseded — see below.)
2026-07-04
Backend on FastAPI Cloud
Move backend to FastAPI Cloud (fastapi deploy); enforce migrations from GitHub Actions (migrate-then-deploy). Supersedes the Render line.
Date
Decision
Gist
2026-07-03
Frontend vitest config
Dedicated vitest.config.ts (no Cloudflare plugin) so the test runner starts.
2026-07-04
i18n (en/fr/ar)
i18next + react-i18next in frontend + landing; ar = Tunisian Darja (RTL), not MSA.
2026-07-04
Keep snapshotUrl until B5
Keep the unauth snapshot helper alongside the new authed blob fetch until calibrate.tsx switches over.
2026-07-04
Owner invite email
Admin assigns owner by email → backend sends a Supabase magic-link invite (no direct Resend call).
2026-07-04
shadcn zinc dashboard
Adopt shadcn/ui (new-york, zinc ); retire the custom island palette on the dashboard.
Date
Decision
Gist
2026-07-04
Product name
Ship the pilot as Metrica on metrica.vision (provisional; revisit after pilot #1). Known Yandex Metrica collision accepted.
2026-07-05
Docs site
This site — Astro Starlight on Cloudflare Pages; read-mostly, engineering-authored.
These are summaries
The one-liners above are pointers. The full record — context, every alternative
weighed, and the trade-offs accepted — lives in the corresponding
/decisions/*.md file in the repo. Read the source before reversing a decision.