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):
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 mainImport project in Vercel
- Go to vercel.com/new
- Click Import Git Repository
- Select your BloggFast repository
- 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
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 productionDATABASE_URL— production Neon pooled connection stringDATABASE_URL_UNPOOLED— production Neon direct connection stringNEON_AUTH_BASE_URL— from your Neon project Auth tabNEON_AUTH_COOKIE_SECRET— strong random secret for session cookiesNEXT_PUBLIC_SANITY_PROJECT_IDNEXT_PUBLIC_SANITY_DATASETSANITY_API_TOKENOPENAI_API_KEYRESEND_API_KEYandRESEND_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
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:
# Temporarily set DATABASE_URL to production value
DATABASE_URL="postgresql://..." npx prisma migrate deployAlternatively, 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.