Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.refactkit.com/llms.txt

Use this file to discover all available pages before exploring further.

RefactKit is built on Nitro v3, which compiles your application to a self-contained output that runs on any hosting target. The default build command outputs a Vercel-compatible bundle and requires no custom vercel.json beyond the minimal version declaration already committed to the repository. This page walks you through a Vercel deployment, covers alternative targets, and provides a production checklist to follow before you go live. Vercel is the primary deployment target. The build command is already configured in package.json with the correct Nitro preset:
package.json
"build": "NITRO_PRESET=vercel vite build"
When Vercel runs this command, Nitro outputs the server bundle to .output/ in Vercel’s expected format, including edge-compatible function routing.

Deploy to Vercel

1

Push your repository to GitHub, GitLab, or Bitbucket

Create a new repository and push your RefactKit project. Vercel will connect to it for continuous deployment.
2

Import the project in Vercel

Go to vercel.com/new, import your repository, and let Vercel detect the framework settings. It will pick up the build script from package.json automatically.
3

Set environment variables

In the Vercel dashboard, go to Settings → Environment Variables and add the following. These are the minimum required variables for the application to boot:
VariableDescription
DATABASE_URLYour Supabase PostgreSQL connection string (Transaction pooler, port 6543)
BETTER_AUTH_SECRETA 32-character random secret — see the warning below
BETTER_AUTH_URLYour production domain, e.g. https://yourapp.com
VITE_SUPABASE_URLYour Supabase project URL
SUPABASE_SERVICE_ROLE_KEYYour Supabase service role key
RESEND_API_KEYYour Resend API key for transactional emails
EMAIL_FROMFrom address, e.g. My App <noreply@yourdomain.com>
VITE_APP_URLYour production domain
Generate BETTER_AUTH_SECRET with a cryptographically secure method — never reuse a development secret in production:
openssl rand -base64 32
Changing this value in production invalidates all active user sessions.
4

Run database migrations

Before (or immediately after) your first deployment, synchronize your Drizzle schema with the production database. Run this against your production DATABASE_URL:
DATABASE_URL="postgresql://..." npx drizzle-kit push
You can also run this locally with the production URL set in a .env.production file, or from a CI step before deployment.
5

Deploy

Trigger a deployment from the Vercel dashboard or by pushing a commit to your main branch. Vercel runs NITRO_PRESET=vercel vite build and deploys the output automatically.

Other deployment targets

Because RefactKit uses Nitro v3, you can target any platform Nitro supports by changing the NITRO_PRESET environment variable at build time. No application code changes are required.
NITRO_PRESET=cloudflare-pages vite build
Deploy the .output/ directory using the Wrangler CLI:
npx wrangler pages deploy .output/public
Cloudflare Workers runs on the V8 isolate runtime. Verify that your database driver supports edge environments — Supabase’s postgres.js driver requires the Node.js compatibility flag on Cloudflare.

Production checklist

Run through this checklist before sending traffic to a new deployment:
1

All environment variables are set

Verify every variable from the reference — particularly BETTER_AUTH_SECRET, BETTER_AUTH_URL, DATABASE_URL, and VITE_SUPABASE_URL — is set in your hosting provider’s environment configuration. Missing variables cause silent runtime failures.
2

Database schema is up to date

Run npx drizzle-kit push against the production database to apply any schema changes included in this deployment. If you use Better Auth’s organization plugin, check the Better Auth changelog for any new columns required by your installed version.
3

BETTER_AUTH_URL matches your domain

The BETTER_AUTH_URL value must exactly match the domain users will access. A mismatch causes OAuth callback failures and broken email verification links. If you use a custom domain, update this variable before pointing DNS.
4

Supabase storage bucket exists

Confirm that an avatars bucket exists in your Supabase project with public read access enabled. If it doesn’t exist, create it in the Supabase dashboard or run the initialization SQL from the storage documentation.
5

Email sending is verified

Send a test email from the Resend dashboard using the domain configured in EMAIL_FROM. Transactional emails including invitations and password resets will fail silently if the sending domain is unverified.
6

OAuth redirect URIs are updated

If you use Google OAuth or any other provider configured in Better Auth, add your production domain to the allowed redirect URIs in the provider’s developer console.