
How we built an automated churn recovery system with Next.js, Stripe Connect, and AI (keepmrr.org)
This is a technical breakdown of how we built KeepMRR — an automated churn recovery tool for SaaS founders. I'll cover the architecture, the interesting engineering decisions, and the parts that were harder than expected. The stack: Next.js 15 App Router, Supabase, Stripe Connect, Resend, OpenRouter (for AI), and pg_cron for job scheduling. The core problem we're solving When a customer cancels a Stripe subscription, most SaaS products do nothing. We wanted to automate the entire churn response pipeline: Customer cancels on Stripe ↓ Exit survey email sent automatically ↓ Customer fills in survey ↓ AI analyses the response ↓ Win-back email sequence triggered ↓ Customer reactivates ↓ Remaining emails cancelled, event marked recovered The interesting engineering challenges are: multi-tenant Stripe Connect, reliable background job processing without a queue service, and structured AI output for churn analysis. Architecture overview Next.js App Router (Vercel) ├── app/api/webhooks/stripe —
Continue reading on Dev.to JavaScript
Opens in a new tab


