Vercel Deployment
Deploy the Developer Dashboard to Vercel.
Prerequisites
- Vercel account (vercel.com)
- Firebase configuration ready
- Dashboard repository cloned
Deploy via Vercel Dashboard
1. Import Project
- Go to Vercel Dashboard
- Click Add New → Project
- Import from GitHub (connect if needed)
- Select the dashboard repository
2. Configure Build Settings
Vercel auto-detects Next.js. Verify:
| Setting | Value |
|---|---|
| Framework Preset | Next.js |
| Root Directory | . (or subdirectory if monorepo) |
| Build Command | pnpm build |
| Output Directory | .next |
3. Add Environment Variables
Add each variable:
| Variable | Value |
|---|---|
NEXT_PUBLIC_FIREBASE_API_KEY | Your Firebase API key |
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN | your-project.firebaseapp.com |
NEXT_PUBLIC_FIREBASE_PROJECT_ID | Your Firebase project ID |
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET | your-project.appspot.com |
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID | Your sender ID |
NEXT_PUBLIC_FIREBASE_APP_ID | Your app ID |
NEXT_PUBLIC_USE_AUTH | true |
4. Deploy
Click Deploy and wait for build to complete.
Deploy via CLI
Install Vercel CLI
bash
npm install -g vercelLogin
bash
vercel loginDeploy
From the dashboard directory:
bash
# First deployment (interactive)
vercel
# Follow prompts:
# - Set up and deploy? Yes
# - Which scope? Your account
# - Link to existing project? No
# - Project name? scry-dashboard
# - Directory? ./
# - Override settings? NoAdd Environment Variables
bash
# Add each variable
vercel env add NEXT_PUBLIC_FIREBASE_API_KEY
# Select environments (Production, Preview, Development)
# Enter value
# Or add from file
vercel env pull .env.local # Pull existing
vercel env push .env.local # Push to VercelProduction Deployment
bash
vercel --prodCustom Domain
Add Domain in Vercel
- Go to Project Settings → Domains
- Enter your domain:
dashboard.yourdomain.com - Click Add
Configure DNS
Add the DNS record as instructed:
Option 1: CNAME (Subdomain)
| Type | Name | Value |
|---|---|---|
| CNAME | dashboard | cname.vercel-dns.com |
Option 2: A Record (Apex domain)
| Type | Name | Value |
|---|---|---|
| A | @ | 76.76.21.21 |
Verify Domain
- Wait for DNS propagation (may take a few minutes)
- Vercel will automatically provision SSL
- Access your dashboard at the custom domain
Update Firebase Authorized Domains
Add your Vercel domains to Firebase:
- Go to Firebase Console → Authentication → Settings
- Under Authorized domains, add:
your-project.vercel.appdashboard.yourdomain.com
Environment Configuration
Production vs Preview
Vercel supports different environments:
| Environment | Branch | Purpose |
|---|---|---|
| Production | main | Live site |
| Preview | Other branches | PR previews |
| Development | Local | vercel dev |
Set environment-specific variables:
bash
# Production only
vercel env add NEXT_PUBLIC_USE_AUTH production
# Enter: true
# Preview (for testing without auth)
vercel env add NEXT_PUBLIC_USE_AUTH preview
# Enter: falseSecure Variables
For sensitive values (not NEXT_PUBLIC_), use encrypted environment variables. These are not exposed to the browser.
Automatic Deployments
GitHub Integration
Vercel automatically deploys when you push:
- Production: Push to
mainbranch - Preview: Push to any other branch or open PR
Configure in Vercel
- Go to Project Settings → Git
- Configure:
- Production Branch:
main - Deploy on push: Enabled
- Preview deployments: Enabled
- Production Branch:
Monitoring
Vercel Analytics
Enable in Project Settings → Analytics:
- Page views
- Web Vitals
- Real-time visitors
Logs
View deployment logs:
- Go to Deployments
- Select a deployment
- View Functions and Build logs
Alerts
Configure alerts in Settings → Notifications:
- Deployment failures
- Domain issues
- Usage warnings
Alternative Hosting
Railway
bash
# Install CLI
npm install -g @railway/cli
# Login
railway login
# Initialize
railway init
# Deploy
railway upRender
- Connect GitHub repository
- Create new Web Service
- Configure build command:
pnpm build - Configure start command:
pnpm start - Add environment variables
- Deploy
Docker (Self-hosted)
dockerfile
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
FROM node:20-alpine AS runner
WORKDIR /app
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]Build and run:
bash
docker build -t scry-dashboard .
docker run -p 3000:3000 --env-file .env.local scry-dashboardTroubleshooting
"Build failed"
- Check build logs for errors
- Verify all environment variables are set
- Ensure
pnpm-lock.yamlis committed
"Firebase auth not working"
- Add Vercel domain to Firebase authorized domains
- Check environment variables are set correctly
- Verify GitHub OAuth callback URL includes Vercel domain
"Page not found (404)"
- Ensure
next.config.jsis configured correctly - Check for trailing slashes in routes
- Verify pages exist in
app/directory
"Environment variables undefined"
- Variables must start with
NEXT_PUBLIC_to be available in browser - Redeploy after adding new variables
- Check variable names for typos
Next Steps
- Complete Setup - Full deployment guide
- Monitoring - Set up observability
- Firebase Config - Firebase details