Smart Farming Solutions Powered by Artificial Intelligence
AgriAI is a comprehensive farm management platform that uses ai to help farmers optimize their operations, increase yields, and make data-driven decisions. Built with Laravel 12, Livewire 3, and Tailwind CSS 4.
- Features
- Screenshots
- Tech Stack
- Requirements
- Installation
- Configuration
- Usage
- API Integrations
- Project Structure
- Testing
- Contributing
- License
- Create and manage multiple farms with detailed information
- Track farm locations with automatic GPS coordinate detection
- Monitor farm size, soil types, and crop suitability
- View farm-specific analytics and performance metrics
- Plan and monitor crop cycles from planting to harvest
- Track growth stages with progress indicators
- Calculate expected yields and harvest dates
- Manage multiple crops across different fields
- Create and assign farming tasks with priorities
- Set due dates and track completion status
- Filter tasks by status, priority, and farm
- Visual task board with quick status updates
- Track seeds, fertilizers, equipment, and supplies
- Monitor stock levels with low-stock alerts
- Record inventory transactions (additions, removals, adjustments)
- Categorize items for easy organization
- Record farm expenses and income
- Categorize transactions for better insights
- View financial summaries and profit/loss reports
- Generate expense reports by category and date range
- Get personalized farming advice powered by AI
- Ask questions about crops, pests, soil, and weather
- Receive context-aware recommendations based on your farm data
- Conversation history for reference
- Upload plant images for instant pest/disease detection
- Get detailed diagnosis with treatment recommendations
- Powered by Google Gemini Vision API
- Save diagnosis history for tracking
- Real-time weather data for your farm locations
- 5-day weather forecasts with detailed conditions
- Temperature, humidity, wind speed, and precipitation data
- Weather-based farming recommendations
- Track agricultural commodity prices
- View price trends and historical data
- Get market insights for better selling decisions
- Support for local and regional markets
- Comprehensive overview of all farm operations
- Quick stats and key performance indicators
- Recent activity feed
- Mobile-friendly design
| Login | Register |
|---|---|
![]() |
![]() |
| AI Chat Assistant | Pest Diagnosis |
|---|---|
![]() |
![]() |
- PHP 8.3 - Modern PHP with type declarations and attributes
- Laravel 12 - Latest Laravel framework with streamlined structure
- Laravel Fortify - Authentication scaffolding with 2FA support
- MySQL/SQLite - Database options for development and production
- Livewire 3 - Full-stack framework for dynamic interfaces
- Flux UI - Beautiful component library for Livewire
- Tailwind CSS 4 - Utility-first CSS framework
- Alpine.js - Lightweight JavaScript framework (bundled with Livewire)
- Groq API - Fast LLM for chat functionality (Llama 3.3 70B)
- Google Gemini API - Vision model for pest diagnosis
- Open-Meteo API - Weather data and forecasts
- Laravel Pint - PHP code style fixer
- Pest PHP 4 - Modern testing framework
- Laravel Sail - Docker development environment
- Vite - Frontend build tool
- PHP >= 8.2
- Composer >= 2.0
- Node.js >= 18.0
- npm >= 9.0
- MySQL 8.0+ or SQLite
- Git
git clone https://github.com/TechGriffo254/AgriAI.git
cd agriAI# Install PHP dependencies
composer install
# Install Node.js dependencies
npm install# Copy environment file
cp .env.example .env
# Generate application key
php artisan key:generate# Run migrations
php artisan migrate
# (Optional) Seed with sample data
php artisan db:seed# For development
npm run dev
# For production
npm run build# Using Laravel's built-in server
php artisan serve
# Or using the dev script (recommended)
composer run devVisit http://localhost:8000 to access the application.
Create a .env file with the following configurations:
# Application
APP_NAME=AgriAI
APP_ENV=local
APP_DEBUG=true
APP_URL=http://localhost:8000
# Database
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=agriai
DB_USERNAME=root
DB_PASSWORD=
# AI Providers
LLM_PROVIDER=groq
LLM_CHAT_PROVIDER=groq
LLM_VISION_PROVIDER=gemini
# Groq API (Free - for chat)
GROQ_API_KEY=your_groq_api_key
# Google Gemini API (for vision/pest diagnosis)
GEMINI_API_KEY=your_gemini_api_key
# Queue (for background jobs)
QUEUE_CONNECTION=database-
Groq API (Free)
- Sign up at console.groq.com
- Create an API key
- Add to
.envasGROQ_API_KEY
-
Google Gemini API
- Visit ai.google.dev
- Create a project and enable the Gemini API
- Generate an API key
- Add to
.envasGEMINI_API_KEY
-
Register an Account
- Visit the landing page and click "Get Started"
- Fill in your details and create an account
- Verify your email (if enabled)
-
Create Your First Farm
- Navigate to Farms > Create Farm
- Enter farm details (name, location, size)
- Allow location access for automatic coordinates
-
Add Crop Cycles
- Go to Crop Cycles > Create
- Select your farm and crop type
- Set planting and expected harvest dates
-
Use AI Assistant
- Navigate to AI > Assistant
- Ask questions about farming, pests, or crops
- Get personalized recommendations
-
Diagnose Pests
- Go to AI > Pest Diagnosis
- Upload a photo of an affected plant
- Receive instant diagnosis and treatment options
| Route | Description |
|---|---|
/dashboard |
Main dashboard with overview |
/farms |
Farm management |
/crop-cycles |
Crop cycle tracking |
/tasks |
Task management |
/inventory |
Inventory management |
/finances |
Financial tracking |
/ai |
AI Assistant |
/ai/pest-diagnosis |
Pest diagnosis with image upload |
/weather |
Weather forecasts |
/market |
Market prices |
/settings/profile |
User settings |
- Model: Llama 3.3 70B Versatile
- Purpose: Text-based AI conversations
- Pricing: Free tier available
- Model: Gemini 2.0 Flash
- Purpose: Image analysis for pest diagnosis
- Pricing: Free tier with limits
- Endpoints Used:
- Current weather data
- 7-day forecast
- Data: Temperature, humidity, wind, precipitation
- Pricing: Free and open-source
agriAI/
├── app/
│ ├── Http/
│ │ └── Controllers/ # HTTP Controllers
│ ├── Jobs/
│ │ ├── ProcessAIChat.php # Background AI processing
│ │ └── ProcessPestDiagnosis.php
│ ├── Livewire/
│ │ ├── AI/ # AI components
│ │ ├── CropCycles/ # Crop cycle management
│ │ ├── Dashboard/ # Dashboard components
│ │ ├── Farms/ # Farm management
│ │ ├── Finances/ # Financial tracking
│ │ ├── Inventory/ # Inventory management
│ │ ├── Market/ # Market prices
│ │ ├── Settings/ # User settings
│ │ ├── Tasks/ # Task management
│ │ └── Weather/ # Weather display
│ ├── Models/
│ │ ├── AIConversation.php # AI chat conversations
│ │ ├── AIQuery.php # Individual AI queries
│ │ ├── Crop.php # Crop types
│ │ ├── CropCycle.php # Crop growing cycles
│ │ ├── Expense.php # Farm expenses
│ │ ├── Farm.php # Farm entities
│ │ ├── Income.php # Farm income
│ │ ├── Inventory.php # Inventory items
│ │ ├── MarketPrice.php # Commodity prices
│ │ ├── PestDiagnosis.php # Pest diagnosis records
│ │ ├── Task.php # Farm tasks
│ │ ├── User.php # User accounts
│ │ └── WeatherData.php # Cached weather data
│ ├── Policies/ # Authorization policies
│ ├── Providers/ # Service providers
│ └── Services/
│ └── AI/
│ ├── AgriAIService.php # Main AI service
│ ├── GeminiService.php # Gemini API integration
│ └── GroqService.php # Groq API integration
├── config/
│ ├── llm.php # AI provider configuration
│ ├── weather.php # Weather API configuration
│ └── market.php # Market data configuration
├── database/
│ ├── factories/ # Model factories for testing
│ ├── migrations/ # Database migrations
│ └── seeders/ # Database seeders
├── resources/
│ ├── css/
│ │ └── app.css # Tailwind CSS entry point
│ ├── js/
│ │ └── app.js # JavaScript entry point
│ └── views/
│ ├── components/
│ │ └── theme/ # Reusable theme components
│ └── livewire/ # Livewire component views
├── routes/
│ ├── web.php # Web routes
│ └── console.php # Console commands
├── tests/
│ ├── Feature/ # Feature tests
│ └── Unit/ # Unit tests
└── public/ # Public assets
php artisan testphp artisan test tests/Feature/ExampleTest.phpphp artisan test --filter=FarmTest# Check for style issues
vendor/bin/pint --test
# Fix style issues
vendor/bin/pintContributions are welcome! Please follow these steps:
- 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
- Follow PSR-12 coding standards
- Use Laravel Pint for code formatting
- Write tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
TechGriffo254
- GitHub: @TechGriffo254
- Laravel - The PHP framework
- Livewire - Full-stack framework
- Tailwind CSS - CSS framework
- Flux UI - Component library
- Groq - Fast AI inference
- Google Gemini - AI vision capabilities
- Open-Meteo - Weather data
Made with care for farmers everywhere















