|
| 1 | +# Quick Deployment Reference |
| 2 | + |
| 3 | +## 🚀 Deploy to Vercel in 5 Steps |
| 4 | + |
| 5 | +### 1. Set Environment Variables in Vercel Dashboard |
| 6 | +```bash |
| 7 | +# Required Variables: |
| 8 | +NEXT_PUBLIC_SITE_URL=https://your-project.vercel.app |
| 9 | +DATABASE_URL=<your-postgres-url> |
| 10 | +NEXTAUTH_SECRET=<generate-with: openssl rand -base64 32> |
| 11 | +NEXTAUTH_URL=https://your-project.vercel.app |
| 12 | +ADMIN_EMAIL=admin@yourdomain.com |
| 13 | +ADMIN_PASSWORD=<strong-password> |
| 14 | +GMAIL_USER=your-email@gmail.com |
| 15 | +GMAIL_APP_PASSWORD=<gmail-app-password> |
| 16 | +CLOUDINARY_CLOUD_NAME=<optional> |
| 17 | +CLOUDINARY_API_KEY=<optional> |
| 18 | +CLOUDINARY_API_SECRET=<optional> |
| 19 | +``` |
| 20 | + |
| 21 | +### 2. Run Pre-Deployment Check |
| 22 | +```bash |
| 23 | +cd /path/to/project |
| 24 | +bash scripts/check-deployment-ready.sh |
| 25 | +``` |
| 26 | + |
| 27 | +### 3. Import to Vercel |
| 28 | +- Go to: https://vercel.com/new |
| 29 | +- Import your GitHub repository |
| 30 | +- Framework: Next.js |
| 31 | +- Root Directory: `client` |
| 32 | +- Click "Deploy" |
| 33 | + |
| 34 | +### 4. Configure Database |
| 35 | +**Option A: Vercel Postgres (Recommended)** |
| 36 | +- Dashboard → Storage → Create Database → Postgres |
| 37 | +- Environment variables auto-added |
| 38 | +- Run migrations: `npx prisma migrate deploy` |
| 39 | + |
| 40 | +**Option B: External Postgres** |
| 41 | +- Add `DATABASE_URL` to environment variables |
| 42 | +- Run migrations manually |
| 43 | + |
| 44 | +### 5. Verify Deployment |
| 45 | +```bash |
| 46 | +# Test homepage |
| 47 | +curl https://your-project.vercel.app |
| 48 | + |
| 49 | +# Test API |
| 50 | +curl https://your-project.vercel.app/api/health |
| 51 | + |
| 52 | +# Test SEO |
| 53 | +curl https://your-project.vercel.app/robots.txt |
| 54 | +curl https://your-project.vercel.app/sitemap.xml |
| 55 | +``` |
| 56 | + |
| 57 | +## 📊 Performance Checklist |
| 58 | + |
| 59 | +After deployment: |
| 60 | +- [ ] Run Lighthouse audit (target: 90+ all scores) |
| 61 | +- [ ] Check Vercel Speed Insights dashboard |
| 62 | +- [ ] Verify Vercel Analytics is tracking |
| 63 | +- [ ] Test Core Web Vitals (LCP < 2.5s, FID < 100ms, CLS < 0.1) |
| 64 | +- [ ] Check all routes load correctly |
| 65 | +- [ ] Verify images load in AVIF/WebP formats |
| 66 | +- [ ] Test RSVP form submission |
| 67 | +- [ ] Test admin login |
| 68 | + |
| 69 | +## 🔍 Monitoring URLs |
| 70 | + |
| 71 | +- **Vercel Dashboard**: https://vercel.com/dashboard |
| 72 | +- **Analytics**: https://vercel.com/[your-project]/analytics |
| 73 | +- **Speed Insights**: https://vercel.com/[your-project]/speed-insights |
| 74 | +- **Deployments**: https://vercel.com/[your-project]/deployments |
| 75 | +- **Logs**: https://vercel.com/[your-project]/logs |
| 76 | + |
| 77 | +## 📚 Documentation |
| 78 | + |
| 79 | +| Document | Purpose | |
| 80 | +|----------|---------| |
| 81 | +| `VERCEL_PRODUCTION_GUIDE.md` | Complete deployment walkthrough | |
| 82 | +| `SEO_PERFORMANCE_CHECKLIST.md` | Implementation status & checklist | |
| 83 | +| `VERCEL_OPTIMIZATIONS_SUMMARY.md` | All optimizations summary | |
| 84 | +| `.env.vercel.example` | Environment variable template | |
| 85 | + |
| 86 | +## 🛠️ Useful Commands |
| 87 | + |
| 88 | +```bash |
| 89 | +# Local development |
| 90 | +cd client |
| 91 | +npm install |
| 92 | +npm run dev |
| 93 | + |
| 94 | +# Build test |
| 95 | +npm run build |
| 96 | + |
| 97 | +# Lint check |
| 98 | +npm run lint |
| 99 | + |
| 100 | +# Type check |
| 101 | +npm run type-check |
| 102 | + |
| 103 | +# Performance audit |
| 104 | +npm run lighthouse |
| 105 | + |
| 106 | +# Deploy with Vercel CLI |
| 107 | +npm i -g vercel |
| 108 | +vercel --prod |
| 109 | +``` |
| 110 | + |
| 111 | +## ⚡ Performance Features Enabled |
| 112 | + |
| 113 | +✅ Image Optimization (AVIF/WebP) |
| 114 | +✅ Static Asset Caching (1 year) |
| 115 | +✅ Compression (Brotli/Gzip) |
| 116 | +✅ Code Splitting |
| 117 | +✅ Font Optimization |
| 118 | +✅ Security Headers |
| 119 | +✅ SEO (robots.txt, sitemap, metadata) |
| 120 | +✅ PWA Support (manifest) |
| 121 | +✅ Analytics & Speed Insights |
| 122 | +✅ JSON-LD Structured Data |
| 123 | + |
| 124 | +## 🔐 Security Checklist |
| 125 | + |
| 126 | +- [x] NEXTAUTH_SECRET is strong (32+ chars) |
| 127 | +- [x] Environment variables not in git |
| 128 | +- [x] HTTPS enforced (Vercel automatic) |
| 129 | +- [x] Security headers configured |
| 130 | +- [x] Admin routes protected |
| 131 | +- [x] API validation in place |
| 132 | +- [x] Gmail App Password (not regular password) |
| 133 | +- [x] Database uses SSL |
| 134 | + |
| 135 | +## 📈 Expected Performance |
| 136 | + |
| 137 | +**Lighthouse Scores (Target)** |
| 138 | +- Performance: 90+ |
| 139 | +- Accessibility: 95+ |
| 140 | +- Best Practices: 90+ |
| 141 | +- SEO: 95+ |
| 142 | + |
| 143 | +**Core Web Vitals (Target)** |
| 144 | +- LCP: < 2.5s |
| 145 | +- FID: < 100ms |
| 146 | +- CLS: < 0.1 |
| 147 | + |
| 148 | +**Bundle Sizes** |
| 149 | +- First Load JS: ~102 KB |
| 150 | +- Page JS: 1-6 KB |
| 151 | +- Routes: 37 total |
| 152 | + |
| 153 | +## 🆘 Troubleshooting |
| 154 | + |
| 155 | +**Build fails?** |
| 156 | +- Check environment variables are set |
| 157 | +- Ensure DATABASE_URL is valid |
| 158 | +- Run `npm run build` locally first |
| 159 | + |
| 160 | +**Images not optimizing?** |
| 161 | +- Verify Vercel Image Optimization is enabled |
| 162 | +- Check next.config.ts image configuration |
| 163 | +- Use Next.js `<Image>` component |
| 164 | + |
| 165 | +**Slow performance?** |
| 166 | +- Check Vercel Speed Insights |
| 167 | +- Review Lighthouse recommendations |
| 168 | +- Verify caching headers are set |
| 169 | +- Check database query performance |
| 170 | + |
| 171 | +**SEO issues?** |
| 172 | +- Verify robots.txt is accessible |
| 173 | +- Submit sitemap to Google Search Console |
| 174 | +- Test OpenGraph tags with validator |
| 175 | +- Check meta tags in page source |
| 176 | + |
| 177 | +## 🎉 Success Criteria |
| 178 | + |
| 179 | +Deployment is successful when: |
| 180 | +- ✅ Build completes without errors |
| 181 | +- ✅ All routes are accessible |
| 182 | +- ✅ Lighthouse scores meet targets |
| 183 | +- ✅ Analytics is tracking visitors |
| 184 | +- ✅ RSVP form works |
| 185 | +- ✅ Images load in modern formats |
| 186 | +- ✅ SEO files are accessible |
| 187 | +- ✅ Admin login works |
| 188 | + |
| 189 | +--- |
| 190 | + |
| 191 | +**Need Help?** See `VERCEL_PRODUCTION_GUIDE.md` for detailed instructions. |
0 commit comments