Skip to content

richardsondx/subscription-helper-demo

Repository files navigation

SaaS Subscription Helper Test Project

Image from Gyazo

This is a Next.js project bootstrapped with create-next-app that demonstrates the integration of SaaS Subscription Helper for Stripe and Supabase subscription management.

Getting Started

First, set up your environment variables:

# .env.local
STRIPE_SECRET_KEY=sk_test_your_secret_key
SUPABASE_URL=https://your_supabase_instance.supabase.co
SUPABASE_KEY=your_supabase_service_key
STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret
STRIPE_CUSTOMER_PORTAL_URL=https://billing.stripe.com/p/login/test_00abc

You can also rename env.sample to .env and fill in the values.

Then, install the dependencies:

npm install
npm install saas-subscription-helper stripe @supabase/supabase-js

Finally, run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

Project Structure

/app
  /api
    /webhooks
      route.js      # Stripe webhook handler
    /subscription
      /upgrade
        route.js    # Subscription upgrade endpoint
      /cancel
        route.js    # Subscription cancel endpoint
  /components
    SubscriptionManager.jsx  # Subscription management UI
  page.js         # Main demo page

Features Demonstrated

  • Stripe webhook handling for subscription events
  • Supabase database synchronization
  • Subscription management (upgrades/downgrades)
  • User authentication flow
  • Error handling and logging

Learn More

To learn more about the technologies used in this project:

Deploy on Vercel

The easiest way to deploy this demo is to use the Vercel Platform.

Don't forget to:

  1. Configure environment variables in your Vercel project
  2. Set up Stripe webhook endpoints
  3. Configure Supabase connection details

Check out the deployment documentation for more details.

About

saas-subscription-helper test project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published