How badhanroy/plantcheck works
PlantCheck is a smart-agriculture web platform for plant-disease diagnosis, crop care, and community knowledge sharing, with account authentication. Users enter through the React app; protected feature pages send requests to the Express API, while diagnosis uses a separate Python prediction service. Crop care adds weather-based watering advice, reminders, and journals. The graph includes the documented model-inference capability; the diagnosis controller and several wiring details were not sampled, so uncertain internal links are omitted.
Main entry points: index.js Express server · App.jsx App and routes · connectDB.js MongoDB · cropCareController.js Crop care operations
Components 29
Web client
- App and routes
frontend/src/App.jsx - Auth state
frontend/src/store/authStore.js - Community state
frontend/src/store/communityStore.js - Crop care pages
frontend/src/pages/CropCare.jsx - Diagnosis page
frontend/src/pages/DiagnosePage.jsx - Community pages
frontend/src/pages/CommunityPage.jsx - Crop care API client
frontend/src/utils/cropCareApi.js
Application API
- Express server
backend/index.js - Auth routes
backend/routes/auth.routes.js - Community routes
backend/routes/community.routes.js - Crop routes
backend/routes/cropCareRoutes.js - Diagnosis routes
backend/routes/diagnosis.routes.js - Authentication
backend/controllers/auth.controller.js - Community operations
backend/controllers/community.controller.js
Crop care
- Crop care operations
backend/controllers/cropCareController.js - Watering advice
backend/services/cropCareService.js - Weather lookup
backend/services/weatherService.js
Disease diagnosis
- Diagnosis operations
backend/controllers/diagnosis.controller.js - Prediction API
backend/main.py - Disease model
backend/model_service.py
Persistence and integrations
- MongoDB
backend/db/connectDB.js - User model
backend/models/user.model.js - Post and comment models
backend/models/post.model.js - Crop and journal models
backend/models/Crop.js - Diagnosis history model
backend/models/Diagnosis.js - Email delivery
backend/mailtrap/emails.js
Other components
- Grower
- Mail provider
- Weather provider
Connections 34
- Grower → App and routes: uses
- App and routes → Auth state: checks session
- App and routes → Diagnosis page: routes to
- App and routes → Crop care pages: routes to
- App and routes → Community pages: routes to
- Auth state → Auth routes: requests auth
- Community state → Community routes: requests posts
- Community pages → Community state: uses state
- Crop care pages → Crop care API client: requests crop data
- Crop care API client → Crop routes: calls API
- Diagnosis page → Diagnosis routes: submits image
- Express server → Auth routes: mounts routes
- Express server → Community routes: mounts routes
- Express server → Crop routes: mounts routes
- Express server → Diagnosis routes: mounts routes
- Auth routes → Authentication: dispatches
- Community routes → Community operations: dispatches
- Crop routes → Crop care operations: dispatches
- Diagnosis routes → Diagnosis operations: dispatches
- Authentication → User model: reads and writes
- Authentication → Email delivery: sends messages
- Community operations → Post and comment models: reads and writes
- Crop care operations → Crop and journal models: reads and writes
- Crop care operations → Weather lookup: gets conditions
- Crop care operations → Watering advice: calculates advice
- Weather lookup → Weather provider: fetches forecast
- Email delivery → Mail provider: delivers email
- Prediction API → Disease model: runs inference
- Diagnosis operations → Diagnosis history model: stores history
- Express server → Prediction API: starts service
- MongoDB → User model: backs models
- MongoDB → Post and comment models: backs models
- MongoDB → Crop and journal models: backs models
- MongoDB → Diagnosis history model: backs model