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:
| Migration | What it creates |
|---|---|
supabase/001_schema.sql | Core tables: workspaces, memberships, invitations, products, subscriptions, audit_logs |
supabase/002_rls.sql | Row-Level Security policies and helper functions |
supabase/003_soft_delete_and_dashboard.sql | Soft delete columns, partial indexes, daily_audit_counts() function |
supabase/004_onboarding.sql | Onboarding setup_complete flag on workspaces |
supabase/005_tags_comments_2fa.sql | Tags, comments, 2FA enforcement |
supabase/006_remaining_features.sql | API 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
- Go to
/sign-upand create an account - Confirm your email (or disable email confirmation in Supabase Auth settings for faster dev iteration)
- Sign in -- you'll be redirected to
/select-workspace - Click Create workspace and give it a name
- Explore the dashboard, create a product, check out Settings
Common issues
| Problem | Fix |
|---|---|
| "Supabase not configured" | Check that all 3 Supabase env vars are set in .env.local |
| Auth redirect loops | Set Site URL and Redirect URLs in Supabase Auth settings |
| Empty data / RLS errors | Make sure you ran 002_rls.sql and the user is a workspace member |
| Stripe not working | Set STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET |
See Troubleshooting for more details.
Next steps
- Supabase Setup -- configure auth providers (Google, GitHub)
- Stripe Setup -- enable subscription billing
- Resend Setup -- enable email invitations
- Architecture Overview -- understand how the multi-tenant system works