Vendor & tech stack

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.

Authentication
PLACEHOLDER — better-auth on the Prisma adapter

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).

Batch 2 §4.1
Database
PLACEHOLDER — Postgres on Render via Prisma ORM

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).

Batch 2 §4.2
AI / LLM
PLACEHOLDER — Polsia platform AI proxy (no provider SDK or secret in repo)

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).

Batch 2 §4.3
Hosting
PLACEHOLDER — Render (per render-infra SKILL)

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).

Batch 2 §4.4
Payments
PLACEHOLDER — Polsia Stripe Connect via the stripe-billing module

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).

Batch 2 §4.5
Email
PLACEHOLDER — Polsia email proxy via the email module

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).

Batch 2 §4.6
Storage
PLACEHOLDER — Cloudflare R2 via the r2-proxy SKILL

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).

Batch 2 §4.7