A modern, mobile-first plant disease detection application built with Next.js, Supabase, and AI-powered inference.
- 🔐 Authentication: Email/password and Google OAuth
- 📱 Mobile-first Design: Responsive with bottom navigation
- 🤖 AI-powered Detection: ONNX runtime with Gemini fallback
- 📊 Analytics Dashboard: Plant health tracking and statistics
- 📚 Disease Library: Comprehensive plant disease database
- 💬 AI Assistant: Chatbot for plant care guidance
- 🌙 Dark/Light Theme: Customizable appearance
- 📱 PWA Ready: Installable web app experience
- Frontend: Next.js 14, TypeScript, Tailwind CSS, shadcn/ui
- Backend: Supabase (Auth, Database, Storage, Edge Functions)
- AI/ML: ONNX Runtime Web, Google Gemini API
- Charts: Recharts
- State Management: Zustand
- Deployment: Vercel
- Node.js 18+ and npm
- Supabase account
- Google Gemini API key (for AI features)
- Clone the repository:
git clone <repository-url>
cd leaf-labs- Install dependencies:
npm install- Set up environment variables:
cp .env.example .env.localFill in your Supabase and Google Gemini API credentials.
-
Set up Supabase:
- Create a new Supabase project
- Enable Google OAuth in Authentication settings
- Add your
GEMINI_API_KEYas a secret in Project Settings > Edge Functions
-
Add your ONNX model:
- Place your trained plant disease model as
public/models/plant-disease-model.onnx
- Place your trained plant disease model as
-
Start the development server:
npm run dev- Email/password signup and login
- Google OAuth integration
- Protected routes with middleware
- Camera capture and file upload
- Client-side ONNX inference
- Gemini API fallback for failed inferences
- Confidence scoring and top-3 predictions
- Plant health statistics
- Interactive charts showing health trends
- Quick action buttons
- Recent scan history
- Comprehensive disease database
- Categorized by type (fungal, bacterial, viral)
- Detailed descriptions and treatment advice
- Scan history with full details
- Gemini-powered chatbot
- Context-aware responses
- Plant care guidance
- Treatment recommendations
- Conversational AI with memory
The app is configured for deployment on Vercel:
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy Supabase Edge Functions using the Supabase CLI
- Deploy automatically on push to main branch
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - see LICENSE file for details