An AI-powered farming simulation game showcasing the challenges and resilience of Indian agriculture
Harvest Hope is an immersive farming simulation that combines engaging gameplay with real-world agricultural education. Players experience the complexities of Indian farming while learning about crop cycles, financial management, and government support systems.
This project demonstrates advanced AI integration, modern web development practices, and educational gaming concepts - perfect for the Kiro weekly challenge.
- ๐ฆ๏ธ Weather Predictions: 3-day forecasts using Google Gemini AI
- ๐น Market Analysis: Dynamic crop pricing based on seasonal demand
- ๐ก Farming Tips: Contextual agricultural advice for each crop and season
- ๐ฅ NPC Stories: AI-generated farmer narratives highlighting real challenges
- ๐ 25-Tile Farm: Interactive crop planting and harvesting system
- ๐พ 4 Crop Types: Rice, wheat, cotton, sugarcane with realistic growth cycles
- ๐ฐ Financial System: Loans, EMIs, credit scores, and government schemes
- ๐ Seasonal Farming: Kharif, Rabi, Zaid seasons with appropriate crops
- ๐ฎ๐ณ Real Agriculture: Authentic Indian farming practices and challenges
- ๐๏ธ Government Schemes: PM-KISAN, Fasal Bima, Kisan Credit Card integration
- ๐ณ Financial Literacy: Understanding agricultural loans and MSP systems
โ ๏ธ Crisis Awareness: Learning about farmer difficulties and solutions
- Node.js 18+
- npm 9+
- Google Gemini API key (optional - game works without it!)
# Clone the repository
git clone https://github.com/stealthwhizz/harvest-hope.git
cd harvest-hope
# Install dependencies
cd frontend
npm install
# Set up environment (optional for AI features)
cp .env.example .env
# Add your Gemini API key to .env (see docs/API_SETUP.md)
# Start the game
npm run dev๐ฎ Play at: http://localhost:5174
- Plant Crops: Click empty farm tiles to plant selected crops (โน1,000 each)
- Wait & Watch: Crops grow over 9-30 days with visual progress indicators
- Harvest: Click golden glowing crops when ready to harvest
- Sell: Use inventory to sell crops at current market prices
- Manage Finances: Apply for loans, pay EMIs, maintain good credit score
- Use AI Features: Check weather forecasts, market prices, and meet other farmers
| Button | Function | Description |
|---|---|---|
| โฉ ADVANCE DAY | Progress time | Advance 1 day, grow crops, process EMIs |
| โญ๏ธ SKIP MONTH | Fast-forward | Jump 30 days with automatic processing |
| ๐ฆ๏ธ WEATHER | AI Forecast | 3-day weather prediction and farming tips |
| ๐ช MARKET | Price Analysis | Current crop prices and market trends |
| ๐ฅ FARMERS | NPC Stories | Meet AI-generated farmers with real stories |
| ๐ณ LOANS | Financial Services | Apply for agricultural loans |
| ๐ SCHEMES | Government Support | Apply for support programs |
- Starting Capital: โน1,00,000 (realistic farmer budget)
- Loan Types: Bank KCC (7%), Government (4%), Moneylender (36%)
- Credit Score: 300-850 range affects loan eligibility
- EMI System: Automatic monthly payments every 30 days
- Government Schemes: Real programs providing financial support
- ๐ฏ Contextual Predictions: AI considers your crops, season, money, and game progress
- ๐ Educational Content: Real agricultural knowledge and farming practices
- ๐ Dynamic Stories: Unique farmer narratives based on current game state
- ๐ก๏ธ Intelligent Fallbacks: Game works perfectly even without API access
- Get API Key: Visit https://aistudio.google.com/app/apikey
- Configure: Add to
frontend/.env:VITE_GEMINI_API_KEY=your_key_here - Restart: Restart development server
- Verify: Look for "๐ค AI POWERED" badges in game
๐ Full Setup Guide: docs/API_SETUP.md
- โ๏ธ React 18 + ๐ TypeScript - Modern component framework with type safety
- โก Vite - Lightning-fast build tool and development server
- ๐จ CSS3 - Retro green-on-black terminal aesthetic with animations
- ๐พ LocalStorage - Persistent game state with automatic saving
- ๐ค Google Generative AI SDK - Official Gemini AI integration
- ๐ Smart Caching - Reduces API calls by 70% through intelligent caching
- ๐ก๏ธ Graceful Fallbacks - Intelligent simulation when AI unavailable
- ๐ Rate Limit Management - Stays within free tier limits (1,500 requests/day)
- ๐ GitHub Pages - Free static hosting with automatic deployments
- โก GitHub Actions - Automated build and deployment pipeline
- ๐๏ธ Production Optimized - Code splitting and asset optimization
- ๐ฆ CDN Delivery - Global content delivery through GitHub's infrastructure
- ๐ Realistic Crop Cycles: Season-appropriate planting and harvesting windows
- ๐ Growth Visualization: Watch crops develop from seedling to harvestable with progress bars
- ๐ฒ Yield Variation: 80-120% of base yield based on realistic agricultural factors
- ๐ Market Dynamics: Prices fluctuate based on seasonal demand and MSP floors
- ๐ฆ Multiple Loan Sources: Bank KCC, Government schemes, Private moneylenders
- ๐ Dynamic Interest Rates: 4% (government) to 36% (moneylender) annual rates
- ๐ฏ Credit Score System: 300-850 range based on payment history and defaults
- ๐ณ EMI Management: Automatic monthly payments with penalties for missed payments
- ๐๏ธ Government Integration: Real schemes like PM-KISAN (โน6,000/year) and Fasal Bima
- ๐ Agricultural Knowledge: Learn about Indian farming seasons, monsoons, and practices
- ๐ก Financial Literacy: Understand loans, interest rates, credit scores, and MSP
- ๐๏ธ Government Programs: Discover real support schemes available to farmers
โ ๏ธ Crisis Awareness: Experience and understand challenges faced by Indian farmers
- ๐ป Terminal-Inspired UI: Classic green text on black background
- ๐ฏ Pixel-Perfect Design: Clean, readable interface with attention to detail
- โจ Smooth Animations: Satisfying crop growth transitions and UI feedback
- โฟ Accessibility: High contrast design and clear typography for all users
- ๐ฎ Learn by Doing: Discover agricultural concepts through interactive gameplay
- ๐ Real-World Context: Authentic Indian agricultural scenarios and challenges
- โ๏ธ Balanced Challenge: Engaging gameplay without overwhelming complexity
- ๐ Cultural Sensitivity: Respectful portrayal of farmer struggles and resilience
- โก Optimized Builds: Vite production optimization with automatic code splitting
- ๐ Fast Loading: < 2 second initial load time with optimized assets
- ๐ง Efficient Caching: Smart API response caching reduces redundant calls
- ๐ก๏ธ Error Handling: Comprehensive error recovery and graceful fallbacks
- ๐ Static Hosting: GitHub Pages provides reliable, scalable hosting
- ๐ CDN Distribution: Global asset delivery through GitHub's infrastructure
- ๐ป Client-Side Logic: All game logic runs in browser for better performance
- ๐ Stateless Design: No server dependencies for maximum reliability
# TypeScript type checking
npm run type-check
# Production build verification
npm run build
# Preview production build locally
npm run preview
# Development build with type checking
npm run build:dev- ๐ฑ Core Gameplay: Plant, grow, and harvest crops successfully
- ๐ฐ Financial Operations: Loans, EMI payments, and credit score changes
- ๐ค AI Features: Weather predictions, market analysis, and NPC stories
- ๐พ State Persistence: Game saves and loads correctly across sessions
- ๐ก๏ธ Error Handling: Graceful fallbacks when APIs are unavailable
- ๐ Bundle Size: ~85KB gzipped (optimized for fast loading)
- โก Performance: Lighthouse score 95+ (Performance, Accessibility, SEO)
- ๐ Security: No exposed API keys, proper input validation
- โฟ Accessibility: WCAG 2.1 AA compliance with high contrast design
| Document | Description | Audience |
|---|---|---|
| ๐๏ธ Architecture Guide | System design and technical architecture | Developers, Architects |
| ๐ฎ Game Features | Complete gameplay feature documentation | Players, Designers |
| ๐ ๏ธ Development Guide | Setup, workflow, and contribution guide | Contributors, Developers |
| ๐ API Setup | Google Gemini AI configuration guide | Users, Developers |
| ๐ Quick Start | Get up and running in 5 minutes | New Users |
| โ๏ธ Deployment | Production deployment instructions | DevOps, Developers |
| ๐ค AI Fixes | Recent AI system improvements | Technical Users |
| ๐๏ธ Backend Weather | Weather service documentation | Backend Developers |
| โ๏ธ Frontend Guide | Frontend-specific documentation | Frontend Developers |
- ๐ GitHub Pages (recommended) - Free static hosting with automatic deployments
- โก Vercel - Zero-configuration deployment with automatic optimizations
- ๐ Netlify - Drag-and-drop deployment with form handling
# Create optimized production build
npm run build
# Output details:
# - Total bundle size: ~85KB gzipped
# - Automatic code splitting for optimal loading
# - Asset optimization and minification
# - Source maps for debugging (optional)
# Preview production build locally
npm run preview# Development (.env)
VITE_GEMINI_API_KEY=your_development_key
VITE_NODE_ENV=development
VITE_ENABLE_DEBUG_LOGGING=true
# Production (.env.production)
VITE_GEMINI_API_KEY=your_production_key
VITE_NODE_ENV=production
VITE_ENABLE_DEBUG_LOGGING=falseWe welcome contributions from developers of all skill levels!
# 1. Fork the repository on GitHub
# 2. Clone your fork locally
git clone https://github.com/stealthwhizz/harvest-hope.git
cd harvest-hope
# 3. Create a feature branch
git checkout -b feature/amazing-feature
# 4. Set up development environment
cd frontend
npm install
npm run dev
# 5. Make your changes and test thoroughly
# 6. Commit with descriptive messages
git commit -m "feat(ai): add weather prediction caching"
# 7. Push to your fork and create Pull Request
git push origin feature/amazing-feature- ๐ Code Style: TypeScript strict mode, ESLint configuration
- ๐งช Testing: Test your changes thoroughly before submitting
- ๐ Documentation: Update relevant documentation for new features
- ๐ฌ Communication: Use clear, descriptive commit messages and PR descriptions
๐ Full Contributing Guide: docs/DEVELOPMENT_GUIDE.md
This project showcases:
- ๐ค Advanced AI Integration - Contextual Gemini AI usage with intelligent fallbacks
- โ๏ธ Modern Web Development - React 18, TypeScript, Vite with best practices
- ๐ Educational Impact - Real-world agricultural learning through gaming
- ๐๏ธ Technical Excellence - Production-ready architecture and optimization
- ๐ก Innovation - Unique blend of gaming, education, and AI technology
- โ Zero-Error Production Build - Clean TypeScript compilation
- ๐ Optimized Performance - 85KB gzipped bundle with code splitting
- ๐ก๏ธ Robust Error Handling - Graceful degradation and intelligent fallbacks
- ๐ฑ Cross-Platform Compatibility - Works on desktop, tablet, and mobile
- โฟ Accessibility Compliant - High contrast design and keyboard navigation
- ๐ Total Files: 50+ source files
- ๐ Lines of Code: 5,000+ lines (TypeScript/React)
- ๐ฏ Main Component: SimpleGameUI.tsx (2,253 lines)
- ๐ค AI Integration: 4 major AI services with fallbacks
- ๐ Documentation: 10 comprehensive guides
- ๐พ Crop Types: 4 (Rice, Wheat, Cotton, Sugarcane)
- ๐ Seasons: 4 (Kharif, Rabi, Zaid, Off-season)
- ๐๏ธ Government Schemes: 3 (PM-KISAN, Fasal Bima, KCC)
- ๐ณ Loan Types: 3 (Bank, Government, Moneylender)
- ๐ฅ NPC Stories: Unlimited AI-generated farmer narratives
This project is licensed under the MIT License - see the LICENSE file for complete details.
- โ Commercial Use - Use in commercial projects
- โ Modification - Modify and adapt the code
- โ Distribution - Share and distribute freely
- โ Private Use - Use for personal projects
โ ๏ธ Attribution Required - Include original license and copyright
- ๐ค Google Gemini AI - Powering intelligent game features and predictions
- ๐จโ๐พ Indian Farmers - Inspiration for authentic agricultural scenarios and challenges
- ๐ Open Source Community - Amazing tools, libraries, and frameworks
- ๐ Kiro - Platform opportunity and challenge hosting
- โ๏ธ React Team - Excellent framework and development experience
- โก Vite Team - Lightning-fast build tool and development server
- Frontend: React, TypeScript, Vite, CSS3
- AI: Google Generative AI SDK, Gemini 2.5 Flash
- Deployment: GitHub Pages, Vercel, Netlify
- Development: ESLint, Prettier, VS Code
- ๐ Bug Reports: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
- ๐ Documentation: Complete docs folder
- ๐ง Direct Contact: stealthwhiz@gmail.com
- ๐ฎ Live Demo: https://stealthwhizz.github.io/HarvestHope/
- ๐ Documentation: docs/ folder
- ๐ค AI Setup Guide: docs/API_SETUP.md
- ๐ ๏ธ Development Guide: docs/DEVELOPMENT_GUIDE.md
