How mureri-hilary-99/smart-agriculture-system works
This is a crop decision-support product: farmers provide soil and climate measurements, the API validates them, and a Random Forest service returns a crop recommendation, confidence, and alternatives. Model training is a separate lifecycle stage that produces the artifact used for inference. The README documents a Next.js dashboard, but the supplied tree contains no dashboard source beyond its environment example; IoT and database integration are explicitly planned, not implemented. Relationships shown are supported by excerpts or README statements.
Main entry points: main.py FastAPI application · prediction.py Prediction endpoint · frontend Farmer dashboard · crop_service.py Recommendation inference
Components 9
Farmer interface
- Farmer dashboard
frontend
Recommendation API
- FastAPI application
backend/app/main.py - Application settings
backend/app/core/config.py - Prediction endpoint
backend/app/routers/prediction.py - Input and output schemas
backend/app/schemas/crop.py
Model lifecycle
- Recommendation inference
backend/app/services/crop_service.py - Random Forest training
backend/app/ml/train_model.py - Trained model artifact
Other components
- Farmer
Connections 8
- Farmer → Farmer dashboard: enters conditions
README.md - Farmer dashboard → FastAPI application: submits measurements
README.md - FastAPI application → Application settings: configures from
backend/app/main.py - FastAPI application → Prediction endpoint: registers route
backend/app/main.py - Prediction endpoint → Input and output schemas: validates and formats
backend/app/routers/prediction.py - Prediction endpoint → Recommendation inference: requests prediction
backend/app/routers/prediction.py - Recommendation inference → Trained model artifact: loads for inference
backend/app/services/crop_service.py - Random Forest training → Trained model artifact: saves trained model
backend/app/ml/train_model.py