09
Production Deployment
Vercel deploy, env vars, DNS switch, monitoring, go-live
Week 122–3 daysEstimated: 12h totalLaunch
After go-live: what changes immediately
Within 24–48hrs: Google starts indexing. Within 1 week: AI crawlers can read and cite your content. Your site goes from invisible to fully discoverable.
Deployment Steps (in order)
Push Frontend-Next/ to GitHub
Import to Vercel — auto-detected as Next.js
Add all env variables in Vercel
Update Backend CORS — add Vercel URL to allowedOrigins
Test on Vercel preview URL
Switch DNS
Enable Vercel Analytics
Submit sitemap to Search Console
Rollback Plan — If Something Breaks
Document DNS rollback steps — switch A/CNAME records back to old frontend — know the exact values
Keep old Frontend/ deployed as fallback — don't delete the old Vercel/Netlify deployment for at least 1 week
Monitor error rates for 48 hrs post-launch — use Vercel Analytics + Sentry — watch for 500s, auth failures, CORS errors
Test Socket.io reconnection after domain switch — verify real-time notifications still work on new domain
Express — CORS update for Vercel
// In your Express app (e.g., server.js or app.js)
const allowedOrigins = [
'http://localhost:3000', // Local dev
'https://medicare.vercel.app', // Vercel preview
'https://medicare.com', // Production
'https://www.medicare.com', // Production www
]
app.use(cors({
origin: (origin, callback) => {
if (!origin || allowedOrigins.includes(origin)) {
callback(null, true)
} else {
callback(new Error('Not allowed by CORS'))
}
},
credentials: true, // Required for cookies
}))Express — cookie flags for production
// Update your cookie settings for production domain
res.cookie('auth-token', token, {
httpOnly: true,
secure: true, // MUST be true on HTTPS
sameSite: 'lax', // 'lax' for same-domain
domain: '.medicare.com', // Shared across subdomains
maxAge: 7 * 24 * 60 * 60 * 1000,
path: '/',
})DNS propagation takes 1–48 hours. During this window, some users see old site, some see new. Monitor both. Don't delete the old deployment until propagation is complete.