Key Implementation Checklist
- Never check remaining credits in React state or a separate SELECT query before calling an LLM API.
- Use an atomic UPDATE workspaces SET credits = credits - $1 WHERE id = $2 AND credits >= $1 RETURNING credits inside Supabase/PostgreSQL.
- Pair bounded monthly tiers with instant one-time Stripe credit top-up links.
- Download the complete Next.js 15 + Supabase RLS + Stripe implementation in SupaLaunch Kit (€69 ex VAT).