Deploying to Vercel

Step-by-step guide to deploying BloggFast to Vercel from your GitHub repository.

Last updated:

Push code to GitHub

If you haven't already, push your BloggFast project to a GitHub repository (public or private):

bash
git init
git add .
git commit -m "Initial BloggFast setup"
git remote add origin https://github.com/your-username/my-blog.git
git push -u origin main

Import project in Vercel

  1. Go to vercel.com/new
  2. Click Import Git Repository
  3. Select your BloggFast repository
  4. Vercel will auto-detect it as a Next.js project

Set environment variables

Before clicking Deploy, expand the Environment Variables section and add all your production credentials. Copy these from your local .env.local, but use production values (real domain, production DB, production API keys).

Warning

Do not use your local DATABASE_URL for production. Create a separate Neon branch or project for production data, or use the same project with a different database branch.

Key variables to set in Vercel:

  • NEXT_PUBLIC_APP_URL — your production domain (e.g., https://myblog.com)
  • NEXT_PUBLIC_SITE_URL — same as APP_URL for production
  • DATABASE_URL — production Neon pooled connection string
  • DATABASE_URL_UNPOOLED — production Neon direct connection string
  • NEON_AUTH_BASE_URL — from your Neon project Auth tab
  • NEON_AUTH_COOKIE_SECRET — strong random secret for session cookies
  • NEXT_PUBLIC_SANITY_PROJECT_ID
  • NEXT_PUBLIC_SANITY_DATASET
  • SANITY_API_TOKEN
  • OPENAI_API_KEY
  • RESEND_API_KEY and RESEND_FROM_EMAIL

Deploy

Click Deploy. Vercel will build the Next.js app and give you a deployment URL (e.g., my-blog.vercel.app) within 1–3 minutes.

Tip

Every push to the main branch triggers an automatic production deployment. Pull requests get preview deployments on unique URLs — great for testing changes before merging.

Run database migrations

After the first deploy, run Prisma migrations against your production database. You can do this from your local machine using the production DB URL:

bash
# Temporarily set DATABASE_URL to production value
DATABASE_URL="postgresql://..." npx prisma migrate deploy

Alternatively, add prisma migrate deploy to your Vercel build command: npx prisma migrate deploy && next build

Verify the deployment

After deploying, visit your Vercel URL and check:

  • Homepage loads correctly
  • Blog listing page works
  • Sign in / admin dashboard accessible
  • Sanity Studio loads at /studio
  • AI article generator works
  • Email subscription works

See Post-Deploy Checklist for a complete verification guide.