We use cookies to enhance your experience on the site
CodeWorlds

Deployment - Vercel/Netlify

Deploying a Next.js app to production.

Vercel Deployment 🚀

1. GitHub Integration

  1. Push your code to GitHub
  2. Go to vercel.com
  3. Import GitHub repository
  4. Click Deploy

2. Environment Variables

In Vercel dashboard → Settings → Environment Variables:

1DATABASE_URL=your_db_url
2OPENAI_API_KEY=your_key
3NEXTAUTH_SECRET=your_secret

3. Custom Domain

Settings → Domains → Add domain → Verify DNS

CLI Deployment 💻

1npm i -g vercel
2vercel login
3vercel

Build Optimization 📦

1// next.config.js
2module.exports = {
3  images: {
4    domains: ['yourdomain.com'],
5    formats: ['image/avif', 'image/webp']
6  },
7  compress: true,
8  poweredByHeader: false
9}

See you soon! 🚀

Go to CodeWorlds