Deployment
Deploy your digital garden to Vercel, Netlify, or other platforms
Prerequisites:
Pre-Deployment Checklist
Before deploying, ensure:
-
BETTER_AUTH_SECRETis 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
- Push your code to GitHub
- Import project at vercel.com/new
- Add environment variables in Settings → Environment Variables
- 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
- Go to Settings → Domains
- Add your domain
- Update DNS records as instructed
- Update OAuth redirect URIs to new domain
Netlify
Quick Deploy
- Push your code to GitHub
- Import project at app.netlify.com
- Configure build settings:
- Build command:
pnpm run build - Publish directory:
.output/public
- Build command:
- Add environment variables in Site settings → Environment variables
- 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:
| Provider | Redirect URI |
|---|---|
https://yourdomain.com/auth/google | |
| GitHub | https://yourdomain.com/auth/github |
| Discord | https://yourdomain.com/auth/discord |
| Microsoft | https://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:
- PlanetScale (MySQL)
- Neon (Postgres)
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
- Verify redirect URIs match exactly (including
https://) - Check for trailing slashes
- Ensure environment variables are set correctly
Build failures
- Run
pnpm run buildlocally first - Check for TypeScript errors:
pnpm run typecheck - Verify all dependencies are in
package.json
Monitoring
Consider adding:
- Error tracking (Sentry)
- Analytics (Plausible, Fathom)
- Uptime monitoring (Better Uptime, Pingdom)