Your Netlify deployment is building successfully, but the AI service is unavailable because environment variables are not configured in Netlify. The .env.local file is gitignored (as it should be for security), so Netlify doesn't have access to your API keys.
- Go to Netlify Dashboard
- Select your site: codeex-ai
- Navigate to: Site settings → Environment variables
GROQ_API_KEY=gsk_your_actual_groq_api_key_here
Without this, AI responses will not work at all.
NEXT_PUBLIC_FIREBASE_API_KEY=AIza_your_actual_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.firebasestorage.app
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789012
NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789012:web:abcdef123456
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX
Without these, authentication and data storage will not work.
NEXT_PUBLIC_APP_URL=https://codeex-ai.netlify.app
CEREBRAS_API_KEY=csk_your_cerebras_api_key_here
GOOGLE_API_KEY=AIza_your_google_api_key_here
HUGGINGFACE_API_KEY=hf_your_huggingface_token_here
These enable the fallback chain: Groq → Cerebras → Google → HuggingFace
ENABLE_SAFETY_GUARD=true
ENABLE_MEMORY_SYSTEM=false
NEXT_PUBLIC_EMAILJS_SERVICE_ID=service_xxxxxxx
NEXT_PUBLIC_EMAILJS_TEMPLATE_ID=template_xxxxxxx
NEXT_PUBLIC_EMAILJS_WELCOME_TEMPLATE_ID=template_xxxxxxx
NEXT_PUBLIC_EMAILJS_USER_ID=user_xxxxxxxxxxxxxxxxxxxx
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
Option A: Using the UI
- Click Add a variable or Add a single variable
- Enter the Key (e.g.,
GROQ_API_KEY) - Enter the Value (your actual API key)
- Select scope: All scopes (or specific deploy contexts)
- Click Create variable
- Repeat for each variable
Option B: Using Netlify CLI
netlify env:set GROQ_API_KEY "gsk_your_actual_key_here"
netlify env:set NEXT_PUBLIC_FIREBASE_API_KEY "AIza_your_actual_key"
# ... repeat for each variableYour local .env.local file already has the correct values. Copy them from there:
Windows PowerShell:
Get-Content .env.localWindows CMD:
type .env.localGit Bash:
cat .env.local- Groq API Key: https://console.groq.com/keys
- Firebase Config: https://console.firebase.google.com/ → Project Settings → General → Your apps
- Cerebras API Key: https://cloud.cerebras.ai/
- Google AI API Key: https://aistudio.google.com/app/apikey
- HuggingFace Token: https://huggingface.co/settings/tokens
After adding all environment variables:
Option A: Using Netlify UI
- Go to Deploys tab
- Click Trigger deploy → Deploy site
Option B: Push a Small Change
git commit --allow-empty -m "Trigger rebuild with env vars"
git push origin mainOption C: Using Netlify CLI
netlify deploy --prod- Wait for deployment to complete (2-3 minutes)
- Visit: https://codeex-ai.netlify.app
- Try sending a message to the AI
- Check health endpoint: https://codeex-ai.netlify.app/api/health
- Check browser console for errors (F12)
- Verify all NEXT_PUBLIC_* variables are set correctly
- Verify GROQ_API_KEY is valid and has quota remaining
- Check Netlify function logs: Deploys → Latest deploy → Function logs
- Verify all NEXT_PUBLIC_FIREBASE_* variables are correct
- Check Firebase Console → Authentication → Sign-in method
- Ensure your Netlify domain is added to Firebase authorized domains
- Check build logs in Netlify dashboard
- Ensure all required variables are set
- Try clearing cache: Site settings → Build & deploy → Clear cache and retry deploy
- ✅ NEXT_PUBLIC_* variables are safe to expose (they're in client-side code)
- ✅ API keys are server-side only and not exposed to clients
- ✅ Never commit
.env.localto git (already in.gitignore) - ✅ Rotate API keys regularly
- ✅ Use different keys for development and production if possible
With all providers configured, your app will automatically fallback:
- Groq (Primary - Fast, free tier)
- Cerebras (Fallback 1 - Ultra-fast inference)
- Google Gemini (Fallback 2 - Reliable, good free tier)
- HuggingFace (Fallback 3 - Open source models)
- ✅ Add environment variables to Netlify (see steps above)
- ✅ Trigger new deployment
- ✅ Test AI responses on production site
- ✅ Share with your friends: Vidhan, Avineet, Vansh, Aayush, Varun, Pankaj, Masum, Sachin, Pardhuman, Shivansh, Vaibhav, Kartik
Need Help?
- Netlify Docs: https://docs.netlify.com/environment-variables/overview/
- Firebase Docs: https://firebase.google.com/docs/web/setup
- Groq Docs: https://console.groq.com/docs