Guides
Guides Deployment

Deployment

Deploy your digital garden to Vercel, Netlify, or other platforms

DeploymentIntermediate

Prerequisites:

getting-startedauthentication
DeploymentVercelNetlifyProduction

Pre-Deployment Checklist

Before deploying, ensure:

  • BETTER_AUTH_SECRET is set (32+ characters)
  • OAuth redirect URIs updated to production domain
  • Sensitive content marked as visibility: private
  • Test build locally: pnpm run build

Vercel

Quick Deploy

  1. Push your code to GitHub
  2. Import project at vercel.com/new
  3. Add environment variables in Settings → Environment Variables
  4. Deploy

Environment Variables

Add these in the Vercel dashboard:

BETTER_AUTH_SECRET=your-production-secret-here
NUXT_OAUTH_GOOGLE_CLIENT_ID=...
NUXT_OAUTH_GOOGLE_CLIENT_SECRET=...
# ... other OAuth providers
NUXT_RESEND_API_KEY=...  # If using magic links

Custom Domain

  1. Go to Settings → Domains
  2. Add your domain
  3. Update DNS records as instructed
  4. Update OAuth redirect URIs to new domain

Netlify

Quick Deploy

  1. Push your code to GitHub
  2. Import project at app.netlify.com
  3. Configure build settings:
    • Build command: pnpm run build
    • Publish directory: .output/public
  4. Add environment variables in Site settings → Environment variables
  5. Deploy

Environment Variables

Same as Vercel - add all NUXT_* variables in the Netlify dashboard.

OAuth Redirect URIs

Update all OAuth providers with your production URLs:

ProviderRedirect URI
Googlehttps://yourdomain.com/auth/google
GitHubhttps://yourdomain.com/auth/github
Discordhttps://yourdomain.com/auth/discord
Microsofthttps://yourdomain.com/auth/microsoft

Database Considerations

Local Development

The app uses local SQLite by default (.data/local.db), which requires no setup. This is ideal for:

  • Local development
  • Testing
  • Avoiding corporate proxy issues

Production Deployment

For serverless/edge deployments, you'll need a remote database:

Turso (Recommended - SQLite at the edge)

# Create database
turso db create uxlab

# Get connection details
turso db show uxlab --url
turso db tokens create uxlab

# Set in production environment
TURSO_DATABASE_URL=libsql://your-db-name.turso.io
TURSO_AUTH_TOKEN=your_token_here

Automatic Fallback: If Turso connection fails (certificate errors, corporate proxy), the app automatically falls back to local SQLite with a warning message.

Other options:

Environment-Specific Config

Use different .env files or platform environment variables:

# Development
NUXT_PUBLIC_SITE_URL=http://localhost:3000

# Production (set in platform dashboard)
NUXT_PUBLIC_SITE_URL=https://yourdomain.com

Build Commands

# Production build
pnpm run build

# Preview production build locally
pnpm run preview

# Generate static site (if SSG)
pnpm run generate

Troubleshooting

"Auth secret is required" / sessions fail to sign

Ensure BETTER_AUTH_SECRET (32+ chars) is set in your platform's environment variables.

OAuth redirect errors

  1. Verify redirect URIs match exactly (including https://)
  2. Check for trailing slashes
  3. Ensure environment variables are set correctly

Build failures

  1. Run pnpm run build locally first
  2. Check for TypeScript errors: pnpm run typecheck
  3. Verify all dependencies are in package.json

Monitoring

Consider adding:

  • Error tracking (Sentry)
  • Analytics (Plausible, Fathom)
  • Uptime monitoring (Better Uptime, Pingdom)
  • a: Appearance
  • ?: Keyboard shortcuts