Skip to content

Clone, deploy, and fully customize a SaaS subscription application with Next.js.

License

Notifications You must be signed in to change notification settings

farajabien/supabase-saas-starter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Next.js SaaS Starter for African Markets

The all-in-one starter kit for building SaaS applications with local payment integrations for the African market.

Features

  • Secure user management and authentication with Supabase
  • Powerful data access & management tooling on top of PostgreSQL with Supabase
  • Integrated payment processing with Paystack for:
    • Local card payments
    • Bank transfers
    • USSD payments
    • Mobile money (coming soon)
  • Automatic syncing of pricing plans and subscription statuses via webhooks
  • Team management and role-based access control
  • Dark/light mode support
  • Responsive dashboard UI with shadcn/ui

Architecture

The template uses the following technology stack:

Setup

1. Clone and Install

git clone https://github.com/yourusername/your-repo
cd your-repo
pnpm install

2. Configure Supabase

  1. Create a project at Supabase
  2. Run database migrations
  3. Set up auth providers
  4. Copy environment variables

3. Configure Paystack

  1. Create a Paystack account
  2. Get your API keys
  3. Set up webhook endpoint at your-domain.com/api/webhooks
  4. Configure payment methods

4. Environment Variables

Create a .env.local file:

# Supabase
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=

# Paystack
NEXT_PUBLIC_PAYSTACK_PUBLIC_KEY=
PAYSTACK_SECRET_KEY=

# General
NEXT_PUBLIC_SITE_URL=

5. Run Locally

pnpm dev

Payment Flow

The template handles payments through Paystack:

  1. User selects a plan
  2. Redirected to Paystack checkout
  3. Payment processing through:
    • Local credit/debit cards
    • Bank transfers
    • USSD
    • Mobile money (coming soon)
  4. Webhook handles subscription events
  5. Customer portal for subscription management

Webhooks

Paystack webhooks handle:

  • Subscription creation
  • Subscription updates
  • Payment success/failure
  • Subscription cancellation

Contributing

Contributions welcome! Please:

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a PR

Support

For questions, features, or support:

License

MIT License

About

Clone, deploy, and fully customize a SaaS subscription application with Next.js.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.7%
  • PLpgSQL 6.3%
  • CSS 2.0%
  • JavaScript 1.0%