{"id":30162942,"url":"https://github.com/ridwanullahi-code/leaf-buddy","last_synced_at":"2025-08-11T17:48:09.480Z","repository":{"id":309184028,"uuid":"1030385235","full_name":"Ridwanullahi-code/leaf-buddy","owner":"Ridwanullahi-code","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-10T10:55:05.000Z","size":34987,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-10T12:29:26.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ridwanullahi-code.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-01T14:47:45.000Z","updated_at":"2025-08-10T10:55:09.000Z","dependencies_parsed_at":"2025-08-10T12:39:38.647Z","dependency_job_id":null,"html_url":"https://github.com/Ridwanullahi-code/leaf-buddy","commit_stats":null,"previous_names":["ridwanullahi-code/leaf-buddy"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Ridwanullahi-code/leaf-buddy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ridwanullahi-code%2Fleaf-buddy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ridwanullahi-code%2Fleaf-buddy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ridwanullahi-code%2Fleaf-buddy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ridwanullahi-code%2Fleaf-buddy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ridwanullahi-code","download_url":"https://codeload.github.com/Ridwanullahi-code/leaf-buddy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ridwanullahi-code%2Fleaf-buddy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269930107,"owners_count":24498681,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-08-11T17:48:08.471Z","updated_at":"2025-08-11T17:48:09.472Z","avatar_url":"https://github.com/Ridwanullahi-code.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tomato Disease Detection App\n\nA full-stack application for detecting tomato plant diseases using machine learning. Built with React frontend and Python backend using TensorFlow Lite models.\n\n## Features\n\n- 📸 Camera capture and photo upload\n- 🤖 AI-powered disease detection using TFLite models\n- 🔬 Support for multiple models (MobileNetV2, ResNet50, VGG16)\n- 💊 Treatment and prevention recommendations\n- 🎨 Beautiful responsive UI with Tailwind CSS\n\n## Quick Start\n\n### 🚀 Quick Start\n\n1. **First time setup:**\n   ```bash\n   npm run setup\n   ```\n\n2. **Start both servers:**\n   ```bash\n   npm start\n   ```\n\nThis automatically starts:\n- Frontend on http://localhost:5173  \n- Python backend on http://localhost:5000\n\n**That's it!** The app will be ready at http://localhost:5173\n\n### Manual Setup (if needed)\n\nIf you prefer to run servers separately:\n\n1. **Setup dependencies:**\n   ```bash\n   npm install\n   cd backend \u0026\u0026 pip install -r requirements.txt\n   ```\n\n2. **Start backend:**\n   ```bash\n   cd backend \u0026\u0026 python start.py\n   ```\n\n3. **Start frontend (in new terminal):**\n   ```bash\n   npm run dev\n   ```\n\n## Project Structure\n\n```\n├── src/                    # React frontend\n│   ├── components/         # UI components\n│   ├── pages/             # Page components\n│   ├── services/          # API services\n│   └── types/             # TypeScript definitions\n├── backend/               # Python backend\n│   ├── app.py            # Flask server\n│   ├── requirements.txt  # Python dependencies\n│   └── start.py          # Backend startup script\n├── models/               # TensorFlow Lite models\n│   ├── mobilenetv2_fine_tuned.tflite\n│   ├── resnet50_fine_tuned.tflite\n│   └── vgg16_fine_tuned.tflite\n├── setup.js              # Setup script\n├── start.js              # Start script\n└── public/              # Static assets\n```\n\n## How It Works\n\n1. **Image Capture**: Users can take photos or upload images of tomato leaves\n2. **Preprocessing**: Images are processed using OpenCV (sharpening, contrast enhancement)\n3. **AI Analysis**: TensorFlow Lite models analyze the preprocessed images\n4. **Results**: Disease classification with confidence scores and treatment recommendations\n\n## Models\n\nThe app supports three pre-trained models:\n- **MobileNetV2**: Fast inference, good for mobile devices\n- **ResNet50**: Higher accuracy, balanced performance\n- **VGG16**: High accuracy, slower inference\n\n## Disease Classes\n\nThe models can detect:\n- Healthy leaves\n- Bacterial spot\n- Early blight\n- Late blight\n- Leaf mold\n- Septoria leaf spot\n- Spider mites\n- Target spot\n- Tomato mosaic virus\n- Yellow leaf curl virus\n\n## Development\n\n### Available Scripts\n\n- `node setup.js` - Install all dependencies (Node.js and Python)\n- `node start.js` - Start both frontend and backend servers\n- `npm run dev` - Start only the React frontend\n- `cd backend \u0026\u0026 python start.py` - Start only the Python backend\n\n### Adding New Models\n\n1. Place your `.tflite` model file in the `models/` directory\n2. Update the `DISEASE_CLASSES` array in `backend/app.py`\n3. Add the model name to the frontend model selector\n\n### API Endpoints\n\n- `GET /health` - Health check\n- `POST /analyze` - Disease detection\n- `GET /models` - Available models list\n\n## Technologies Used\n\n### Frontend\n- React 18 + TypeScript\n- Vite build tool\n- Tailwind CSS + shadcn/ui\n- React Router\n- React Query\n\n### Backend\n- Python Flask\n- TensorFlow Lite\n- OpenCV\n- PIL (Pillow)\n- NumPy\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Setup script fails:**\n   ```bash\n   # Try manual installation\n   npm install --legacy-peer-deps\n   cd backend \u0026\u0026 pip install -r requirements.txt\n   ```\n\n2. **Python not found:**\n   - Install Python 3.8+ from python.org\n   - Try `python3` instead of `python`\n\n3. **Backend won't start:**\n   ```bash\n   cd backend\n   python -c \"import flask; print('Flask available')\"\n   ```\n\n4. **Models not found:**\n   - Ensure `.tflite` files are in the `models/` directory\n   - Check file permissions\n\n5. **CORS errors:**\n   - Ensure both servers are running on correct ports\n   - Frontend: http://localhost:5173\n   - Backend: http://localhost:5000\n\n## License\n\nMIT License - feel free to use this project for your own applications!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fridwanullahi-code%2Fleaf-buddy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fridwanullahi-code%2Fleaf-buddy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fridwanullahi-code%2Fleaf-buddy/lists"}