Deployment
Deployment
Section titled “Deployment”Introduction
Section titled “Introduction”Deploying a dashboard is more involved than a static site. You need a database, environment variables for auth, and proper session configuration.
Database Setup
Section titled “Database Setup”# 1. Push schema to production databasenpx prisma migrate deploy
# 2. (Optional) If using Vercel Postgres# Create database in Vercel dashboard, thennpx prisma db pushEnvironment Variables
Section titled “Environment Variables”Add these to your Vercel project:
AUTH_SECRET=your_generated_secretAUTH_URL=https://yourdomain.comGOOGLE_CLIENT_ID=your_google_idGOOGLE_CLIENT_SECRET=your_google_secretDATABASE_URL=your_production_db_urlGenerate AUTH_SECRET:
npx auth secretAuth Configuration
Section titled “Auth Configuration”For Google OAuth to work in production, add the callback URL to your Google Cloud Console:
https://yourdomain.com/api/auth/callback/googleDeployment Checklist
Section titled “Deployment Checklist”- Database migrations have run
- Environment variables are configured
- Google OAuth callback URL is updated
- Session cookies use Secure flag in production
- Protected routes redirect to login when unauthenticated
- API routes check for authentication
- Loading states work correctly
- Charts render with real data
Summary
Section titled “Summary”Deploying an authenticated dashboard requires database setup, environment variables, and OAuth configuration. Run migrations, configure auth callbacks, and test the full login flow after deployment.