How vingupta09/tomatoguard works
This is a tomato-leaf diagnosis and automated spraying system: camera or user images are classified by the backend, saved as diagnosis history, and can trigger pump commands; a web app provides diagnosis, monitoring, history, and pump controls. The excerpts show the frontend upload/API flow and backend inference and device endpoints. Firmware behavior and several frontend page internals were not sampled, so those links are limited to documented or indexed relationships.
Main entry points: app.py HTTP API · App.jsx Web routes · Home.jsx Image classifier · client.js API client
Components 16
Web application
- Web routes
frontend/src/App.jsx - Image classifier
frontend/src/pages/Home.jsx - Dashboard
frontend/src/pages/Dashboard.jsx - Diagnosis history
frontend/src/pages/History.jsx - Pump controls
frontend/src/pages/PumpTest.jsx - API client
frontend/src/api/client.js - Authentication state
frontend/src/context/AuthContext.jsx - Demo data
frontend/src/data/demo.js - Diagnosis display
frontend/src/components/DiagnosisPanel.jsx
Diagnosis backend
- HTTP API
backend/app.py - Image inference
backend/inference.py
Field devices
- ESP32 camera
firmware/esp32cam_capture/esp32cam_capture.ino - ESP32 pump board
firmware/esp32_pump_controller/esp32_pump_controller.ino
Persistence and reference
- Disease guidance
backend/disease_info.py - Device and history store
backend/store.py
Other components
- Grower
Connections 22
- Grower → Image classifier: uploads image
frontend/src/pages/Home.jsx - Image classifier → API client: posts image
frontend/src/pages/Home.jsx - API client → HTTP API: sends API requests
frontend/src/api/client.js - HTTP API → Image inference: classifies image
backend/app.py - HTTP API → Disease guidance: uses guidance
backend/app.py - HTTP API → Device and history store: reads and writes
backend/app.py - HTTP API → ESP32 camera: accepts capture uploads
backend/app.py - ESP32 pump board → HTTP API: polls commands
backend/app.py - HTTP API → ESP32 pump board: returns pump commands
backend/app.py - Web routes → Image classifier: routes to
frontend/src/App.jsx - Web routes → Dashboard: routes to
frontend/src/App.jsx - Web routes → Diagnosis history: routes to
frontend/src/App.jsx - Web routes → Pump controls: routes to
frontend/src/App.jsx - Web routes → Authentication state: protected by
frontend/src/App.jsx - Image classifier → Diagnosis display: renders result
frontend/src/pages/Home.jsx - Image classifier → Demo data: uses fallback
frontend/src/pages/Home.jsx - Dashboard → API client: requests status
frontend/src/pages/Dashboard.jsx - Dashboard → Diagnosis display: renders diagnosis
frontend/src/pages/Dashboard.jsx - Diagnosis history → API client: loads and clears
frontend/src/pages/History.jsx - Diagnosis history → Device and history store: displays saved records
- Diagnosis history → Demo data: uses fallback
frontend/src/pages/History.jsx - Pump controls → API client: requests pump action
frontend/src/pages/PumpTest.jsx