Installation

Local setup: install packages, wire Supabase + Stripe test keys, run SQL migrations, then pnpm dev.

Prerequisites

  • Node.js 18+ (20+ recommended)
  • pnpm (or npm/yarn)
  • A Supabase project (free tier works fine)
  • (Optional) Stripe account for billing
  • (Optional) Resend account for emails

1. Clone and install

git clone https://github.com/your-org/saasforge-core my-app
cd my-app
pnpm install

2. Configure environment variables

Copy the example env file:

cp .env.local.example .env.local

Required variables

# Supabase
NEXT_PUBLIC_SUPABASE_URL=https://xxxxx.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsIn...
SUPABASE_SERVICE_ROLE_KEY=eyJhbGciOiJIUzI1NiIsIn...

# App URL
NEXT_PUBLIC_APP_URL=http://localhost:3000

Optional variables

# Stripe (for billing)
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...
NEXT_PUBLIC_STRIPE_PRO_MONTHLY_PRICE_ID=price_...
NEXT_PUBLIC_STRIPE_PRO_YEARLY_PRICE_ID=price_...
NEXT_PUBLIC_STRIPE_ENTERPRISE_MONTHLY_PRICE_ID=price_...
NEXT_PUBLIC_STRIPE_ENTERPRISE_YEARLY_PRICE_ID=price_...

# Resend (for email invitations)
RESEND_API_KEY=re_...
EMAIL_FROM="YourApp <noreply@yourapp.com>"

See Configuration for the complete variable reference.

3. Set up the database

Run the SQL migrations in your Supabase project dashboard (SQL Editor), in order:

MigrationWhat it creates
supabase/001_schema.sqlCore tables: workspaces, memberships, invitations, products, subscriptions, audit_logs
supabase/002_rls.sqlRow-Level Security policies and helper functions
supabase/003_soft_delete_and_dashboard.sqlSoft delete columns, partial indexes, daily_audit_counts() function
supabase/004_onboarding.sqlOnboarding setup_complete flag on workspaces
supabase/005_tags_comments_2fa.sqlTags, comments, 2FA enforcement
supabase/006_remaining_features.sqlAPI keys, webhooks, bookmarks, saved views, custom fields, attachments, scheduled actions, IP allowlist, login history, notification preferences

Then create the profiles table and trigger (see Supabase Setup for the SQL).

4. Start the development server

pnpm dev

Visit http://localhost:3000 -- you should see the marketing landing page.

5. Create your first account

  1. Go to /sign-up and create an account
  2. Confirm your email (or disable email confirmation in Supabase Auth settings for faster dev iteration)
  3. Sign in -- you'll be redirected to /select-workspace
  4. Click Create workspace and give it a name
  5. Explore the dashboard, create a product, check out Settings

Common issues

ProblemFix
"Supabase not configured"Check that all 3 Supabase env vars are set in .env.local
Auth redirect loopsSet Site URL and Redirect URLs in Supabase Auth settings
Empty data / RLS errorsMake sure you ran 002_rls.sql and the user is a workspace member
Stripe not workingSet STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET

See Troubleshooting for more details.

Next steps