How jugal1406/cs26012-crop_disease_detection works
This is a farmer-facing crop disease detection and agronomic advisory platform. Farmers authenticate, manage farm profiles, submit leaf images, receive confidence-gated diagnoses enriched with weather context and localized advisory, then review scan history or download reports. The graph separates the React client, API/domain services, inference and advisory capabilities, and persistence. Several frontend pages and backend routes are unsampled; their feature branches are retained from the README, while uncertain call relationships are dashed. (74 words)
Main entry points: diagnosis_service.py Diagnosis orchestration · App.jsx React application · scans.py Scan routes · main.py FastAPI application
Components 26
Farmer application
- React application
frontend/src/App.jsx - Authentication client
frontend/src/services/authService.js - Diagnosis client
frontend/src/services/diagnosisService.js - Farm client
frontend/src/services/farmService.js - Scan client
frontend/src/services/scanService.js - Weather client
frontend/src/services/weatherService.js
API and domain services
- FastAPI application
backend/main.py - Authentication routes
backend/routers/auth.py - Diagnosis routes
backend/routers/diagnose.py - Farm routes
backend/routers/farms.py - Scan routes
backend/routers/scans.py - Dashboard service
backend/services/dashboard_service.py - Farm management
backend/services/farm_service.py - Identity synchronization
backend/services/auth_service.py
Diagnosis and advisory
- Leaf inference
backend/inference.py - Diagnosis orchestration
backend/services/diagnosis_service.py - Weather advisory context
backend/services/weather_service.py - Agronomic advisory
backend/services/llm_service.py - Localized PDF reports
backend/services/pdf_service.py
Persistence
- Database sessions
backend/database.py - Data repositories
backend/repositories - PostgreSQL
Other components
- Farmer
- Clerk
- Open-Meteo
- Groq API
Connections 30
- Farmer → React application: uses
- React application → Authentication client: authenticates
- Authentication client → Clerk: gets tokens
frontend/src/services/authService.js - Authentication client → Authentication routes: syncs identity
frontend/src/services/authService.js - React application → Diagnosis client: submits scans
- Diagnosis client → Diagnosis routes: requests diagnosis
- React application → Farm client: manages farms
- Farm client → Farm routes: requests farms
- React application → Scan client: reviews scans
- Scan client → Scan routes: requests history
- Weather client → Farm routes: requests weather
- FastAPI application → Authentication routes: routes requests
- FastAPI application → Diagnosis routes: routes requests
- FastAPI application → Farm routes: routes requests
- FastAPI application → Scan routes: routes requests
- Authentication routes → Identity synchronization: synchronizes user
backend/routers/auth.py - Diagnosis routes → Diagnosis orchestration: requests diagnosis
- Farm routes → Farm management: manages farm data
- Scan routes → Diagnosis orchestration: gets advisory
backend/routers/scans.py - Scan routes → Localized PDF reports: generates report
backend/routers/scans.py - Diagnosis orchestration → Leaf inference: classifies image
backend/services/diagnosis_service.py - Diagnosis orchestration → Weather advisory context: fetches context
backend/services/diagnosis_service.py - Diagnosis orchestration → Agronomic advisory: generates advisory
backend/services/diagnosis_service.py - Weather advisory context → Open-Meteo: fetches weather
- Agronomic advisory → Groq API: requests guidance
- Diagnosis orchestration → Data repositories: persists diagnosis
backend/services/diagnosis_service.py - Scan routes → Data repositories: reads scan records
backend/routers/scans.py - Database sessions → PostgreSQL: opens sessions
backend/database.py - Data repositories → Database sessions: uses sessions
- Dashboard service → Data repositories: reads summaries