How 02bhaskar/agrosmart works
AgroSmart serves farmers through a browser UI and Node.js API: farmers authenticate by phone and OTP, then request district weather or submit soil type and acreage for crop, fertilizer, season, and profit recommendations. The README also lists yield-estimation support, but the sampled recommendation code calculates profit rather than yield. The flat tree conflicts with several source imports (for example, route and model paths), so links to those components are limited to relationships directly visible in the excerpts or documented in the README.
Main entry points: recommendation.js Recommendation endpoint · server.js HTTP server · weather.js Weather endpoint · auth.js Authentication
Components 16
Farmer interface
- Web pages
index.html - Sign-in pages
login.html - Recommendation page
recommendation.html - Weather page
weather.html - Translations
i18n.js
API services
- HTTP server
server.js - Authentication
auth.js - Weather endpoint
weather.js - Recommendation endpoint
recommendation.js
Agriculture domain
- Crop and profit logic
recommendation.js
Data and integrations
- Farmer profile model
Farmer.js - MongoDB
- Database connection
db.js - OpenWeatherMap
- Climate cache
recommendation.js
Other components
- Farmer
Connections 22
- Farmer → Web pages: uses
README.md - Web pages → Sign-in pages: opens
- Farmer → Authentication: authenticates
README.md - HTTP server → Authentication: mounts routes
server.js - HTTP server → Weather endpoint: mounts routes
server.js - HTTP server → Recommendation endpoint: mounts routes
server.js - Authentication → Farmer profile model: reads and saves
auth.js - Authentication → Farmer: returns token
auth.js - Farmer → Weather page: requests weather
README.md - Weather endpoint → Farmer profile model: loads district
weather.js - Weather endpoint → OpenWeatherMap: fetches conditions
weather.js - Weather endpoint → Weather page: returns weather
- Farmer → Recommendation page: requests advice
README.md - Recommendation endpoint → Farmer profile model: loads farmer
recommendation.js - Recommendation endpoint → Climate cache: reads and writes
recommendation.js - Recommendation endpoint → OpenWeatherMap: fetches climate
recommendation.js - Recommendation endpoint → Crop and profit logic: calculates advice
recommendation.js - Crop and profit logic → Recommendation page: returns advice
- Translations → Web pages: translates UI
- Database connection → MongoDB: connects
db.js - HTTP server → Database connection: starts connection
server.js - Farmer profile model → MongoDB: stores profiles