ADR-005: Hosting & Boundaries — Vercel (Web) + Supabase (Data & Edge)
Status
Accepted
Context
We needed clean separations: the interactive HUD should live where Next.js feels at home, while ingestion, storage, and auth should sit next to the database. Combining everything in one provider risked either overpaying or underusing features.
Options considered
- Vercel + Supabase — Best-in-class DX on both sides, with shared TypeScript clients.
- All-in Vercel — Run ingestion as Vercel Functions; still possible, but further from the data.
- Self-host (Fly.io, k8s) — Ultimate control, longer lead time.
Decision
Ship the web app on Vercel. Keep Postgres, Auth, Storage, and Edge Functions on Supabase. Traffic flows over HTTPS with the Supabase service role stored server-side only. This mirrors the architecture diagram earlier and simplifies observability.
Consequences
Upside
- Each tier scales independently.
- We tap into Supabase Logs and Vercel Analytics without custom plumbing.
- Local dev mirrors prod:
npm run dev+supabase startgives near-identical behavior.
Trade-offs
- Debugging sometimes means checking two dashboards.
- Network latency between Vercel regions and Supabase instances can vary; we deploy both in the same region when possible.
Links
- Infrastructure sketch: see Architecture
- Related ADRs: ADR-001, ADR-003