
suchi173/ml-powered-tomato-crop-disease-identification-and-monitoring
Developer toolsA full-stack web application for crop leaf disease detection using a trained YOLOv8 model.
Overview
A full-stack web application for crop leaf disease detection using a trained YOLOv8 model. Features - Upload leaf images and get a canonical disease label from the trained model. - Frontend dashboard for scan history, insights and results. - Backend API for uploads, inference and persistence. Tech stack - Frontend: React 18 + TypeScript, Vite, Tailwind CSS, Radix UI (shadcn-style components). - Backend: Node.js + TypeScript, Express, tsx for running TS directly. - Database: PostgreSQL via Drizzle ORM and drizzle-kit migrations. - Machine learning: Python (Ultralytics YOLOv8, PyTorch, ONNX Runtime optional). - Dev tools: Vite, TypeScript, tsx, tailwindcss, cross-env. Quickstart (development) Prerequisites - Node 18+ and npm - Python 3.10+ (for ML tooling) - PostgreSQL (or a compatible DATABASE_URL) 3. Configure environment - Create a .env at the project root with at least: 4. (Optional) Prepare Python environment for ML The dev script runs the TypeScript server (see server/index.
README
ML-POWERED TOMATO CROP DISEASE IDENTIFICATION AND MONITORING
A full-stack web application for crop leaf disease detection using a trained YOLOv8 model.
Features
- Upload leaf images and get a canonical disease label from the trained model.
- Frontend dashboard for scan history, insights and results.
- Backend API for uploads, inference and persistence.
Tech stack
- Frontend: React 18 + TypeScript, Vite, Tailwind CSS, Radix UI (shadcn-style components).
- Backend: Node.js + TypeScript, Express,
tsxfor running TS directly. - Database: PostgreSQL via Drizzle ORM and
drizzle-kitmigrations. - Machine learning: Python (Ultralytics YOLOv8, PyTorch, ONNX Runtime optional).
- Dev tools: Vite, TypeScript, tsx, tailwindcss, cross-env.
Quickstart (development) Prerequisites
- Node 18+ and npm
- Python 3.10+ (for ML tooling)
- PostgreSQL (or a compatible
DATABASE_URL)
- Clone the repo
git clone && cd MP
- Install Node dependencies
npm install
- Configure environment
- Create a
.envat the project root with at least:
DATABASE_URL=postgres://user:pass@host:port/dbname
SESSION_SECRET=your_session_secret
# Optional: OPENAI_API_KEY=...
- (Optional) Prepare Python environment for ML
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r ml/requirements.txt
- Run database migrations
npm run db:push
- Start the app in development
npm run dev
The dev script runs the TypeScript server (see server/index.ts) which also serves the client during development.
Production build
npm run build
npm start
Machine learning / inference
- The trained model expected by the server is at
ml/models/best.pt(or the providedyolov8n.ptfor experiments). - To run a quick inference locally:
python ml/predict.py path/to/image.jpg
- To evaluate the dataset splits:
python ml/predict.py --eval test [limit]
Troubleshooting
- If you see “DATABASE_URL, ensure the database is provisioned” the
.envor PostgreSQL connection is not configured correctly. - Model errors will indicate missing
ml/models/best.pt— ensure the file exists before running inference.
Where to look in the repo
- Server code: server/index.ts
- Frontend: client/src
- ML: ml (training, inference and requirements)
Recommended Tools
Try a different keyword or remove a filter.
Install
npx skillfish add suchi173/ml-powered-tomato-crop-disease-identification-and-monitoring