FarmAssist is a next-generation AI-powered digital assistant designed specifically for farmers. It provides real-time guidance, intelligent recommendations, government scheme discovery, weather forecasting, crop advisory, financial planning, and decision-making support through a beautifully designed, emotional, and immersive UI/UX.
- Conversational AI: Natural language interactions powered by Google's Gemini 2.0 Pro
- Image Analysis: Upload crop/plant images for instant disease detection using Gemini Vision
- Multi-Language Support: Supports Hindi, Kannada, Telugu, Bengali, Tamil, and more
- Voice Input: Talk to the assistant naturally
- Context-Aware: Remembers conversation history for better responses
- Real-Time Weather: Current conditions with beautiful animations
- 7-Day Forecast: Detailed daily predictions
- Agricultural Insights:
- Irrigation recommendations
- Pest risk assessment
- Soil moisture estimation
- Farming activity suggestions
- Animated UI: Rain, clouds, sun animations matching real-time weather
- EMI Calculator: Calculate agricultural loan installments
- Smart Recommendations: Bank suggestions with best rates
- Purpose-Based: Tractor, irrigation, seeds, land purchase options
- Visual Growth Animation: Crop-themed growth visualization
- Smart Discovery: Auto-recommend schemes based on eligibility
- Certificate-Style Cards: Beautiful design resembling government documents
- Detailed Information: Eligibility, benefits, required documents
- Direct Apply Links: Quick access to application portals
- Scheme Categories: Income support, insurance, credit, market access
- Live Mandi Rates: Real-time crop prices from across India
- Price Trends: Visual indicators for up/down/stable trends
- Market Insights: AI-powered recommendations on when to sell
- Multiple Crops: Wheat, rice, cotton, vegetables, and more
- AI Recommendations: Crop suggestions based on season, soil, water availability
- Suitability Scores: Data-driven compatibility ratings
- Investment Analysis: Cost estimates and profit potential
- Seasonal Calendar: Kharif, Rabi, and Zaid crop schedules
- Detailed Plans: Duration, water needs, expected yields
- Node.js 18+ and npm/yarn
- Gemini API Key - Get it from Google AI Studio
- Weather API Key - Get it from WeatherAPI.com
- Clone the repository
git clone https://github.com/yourusername/farmassist.git
cd farmassist- Install dependencies
npm install
# or
yarn install- Configure environment variables
Copy .env.example to .env.local:
cp .env.example .env.localEdit .env.local and add your API keys:
NEXT_PUBLIC_GEMINI_API_KEY=your_gemini_api_key_here
NEXT_PUBLIC_WEATHER_API_KEY=your_weatherapi_key_here- Run the development server
npm run dev
# or
yarn dev- Open your browser
Navigate to http://localhost:3000
- Next.js 14 - React framework with App Router
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Framer Motion - Smooth animations
- Zustand - State management
- Google Gemini 2.0 Pro - Conversational AI
- Gemini Vision - Image analysis for disease detection
- WeatherAPI - Real-time weather data
- Custom Color Palette: Earth, leaf, sky, soil tones
- Nature-Themed Animations: Seed sprouting, rain, clouds, sun
- Responsive Design: Mobile-first approach
- Micro-Interactions: Haptic-like feedback
FarmAssist/
βββ app/
β βββ dashboard/
β β βββ page.tsx # Main dashboard with tab navigation
β βββ globals.css # Global styles and animations
β βββ layout.tsx # Root layout
β βββ page.tsx # Landing page with animation
βββ components/
β βββ ChatInterface.tsx # AI chat component
β βββ WeatherWidget.tsx # Weather display with animations
β βββ LoanCalculator.tsx # EMI calculator
β βββ SchemesFinder.tsx # Government schemes
β βββ MarketPrices.tsx # Crop price tracker
β βββ CropPlanner.tsx # AI crop recommendations
βββ lib/
β βββ gemini.ts # Gemini API integration
β βββ weather.ts # Weather API + agricultural analysis
β βββ store.ts # Zustand state management
β βββ utils.ts # Utility functions
βββ .env.local # Environment variables (not committed)
βββ tailwind.config.js # Tailwind configuration
βββ next.config.js # Next.js configuration
βββ package.json # Dependencies
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the key and add to
.env.local
- Visit WeatherAPI.com
- Sign up for a free account
- Navigate to your dashboard
- Copy your API key
- Add to
.env.local
Free Tier Limits:
- WeatherAPI: 1 million calls/month
- Gemini: 60 requests/minute (free tier)
Technologies:
- Gemini 2.0 Flash Exp for text
- Gemini Vision for image analysis
- Context-aware conversation history
Capabilities:
// Ask farming questions
"What crops should I plant this season?"
// Disease detection (with image)
Upload plant image β AI diagnoses disease β Treatment plan
// Financial advice
"How can I get a loan for a tractor?"
// Multi-language
Automatic translation to Hindi, Kannada, etc.System Prompts:
- General farming assistance
- Disease detection specialist
- Crop planning consultant
- Financial advisory
Agricultural Weather Analysis:
interface AgriWeatherInsights {
irrigation: {
recommended: boolean;
reason: string;
wateringAmount: string;
};
pestRisk: {
level: 'low' | 'medium' | 'high';
reason: string;
pests: string[];
};
farmingConditions: {
suitable: boolean;
activities: string[];
warnings: string[];
};
soilMoisture: {
estimated: 'dry' | 'moderate' | 'wet';
recommendation: string;
};
}Animations:
- Rain drops falling (when raining)
- Cloud drift animation
- Sun rotation
- Dynamic background colors
Features:
- EMI calculation using standard formula
- Loan purpose selection (tractor, seeds, irrigation, etc.)
- Bank recommendations with rates
- Visual "crop growth" animation representing financial growth
- Interest breakdown and total payable amount
Formula:
EMI = [P Γ r Γ (1 + r)^n] / [(1 + r)^n - 1]
Where:
P = Principal loan amount
r = Monthly interest rate (annual rate / 12 / 100)
n = Loan tenure in months
Included Schemes:
- PM-KISAN (Income Support)
- Pradhan Mantri Fasal Bima Yojana (Crop Insurance)
- Kisan Credit Card (Credit)
- Soil Health Card Scheme
- e-NAM (Market Access)
Features:
- Filter by category and state
- Eligibility checker
- Document requirements
- Direct application links
Features:
- Live mandi rates for major crops
- Price trend indicators (β β β)
- Percentage change calculations
- Market insights and selling recommendations
- Regional price differences
Recommendation Engine:
- Season compatibility (Kharif, Rabi, Zaid)
- Water requirement matching
- Investment capacity analysis
- Suitability scoring (0-100%)
- Expected yield and profit potential
Crop Database:
{
name: 'Rice (Paddy)',
suitability: 92,
season: 'Kharif (June-Oct)',
waterNeed: 'High',
investment: 'βΉ30,000-40,000/acre',
expectedYield: '40-50 quintals/acre',
profitPotential: 'High'
}/* Earth Tones */
earth-500: #a67c5d
earth-600: #8d6747
/* Leaf Green */
leaf-400: #6bbf64
leaf-500: #4da446
leaf-600: #3a8534
/* Sky Blue */
sky-400: #38bdf8
sky-500: #0ea5e9
sky-600: #0284c7
/* Soil Brown */
soil-500: #a98868
soil-600: #8f7157/* Seed Sprouting (AI Loader) */
@keyframes sprout {
0% { transform: translateY(20px) scale(0); }
60% { transform: translateY(-5px) scale(1.05); }
100% { transform: translateY(0) scale(1); }
}
/* Rain Effect */
@keyframes rain-fall {
0% { transform: translateY(-100vh); opacity: 0.8; }
100% { transform: translateY(100vh); opacity: 0; }
}
/* Leaf Sway */
@keyframes leaf-sway {
0%, 100% { transform: rotate(-5deg); }
50% { transform: rotate(5deg); }
}- Push your code to GitHub
- Import project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
NEXT_PUBLIC_GEMINI_API_KEY=your_production_key
NEXT_PUBLIC_WEATHER_API_KEY=your_production_keynpm run buildContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google Gemini AI - For powerful conversational AI
- WeatherAPI.com - For reliable weather data
- Indian Government - For agricultural schemes data
- Farmers - The real heroes who inspired this project
For support, email [email protected] or open an issue in the repository.
- Voice input and audio responses
- Offline mode with local storage
- Push notifications for weather alerts
- Integration with more regional mandis
- PDF report generation for crop plans
- Community forum for farmers
- IoT sensor integration
- Mobile app (React Native)
Made with β€οΈ for Farmers by FarmAssist Team
πΎ Empowering Agriculture with AI πΎ