Vercel Deployment
SuperBox frontend is optimized for deployment on Vercel, the platform built by the creators of Next.js.Vercel provides zero-configuration deployment, automatic HTTPS, global CDN,
and instant rollbacks.
Prerequisites
1
Create Vercel Account
Sign up at vercel.com using your GitHub account for seamless integration.
2
Install Vercel CLI (Optional)
For local testing and deployment:
3
Prepare Environment Variables
Ensure all required environment variables are documented and ready.
Deployment Methods
Method 1: GitHub Integration (Recommended)
Step 1: Connect Repository
Step 1: Connect Repository
- Go to vercel.com/new
- Select Import Git Repository
- Choose the
SuperBox-FErepository - Click Import
Step 2: Configure Project
Step 2: Configure Project
Vercel auto-detects Next.js configuration. Verify settings:
Automatically detected
Keep as root unless using monorepo
Default Next.js build command
Next.js output directory
Dependency installation command
Step 3: Add Environment Variables
Step 3: Add Environment Variables
Add all environment variables in the Vercel dashboard:
Step 4: Deploy
Step 4: Deploy
Click Deploy button. Vercel will:
- Clone your repository
- Install dependencies
- Run the build process
- Deploy to global CDN
- Provide a production URL
Deployment complete! Your app is now live at
https://your-project.vercel.appMethod 2: Vercel CLI
Deploy directly from your terminal:Method 3: Manual Deployment
Upload your built application manually:1
Build Locally
2
Test Production Build
3
Deploy via Dashboard
- Go to Vercel dashboard
- Click Add New > Project
- Upload the
.nextfolder - Configure settings
- Deploy
Custom Domain Setup
1
Add Domain in Vercel
- Go to your project settings
- Navigate to Domains tab
- Click Add Domain
- Enter your domain (e.g.,
superbox.ai)
2
Configure DNS
Add these DNS records in your domain registrar:
- Apex Domain
- www Subdomain
- API Subdomain
Type: A Name: @ Value: 76.76.21.21 TTL: 36003
Verify Domain
Vercel automatically verifies DNS configuration and provisions SSL
certificates.
HTTPS is automatically enabled for all domains with Let’s Encrypt
certificates.
4
Update Environment Variables
Update
NEXTAUTH_URL to your custom domain:Deployment Configuration
vercel.json
Customize deployment behavior withvercel.json:
Deploy to specific regions for lower latency: -
iad1 - Washington, D.C., USAsfo1- San Francisco, USA -lhr1- London, UK -hnd1- Tokyo, Japan
CI/CD Pipeline
Automatic Deployments
Production
Trigger: Push to
main branch Automatically deploys to production
domainPreview
Trigger: Pull requests & other branches Creates unique preview URLs for
testing
Branch Configuration
Deployment Protection
Enable deployment protection in Vercel settings:Require Approval - Manual approval for production deployments
Protected Branches - Only main branch deploys to production
Build Checks - Block deployment if build fails
Preview Comments - Automatic PR comments with preview URLs
Performance Optimization
Next.js Configuration
Optimize yournext.config.mjs for production:
Edge Functions
Use Vercel Edge Functions for ultra-low latency:Caching Strategy
Implement intelligent caching:Monitoring & Analytics
Vercel Analytics
Enable built-in analytics:Web Vitals
Monitor Core Web Vitals:LCP
Target: < 2.5sLargest Contentful Paint
FID
Target: < 100msFirst Input Delay
CLS
Target: < 0.1Cumulative Layout Shift
Troubleshooting
Build Failures
Build Failures
Check Vercel build logs for errors:Common issues:
- Missing environment variables
- TypeScript errors
- Dependency issues
- Memory limit exceeded
Environment Variables Not Working
Environment Variables Not Working
Ensure variables are:
- Added in Vercel dashboard
- Assigned to correct environment (Production/Preview/Development)
- Prefixed with
NEXT_PUBLIC_if needed in browser - Redeployed after adding
404 Errors on Refresh
404 Errors on Refresh
Vercel automatically handles Next.js routing. If you see 404s: 1. Verify
next.config.mjs is correct 2. Check file structure matches Next.js
conventions 3. Ensure dynamic routes are properly configuredSlow Performance
Slow Performance
Optimize your deployment:
- Enable image optimization
- Implement code splitting
- Use Edge Functions for API routes
- Enable ISR (Incremental Static Regeneration)
- Add proper caching headers
Rollback Strategy
1
View Deployments
Go to your project dashboard and click Deployments tab
2
Select Previous Version
Find the working deployment you want to restore
3
Promote to Production
Click the ⋯ menu → Promote to Production
4
Verify
Check that your production domain now serves the rolled-back version