A comprehensive agricultural assistance platform that empowers farmers with AI-driven crop management, disease detection, multilingual support, and access to government schemes.
- Multilingual Support: Available in 7 languages (English, Hindi, Telugu, Tamil, Bengali, Marathi, Punjabi)
- Voice Input/Output: Speech recognition and text-to-speech capabilities
- Agricultural Expertise: Specialized knowledge in crop management, disease identification, and farming techniques
- Real-time Translation: Seamless communication in farmer's preferred language
- Image-based Analysis: Upload crop images for instant disease identification
- ML-Powered Recognition: Advanced machine learning models for accurate diagnosis
- Treatment Recommendations: Detailed treatment and prevention strategies
- Confidence Scoring: Reliability indicators for detection results
- Report Generation: Downloadable PDF reports for record-keeping
- Real-time News: Latest agricultural news categorized by type and region
- Government Schemes: Up-to-date information on central and state schemes
- Market Updates: Current market prices and trends
- Weather Integration: Weather-based farming alerts and recommendations
- Comprehensive Database: Detailed information on agricultural schemes
- Eligibility Checker: Interactive tools to check scheme eligibility
- Application Guidance: Step-by-step application procedures
- Document Requirements: Complete list of required documents
- Status Tracking: Track application status and updates
- Real-time Weather: Current weather conditions and forecasts
- Farming Alerts: Weather-based crop management recommendations
- Seasonal Planning: Weather-informed crop calendar suggestions
- Regional Data: Location-specific weather information
- Best Practices: Comprehensive farming guides and tutorials
- Crop Calendars: Season-wise crop planning recommendations
- Organic Farming: Sustainable and organic farming techniques
- Irrigation Methods: Water management and irrigation strategies
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Custom components with Lucide React icons
- Animations: Framer Motion
- State Management: React Context API
- Forms: React Hook Form with Zod validation
- Runtime: Node.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT-based authentication
- File Upload: Multer for image processing
- Translation: Google Translate API integration
- Text-to-Speech: Web Speech API
- Disease Detection: Python Flask service with TensorFlow/PyTorch
- Image Processing: OpenCV and PIL
- Model Serving: Custom ML pipeline for crop disease classification
- Confidence Scoring: Probabilistic model outputs
- Weather: OpenWeatherMap API
- Translation: Google Translate API
- News: Custom news aggregation service
- Government Data: Integration with government scheme databases
agri-ai/
├── app/ # Next.js App Router pages
│ ├── api/ # API routes
│ │ ├── auth/ # Authentication endpoints
│ │ ├── chatbot/ # Chatbot API
│ │ ├── disease-detection/ # Disease detection endpoints
│ │ ├── news/ # News API
│ │ ├── schemes/ # Government schemes API
│ │ ├── translate/ # Translation services
│ │ ├── weather/ # Weather API
│ │ └── tts/ # Text-to-speech API
│ ├── chatbot/ # Chatbot interface
│ ├── dashboard/ # Main dashboard
│ ├── detect/ # Disease detection page
│ ├── hub/ # Knowledge hub
│ ├── login/ # Authentication pages
│ ├── news/ # News and updates
│ ├── profile/ # User profile
│ ├── register/ # User registration
│ └── schemes/ # Government schemes
├── components/ # Reusable React components
│ ├── auth/ # Authentication components
│ ├── ui/ # UI components
│ ├── SimpleTTS.tsx # Text-to-speech component
│ ├── TranslateButton.tsx # Translation component
│ ├── WeatherWidget.tsx # Weather display
│ └── ... # Other components
├── contexts/ # React Context providers
│ ├── AuthContext.tsx # Authentication context
│ └── I18nContext.tsx # Internationalization
├── hooks/ # Custom React hooks
│ ├── useRealTimeData.ts # Real-time data fetching
│ └── useAuth.ts # Authentication hook
├── lib/ # Utility libraries
│ ├── mongodb.ts # Database connection
│ ├── auth.ts # Authentication utilities
│ └── utils.ts # General utilities
├── locales/ # Internationalization files
│ ├── en/ # English translations
│ ├── hi/ # Hindi translations
│ ├── te/ # Telugu translations
│ └── ... # Other languages
├── ml-service/ # Machine Learning service
│ ├── app.py # Flask application
│ ├── models/ # ML models
│ ├── utils/ # ML utilities
│ └── requirements.txt # Python dependencies
├── models/ # Database models
│ ├── User.js # User model
│ ├── DiseaseDetection.js # Disease detection model
│ └── ... # Other models
├── public/ # Static assets
│ ├── photos/ # Image assets
│ └── icons/ # Icon files
└── styles/ # Global styles
└── globals.css # Global CSS
- Node.js 18+ and npm
- Python 3.8+ (for ML service)
- MongoDB database
- Google Translate API key (optional)
- OpenWeatherMap API key (optional)
- Clone the repository
git clone https://github.com/your-username/agri-ai.git
cd agri-ai- Install dependencies
npm install- Set up Python ML service
cd ml-service
pip install -r requirements.txt- Environment Configuration
Create a
.env.localfile in the root directory:
# Database
MONGODB_URI=mongodb://localhost:27017/agri-ai
# Authentication
JWT_SECRET=your-jwt-secret-key
NEXTAUTH_SECRET=your-nextauth-secret
# External APIs
GOOGLE_TRANSLATE_API_KEY=your-google-translate-key
OPENWEATHER_API_KEY=your-openweather-key
# ML Service
ML_SERVICE_URL=http://localhost:5000
# Application
NEXT_PUBLIC_APP_URL=http://localhost:3000- Start the development servers
Frontend (Next.js):
npm run devML Service (Flask):
cd ml-service
python app.py- Access the application
- Frontend: http://localhost:3000
- ML Service: http://localhost:5000
- Install MongoDB locally or use MongoDB Atlas
- Update the
MONGODB_URIin your.env.localfile - The application will automatically create necessary collections
- Place your trained disease detection models in
ml-service/models/ - Update model paths in
ml-service/app.py - Ensure model compatibility with the prediction pipeline
- Google Translate: Required for translation features
- OpenWeatherMap: Required for weather data
- JWT Secret: Required for authentication
- Register/Login: Create an account or sign in
- Language Selection: Choose your preferred language
- Dashboard: Access all features from the main dashboard
- Disease Detection: Upload crop images for disease identification
- Chatbot: Ask questions about farming in your language
- News & Schemes: Stay updated with latest information
- Weather: Check weather conditions and farming alerts
- Content Management: Update news, schemes, and knowledge base
- User Management: Monitor user activity and support
- Analytics: Track usage patterns and popular features
- Model Updates: Deploy new ML models for disease detection
- English (en) - Primary language
- Hindi (hi) - हिंदी
- Telugu (te) - తెలుగు
- Tamil (ta) - தமிழ்
- Bengali (bn) - বাংলা
- Marathi (mr) - मराठी
- Punjabi (pa) - ਪੰਜਾਬੀ
- Real-time Translation: Instant translation of user queries
- Voice Support: Speech recognition in multiple languages
- Content Localization: UI elements translated for each language
- Fallback System: Graceful degradation to English if translation fails
- Architecture: Convolutional Neural Network (CNN)
- Training Data: 50,000+ labeled crop disease images
- Accuracy: 92% accuracy on test dataset
- Supported Crops: Tomato, Rice, Cotton, Wheat, Maize
- Disease Categories: 20+ common crop diseases
- Knowledge Base: Comprehensive agricultural information
- Context Awareness: Maintains conversation context
- Multilingual Processing: Understands queries in multiple languages
- Fallback Responses: Handles unknown queries gracefully
- JWT Tokens: Secure token-based authentication
- Password Hashing: bcrypt for password security
- Session Management: Secure session handling
- Route Protection: Protected routes for authenticated users
- Input Validation: Comprehensive input sanitization
- File Upload Security: Secure image upload handling
- API Rate Limiting: Protection against abuse
- CORS Configuration: Proper cross-origin resource sharing
- Image Compression: Automatic image optimization
- Lazy Loading: Components loaded on demand
- Caching: Efficient data caching strategies
- Code Splitting: Optimized bundle sizes
- CDN Integration: Fast asset delivery
- Error Tracking: Comprehensive error logging
- Performance Metrics: Response time monitoring
- Usage Analytics: User behavior tracking
- Health Checks: System health monitoring
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run specific test suites
npm run test:components
npm run test:api
npm run test:integration- Unit Tests: Component and utility function tests
- Integration Tests: API endpoint testing
- E2E Tests: Full user journey testing
- ML Model Tests: Model accuracy and performance tests
# Build the application
npm run build
# Start production server
npm start# Build Docker image
docker build -t agri-ai .
# Run container
docker run -p 3000:3000 agri-ai- Development: Local development with hot reload
- Staging: Pre-production testing environment
- Production: Optimized production deployment
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- TypeScript: Strict type checking enabled
- ESLint: Code linting and formatting
- Prettier: Code formatting
- Husky: Pre-commit hooks for quality assurance
- Follow existing code patterns and conventions
- Write comprehensive tests for new features
- Update documentation for any changes
- Ensure all tests pass before submitting PR
This project is licensed under the MIT License - see the LICENSE file for details.
- TensorFlow/PyTorch: Machine learning frameworks
- Next.js Team: Amazing React framework
- MongoDB: Reliable database solution
- Google Translate: Translation services
- OpenWeatherMap: Weather data provider
- Agricultural Experts: Domain knowledge and validation
- Open Source Community: Various libraries and tools
- Documentation: Comprehensive guides and API documentation
- Issues: GitHub issues for bug reports and feature requests
- Community: Join our community discussions
- Email: [email protected]
When reporting issues, please include:
- Detailed description of the problem
- Steps to reproduce the issue
- Expected vs actual behavior
- Screenshots or error logs
- Environment information (OS, browser, etc.)
- Mobile App: React Native mobile application
- IoT Integration: Sensor data integration
- Marketplace: Agricultural product marketplace
- Expert Consultation: Connect with agricultural experts
- Crop Insurance: Insurance recommendation system
- Precision Agriculture: GPS and drone integration
- AI-Powered Farm Management: Complete farm automation
- Blockchain Integration: Supply chain transparency
- Satellite Imagery: Crop monitoring from space
- Predictive Analytics: Yield prediction and optimization
- Global Expansion: Support for international markets
Made with ❤️ for farmers worldwide
Agri AI - Empowering Agriculture Through Technology