Everything you need to set up, customize, and deploy Brainboot.
git clone <your-repo> my-saas cd my-saas npm install
1. Create project at supabase.com 2. SQL Editor → run supabase-schema.sql 3. SQL Editor → run supabase-schema-v2.sql 4. Copy keys from Settings → API
1. Create 2 products (Pro $29/mo, Unlimited $99/mo) 2. Copy Price IDs 3. Create webhook: yourdomain.com/api/stripe/webhook 4. Copy webhook signing secret
1. Google Cloud Console → APIs & Services → Credentials 2. Create OAuth Client ID → Web application 3. Add redirect: http://localhost:3000/auth/callback 4. In Supabase: Auth → Providers → Google → paste credentials
cp .env.example .env.local # Fill in all required variables
npm run dev # localhost:3000 npx vercel # deploy to production
Copy .env.example to .env.local and fill in your values.
NEXT_PUBLIC_SUPABASE_URLYour Supabase project URL. Found in Project Settings > API.
NEXT_PUBLIC_SUPABASE_ANON_KEYSupabase anon/public key for client-side auth.
SUPABASE_SERVICE_ROLE_KEYSupabase service role key for server-side admin operations. Never expose to the client.
STRIPE_SECRET_KEYStripe API secret key. Use test key (sk_test_) for development.
STRIPE_WEBHOOK_SECRETSigning secret for Stripe webhook verification.
STRIPE_PRO_PRICE_IDStripe Price ID for Pro plan.
STRIPE_UNLIMITED_PRICE_IDStripe Price ID for Unlimited plan.
NEXT_PUBLIC_STRIPE_PRO_PRICE_IDSame Pro price ID for client-side upgrade buttons.
NEXT_PUBLIC_STRIPE_UNLIMITED_PRICE_IDSame Unlimited price ID for client-side.
NEXT_PUBLIC_APP_URLYour app base URL for redirects and callbacks.
RESEND_API_KEYResend API key. If not set, emails log to console.
EMAIL_FROMSender address. Defaults to "Brainboot <noreply@yourdomain.com>".
EMAIL_REPLY_TOReply-to address. Defaults to "support@yourdomain.com".
Update metadata in src/app/layout.tsx, text in src/components/nav.tsx, logo in src/components/logo.tsx, colors in src/app/globals.css, email branding in src/lib/email.ts.
Edit PLAN_LIMITS and PLAN_PRICES in src/lib/supabase.ts. Create matching Stripe products and update env vars.
Create src/app/api/your-feature/route.ts. Use withAuth() wrapper for automatic auth + rate limiting.
Call incrementUsage(orgId, userId, tokens, action) from any API route. checkUsage(orgId) returns { allowed, remaining }.
Add to the templates object in src/lib/email.ts. Send with sendEmail({ to, template, data }).