- GitHub account with SOHAM repository
- Vercel account (free tier works)
- Environment variables ready (from
.env.local)
git add -A
git commit -m "Prepare for Vercel deployment"
git push origin mainThe following files are already configured for Vercel:
- ✅
vercel.json- Vercel configuration - ✅
.vercelignore- Files to exclude from deployment - ✅
next.config.mjs- Next.js configuration - ✅
package.json- Dependencies and scripts
-
Go to Vercel
- Visit: https://vercel.com/
- Click "Sign Up" or "Log In"
- Choose "Continue with GitHub"
-
Import Project
- Click "Add New..." → "Project"
- Select your GitHub repository:
CODEEX-AI- - Click "Import"
-
Configure Project
- Framework Preset: Next.js (auto-detected)
- Root Directory:
./(leave as default) - Build Command:
npm run build(auto-detected) - Output Directory:
.next(auto-detected) - Install Command:
npm install(auto-detected)
-
Add Environment Variables (CRITICAL) Click "Environment Variables" and add:
# Required - Groq API GROQ_API_KEY=gsk_your_groq_api_key_here # Required - Firebase Configuration NEXT_PUBLIC_FIREBASE_API_KEY=AIza_your_firebase_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789 NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789:web:abc123 # Required - App URL (update after deployment) NEXT_PUBLIC_APP_URL=https://your-app.vercel.app # Optional - Additional AI Providers (Fallback Chain) CEREBRAS_API_KEY=csk_your_cerebras_key GOOGLE_API_KEY=AIza_your_google_ai_key HUGGINGFACE_API_KEY=hf_your_huggingface_key # Optional - ElevenLabs TTS (Fallback) NEXT_PUBLIC_ELEVENLABS_API_KEY=your_elevenlabs_key # Optional - Email Service NEXT_PUBLIC_EMAILJS_SERVICE_ID=your_service_id NEXT_PUBLIC_EMAILJS_TEMPLATE_ID=your_template_id NEXT_PUBLIC_EMAILJS_PUBLIC_KEY=your_public_key
-
Deploy
- Click "Deploy"
- Wait 2-3 minutes for build to complete
- You'll get a URL like:
https://soham-ai.vercel.app
-
Update App URL
- Go to Project Settings → Environment Variables
- Update
NEXT_PUBLIC_APP_URLwith your actual Vercel URL - Redeploy: Deployments → ⋯ → Redeploy
# Install Vercel CLI
npm i -g vercel
# Login to Vercel
vercel login
# Deploy to production
vercel --prod
# Follow prompts to link project-
Go to Project Settings
- Select your project
- Go to "Settings" → "Domains"
-
Add Domain
- Enter your domain:
SOHAM.aiorapp.SOHAM.ai - Follow DNS configuration instructions
- Vercel provides automatic HTTPS
- Enter your domain:
-
Update Environment Variables
- Update
NEXT_PUBLIC_APP_URLto your custom domain - Redeploy
- Update
curl https://your-app.vercel.app/api/healthExpected response:
{
"status": "healthy",
"timestamp": "2026-02-28T...",
"environment": "production",
"providers": {
"groq": true,
"cerebras": true,
"google": true
}
}- Homepage loads
- User can sign up/login
- Chat interface works
- AI responds to messages
- TTS works (if enabled)
- Settings save correctly
- Account page accessible
- Open browser DevTools → Console
- Look for any errors
- Verify API calls succeed
- Go to Firebase Console: https://console.firebase.google.com/
- Select your project
- Go to "Authentication" → "Settings" → "Authorized domains"
- Add your Vercel domain:
your-app.vercel.app - If using custom domain, add that too
Your firestore.rules are already configured, but verify they're deployed:
firebase deploy --only firestore:rules- Every push to
mainbranch triggers production deployment - Pull requests get preview deployments
- Rollback to previous deployments anytime
- Set different values for Production, Preview, Development
- Encrypted and secure
- Never exposed in client-side code (except NEXT_PUBLIC_*)
- API routes run on Vercel Edge Network
- Low latency worldwide
- Automatic scaling
- Enable Vercel Analytics in project settings
- Track page views, performance, Web Vitals
- Free tier includes basic analytics
Error: Module not found or Cannot find module
# Clear cache and rebuild locally
rm -rf .next node_modules
npm install
npm run buildError: Type errors in production build
# Run typecheck locally
npm run typecheck
# Fix any errors before deploying- Verify variables are set in Vercel dashboard
- Check variable names match exactly (case-sensitive)
- Redeploy after adding/changing variables
- Remember: Only
NEXT_PUBLIC_*variables are available client-side
- Vercel free tier: 10s timeout
- Vercel Pro: 60s timeout (configured in
vercel.json) - Consider upgrading if AI responses take longer
- Verify domain is authorized in Firebase Console
- Check Firebase config variables are correct
- Ensure
NEXT_PUBLIC_APP_URLmatches deployment URL
- Verify
GROQ_API_KEYis set - Check API route:
/api/tts - Look for errors in Vercel Function Logs
- Fallback to Edge TTS or Browser TTS should work
npm install @vercel/speed-insightsAdd to src/app/layout.tsx:
import { SpeedInsights } from '@vercel/speed-insights/next';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<SpeedInsights />
</body>
</html>
);
}Already configured in next.config.mjs:
images: {
domains: ['firebasestorage.googleapis.com'],
formats: ['image/avif', 'image/webp'],
}Vercel automatically compresses responses with Brotli/Gzip
- Go to Vercel Dashboard
- Select your project
- Go to "Deployments" → Select deployment
- Click "Functions" tab
- View logs for each API route
vercel logs --followConsider integrating:
- Sentry: https://sentry.io/
- LogRocket: https://logrocket.com/
- Datadog: https://www.datadoghq.com/
- ✅ 100 GB bandwidth/month
- ✅ Unlimited deployments
- ✅ Automatic HTTPS
- ✅ Edge Network
⚠️ 10s function timeout⚠️ 1 concurrent build
- ✅ 1 TB bandwidth/month
- ✅ 60s function timeout
- ✅ 12 concurrent builds
- ✅ Team collaboration
- ✅ Advanced analytics
Recommendation: Start with Free tier, upgrade if needed
| Feature | Vercel | Netlify |
|---|---|---|
| Next.js Support | ⭐⭐⭐⭐⭐ Native | ⭐⭐⭐⭐ Plugin |
| Build Speed | Fast | Fast |
| Edge Functions | Yes | Yes |
| Free Tier Bandwidth | 100 GB | 100 GB |
| Function Timeout (Free) | 10s | 10s |
| Function Timeout (Paid) | 60s | 26s |
| Custom Domains | Free | Free |
| Analytics | Built-in | Built-in |
| Preview Deployments | Yes | Yes |
Verdict: Vercel is optimized for Next.js (created by same team)
- Environment variables encrypted
- API keys not in code
- HTTPS enabled automatically
- Security headers configured
- Firebase rules properly set
- CORS configured for API routes
- XSS protection enabled
- Content Security Policy headers
- Update README.md with production URL
- Update API documentation
- Share deployment URL with team
- Enable Vercel Analytics
- Set up error tracking
- Configure uptime monitoring
Share with your testing team:
- Vidhan, Avineet, Vansh, Aayush
- Varun, Pankaj, Masum, Sachin
- Pardhuman, Shivansh, Vaibhav, Kartik
- Submit sitemap to Google Search Console
- Verify domain ownership
- Set up Google Analytics (optional)
- Docs: https://vercel.com/docs
- Next.js on Vercel: https://vercel.com/docs/frameworks/nextjs
- Environment Variables: https://vercel.com/docs/environment-variables
- Vercel Discord: https://vercel.com/discord
- Next.js Discord: https://nextjs.org/discord
- GitHub Discussions: https://github.com/vercel/next.js/discussions
- Vercel Support: support@vercel.com
- Next.js Issues: https://github.com/vercel/next.js/issues
# Deploy to production
vercel --prod
# Deploy to preview
vercel
# View logs
vercel logs
# List deployments
vercel ls
# Rollback to previous deployment
vercel rollback
# Pull environment variables
vercel env pull
# Add environment variable
vercel env add VARIABLE_NAME
# Remove deployment
vercel rm deployment-urlLast Updated: February 28, 2026 Vercel Version: Latest Next.js Version: 14.x
Ready to deploy? Follow Step 2 above! 🚀