Just run the game! Everything works with smart fallbacks.
npm run devVisit: http://localhost:5174/
- Visit: https://aistudio.google.com/app/apikey
- Sign in with Google
- Click "Create API key"
- Copy the key (starts with
AIza...)
Open frontend/.env and change this line:
# Before:
# VITE_GEMINI_API_KEY=your-gemini-api-key-here
# After (paste your actual key):
VITE_GEMINI_API_KEY= your api key# Press Ctrl+C to stop
# Then restart:
npm run devLook in browser console for:
🤖 Gemini AI: Connected ✅
AI-powered weather and market features enabled!
| Feature | Without API Key | With API Key |
|---|---|---|
| Weather Advisory | ✅ Smart simulation | ✅ Real AI analysis |
| Market Prices | ✅ Seasonal variation | ✅ Context-aware AI |
| Farming Tips | ✅ Pre-written advice | ✅ Dynamic recommendations |
| Game Playability | ✅ 100% Functional | ✅ Enhanced Experience |
Bottom line: The game is fully playable either way!
HarvestHope/
├── frontend/
│ ├── .env ← ADD YOUR API KEY HERE
│ ├── API_SETUP.md ← Detailed guide
│ └── QUICK_START.md ← This file
YES! Google Gemini offers:
- ✅ 60 requests/minute
- ✅ 1,500 requests/day
- ✅ 1 million tokens/month
- ✅ No credit card required
Harvest Hope uses caching, so you'll barely use any quota!
Open browser DevTools (F12) and look for:
- ❌ "API key not configured" → Add key to
.env - ❌ "API error: 400" → Invalid key, check for typos
- ✅ "Gemini AI: Connected" → Working perfectly!
- Forgot to restart server → Press Ctrl+C, then
npm run dev - Extra spaces in key → Make sure no spaces before/after key
- Didn't uncomment line → Remove the
#at start of line
Start playing immediately without API key, then add it later if you want the enhanced AI features. The game is designed to work great either way!
Need more help? See API_SETUP.md for detailed instructions.
Ready to play? Run npm run dev and visit http://localhost:5174/
Happy farming! 🌾🚜