The stack ReRoute runs on, and why each piece is there
The third Batch 2 supporting doc — the seven stack categories (auth, database, AI/LLM, hosting, payments, email, storage), the vendor or provider chosen for each, and the verbatim rationale pulled from the governing spec. Companion to the Pilot economics and Operational workflow pages.
Seven categories, one vendor each, each rationale cited. The spec version cited below is the source of truth — if a line on this page ever disagrees with the governing Batch 2 doc, the doc wins.
PLACEHOLDER — cite the Batch 2 doc: the rationale for picking self-hosted better-auth over a managed auth provider (vendor lock-in, per-seat pricing, audit trail, sign-out UX).
PLACEHOLDER — cite the Batch 2 doc: the rationale for Postgres over a managed NoSQL alternative (relational schema fits RMA / inspection data, Prisma gives typed queries, Render-hosted keeps the same deploy pipeline as the app).
PLACEHOLDER — cite the Batch 2 doc: the rationale for going through the Polsia proxy rather than embedding a provider SDK / shipping our own OPENAI_API_KEY (secrets rotation, model switch, audit log).
PLACEHOLDER — cite the Batch 2 doc: the rationale for Render over the obvious alternatives (built-in Postgres + cron + health checks, same surface the Next.js Prisma stack targets).
PLACEHOLDER — cite the Batch 2 doc: the rationale for billing through Polsia rather than wiring Stripe SDK + STRIPE_SECRET_KEY directly (Connect-on-behalf-of, checkout-session proxy, no key in repo).
PLACEHOLDER — cite the Batch 2 doc: the rationale for the email proxy over a direct SMTP / Resend integration (single sendEmail helper, no client component, no spam abuse surface).
PLACEHOLDER — cite the Batch 2 doc: the rationale for R2 over S3 / Supabase Storage / Vercel Blob (S3-compatible, no egress fee for inspection photo traffic, signed URLs on the platform proxy).