Skip to main content

Vercel Deployment

Deploy the SHIELD frontend to Vercel’s edge network.

Prerequisites

  • Vercel account
  • Project connected to GitHub
  • Environment variables ready

Deployment Steps

1. Connect Repository

  1. Go to Vercel Dashboard
  2. Click “Add New Project”
  3. Import your SHIELD repository
  4. Select the frontend directory as root

2. Configure Project

Build Settings:
SettingValue
FrameworkNext.js
Root Directoryfrontend
Build Commandnpm run build
Output Directory.next
Install Commandnpm install

3. Environment Variables

Add in Project Settings → Environment Variables:
DATABASE_URL=postgresql://...
PINATA_JWT=eyJ...
PINATA_GATEWAY_URL=https://...
NEXT_PUBLIC_SHIELD_CONTRACT_BASE=0x...
NEXT_PUBLIC_SHIELD_CONTRACT_BASE_SEPOLIA=0x...
ALCHEMY_API_KEY=...
NEXT_PUBLIC_WC_PROJECT_ID=...
SESSION_SECRET=...
NEXT_PUBLIC_APP_URL=https://app.shieldhq.xyz
Mark as Production for main deployment.

4. Deploy

Click “Deploy”. Vercel will:
  1. Install dependencies
  2. Run build
  3. Deploy to edge

5. Custom Domain

  1. Go to Project Settings → Domains
  2. Add app.shieldhq.xyz
  3. Configure DNS:
    • Type: CNAME
    • Name: app
    • Value: cname.vercel-dns.com

6. Preview Deployments

Every PR gets a preview deployment at:
https://shield-git-branch-name-username.vercel.app

Production Checklist

  • Environment variables set
  • Database accessible from Vercel IPs
  • Contract addresses correct
  • Custom domain configured
  • Analytics enabled
  • Rate limiting configured
  • Security headers set

Vercel.json Configuration

Create frontend/vercel.json:
{
  "headers": [
    {
      "source": "/(.*)",
      "headers": [
        {
          "key": "X-Frame-Options",
          "value": "DENY"
        },
        {
          "key": "X-Content-Type-Options",
          "value": "nosniff"
        },
        {
          "key": "Referrer-Policy",
          "value": "strict-origin-when-cross-origin"
        }
      ]
    }
  ],
  "functions": {
    "app/api/**/*.ts": {
      "maxDuration": 30
    }
  }
}

Monitoring

Enable in Vercel Dashboard:
  • Analytics
  • Speed Insights
  • Logs
  • Alerts

Troubleshooting

IssueSolution
Build failsCheck Node version (18+)
DB connection failsWhitelist Vercel IPs
404 on routesCheck next.config.mjs
Slow cold startsOptimize API routes