Prerequisites
Before you start, make sure you have:- Node.js 20+ installed
- pnpm — install with
npm install -g pnpm - A Supabase account with a new PostgreSQL project (supabase.com)
- A Resend account for transactional email (resend.com)
Configure your environment
Copy the example file to create your local environment:Then open Supabase API (Paste the output as See the Environment Variables Reference for the full list of variables and where to find each one.
.env.local and fill in each value. Here’s where to find them:Database (DATABASE_URL)In your Supabase project, go to Project Settings → Database → Connection string → URI. Select the Transaction pooler tab and copy the string that uses port 6543.VITE_SUPABASE_URL, SUPABASE_SERVICE_ROLE_KEY)Go to Project Settings → API:- Copy Project URL →
VITE_SUPABASE_URL - Copy the
service_rolekey →SUPABASE_SERVICE_ROLE_KEY
BETTER_AUTH_SECRET)Generate a cryptographically strong secret:BETTER_AUTH_SECRET. Set BETTER_AUTH_URL to http://localhost:3000 for local development.Email (SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD, EMAIL_FROM)RefactKit uses SMTP for transactional email. With Resend, the settings are:During development, Resend’s sandbox works without a verified domain. For production, verify your sending domain under Resend → Domains to avoid emails landing in spam.
Push the database schema
Push the Drizzle schema to your Supabase PostgreSQL database:This creates all the tables that RefactKit needs — users, sessions, organizations, members, invitations, and gallery images. Run this command again any time you change
db/schema.ts.Set up Supabase Storage
RefactKit uses a Supabase Storage bucket called
avatars for profile photos and organization logos. Open the SQL Editor in your Supabase dashboard and run:Start the dev server
Start the development server:Open http://localhost:3000 in your browser. You’ll see the RefactKit landing page. From there, sign up for an account and create your first organization to explore the full application.
What’s next
Authentication
How Better Auth handles sign-up, sign-in, sessions, and OWASP security controls.
Organizations
How multi-tenant workspaces work, including invitations and org switching.
Adding pages
Step-by-step guide to adding new routes, server functions, and query options.
