This application now uses local Next.js API routes instead of Supabase Edge Functions for Stripe integration. This makes deployment simpler and allows you to use standard .env files for configuration.
Copy .env.example to .env.local and fill in your actual values:
cp .env.example .env.local
NEXT_PUBLIC_SUPABASE_URL - Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY - Your Supabase anonymous keySUPABASE_SERVICE_ROLE_KEY - Your Supabase service role key (server-side only)STRIPE_SECRET_KEY - Your Stripe secret key (server-side only)NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY - Your Stripe publishable keySTRIPE_WEBHOOK_SECRET - Your Stripe webhook secretNEXT_PUBLIC_SITE_URL - Your site URL (for production)NEXTAUTH_URL - Your site URL (same as above)NEXTAUTH_SECRET - A random secret for NextAuthnpm install
Set up your environment variables in .env.local
Run the development server:
npm run dev
stripe listen --forward-to localhost:3000/api/stripe/webhook
npm run buildPublish directory: .next
Environment Variables:
Add all the environment variables from your .env.local file to Netlify's environment variables section.
Stripe Webhook Setup:
https://your-domain.netlify.app/api/stripe/webhookcheckout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deletedinvoice.payment_succeededinvoice.payment_failednpx vercel
Environment Variables: Add all environment variables through Vercel dashboard or CLI
Stripe Webhook Setup:
https://your-domain.vercel.app/api/stripe/webhookThe application now uses these local API routes:
POST /api/stripe/checkout - Creates Stripe checkout sessionsPOST /api/stripe/webhook - Handles Stripe webhook eventsSTRIPE_WEBHOOK_SECRET matches your Stripe webhook endpointVerify webhook URL is correct
Environment Variables:
Verify Supabase service role key has proper permissions
CORS Issues:
STRIPE_SECRET_KEY or SUPABASE_SERVICE_ROLE_KEY to the clientNEXT_PUBLIC_ prefix only for client-side variables$ claude mcp add kanba \
-- python -m otcore.mcp_server <graph>