Skip to main content

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

  1. Go to vercel.com/new
  2. Select Import Git Repository
  3. Choose the SuperBox-FE repository
  4. Click Import
Vercel auto-detects Next.js configuration. Verify settings:
string
default:"Next.js"
Automatically detected
string
default:"./"
Keep as root unless using monorepo
string
default:"next build"
Default Next.js build command
string
default:".next"
Next.js output directory
string
default:"npm install"
Dependency installation command
Add all environment variables in the Vercel dashboard:
Environment variables prefixed with NEXT_PUBLIC_ are exposed to the browser. Never include secrets in public variables.
Click Deploy button. Vercel will:
  1. Clone your repository
  2. Install dependencies
  3. Run the build process
  4. Deploy to global CDN
  5. Provide a production URL
Deployment complete! Your app is now live at https://your-project.vercel.app

Method 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

  1. Go to Vercel dashboard
  2. Click Add New > Project
  3. Upload the .next folder
  4. Configure settings
  5. Deploy
Manual deployment is not recommended for production. Use GitHub integration for CI/CD benefits.

Custom Domain Setup

1

Add Domain in Vercel

  1. Go to your project settings
  2. Navigate to Domains tab
  3. Click Add Domain
  4. Enter your domain (e.g., superbox.ai)
2

Configure DNS

Add these DNS records in your domain registrar:
3

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 with vercel.json:
array
Deploy to specific regions for lower latency: - iad1 - Washington, D.C., USA
  • sfo1 - San Francisco, USA - lhr1 - London, UK - hnd1 - Tokyo, Japan

CI/CD Pipeline

Automatic Deployments

Production

Trigger: Push to main branch Automatically deploys to production domain

Preview

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 your next.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

Check Vercel build logs for errors:
Common issues:
  • Missing environment variables
  • TypeScript errors
  • Dependency issues
  • Memory limit exceeded
Ensure variables are:
  1. Added in Vercel dashboard
  2. Assigned to correct environment (Production/Preview/Development)
  3. Prefixed with NEXT_PUBLIC_ if needed in browser
  4. Redeployed after adding
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 configured
Optimize your deployment:
  1. Enable image optimization
  2. Implement code splitting
  3. Use Edge Functions for API routes
  4. Enable ISR (Incremental Static Regeneration)
  5. 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, then select Promote to Production
4

Verify

Check that your production domain now serves the rolled-back version
Vercel keeps all deployments indefinitely, making rollbacks instantaneous with zero downtime.

Next Steps

Backend Deployment

Deploy Python backend

API Documentation

Explore API endpoints

Monitoring

Set up monitoring and alerts

Security

Review security best practices