How surypratapsingh872/agrivision-ai- works
AgriVision AI is a smart-agriculture web platform whose main workflow is a user submitting an agricultural prediction request through the frontend, reaching a FastAPI endpoint, and receiving an AI-backed result. Separate capabilities cover crop, fertilizer, irrigation, weather, and market guidance, alongside authentication, history, dashboards, reports, notifications, and administration. The excerpts establish application startup, route registration, selected predictor internals, authentication logic, and dashboard queries; many other service-to-predictor and persistence calls are not shown, so those links are omitted.
Main entry points: api_router.py API router · disease.py Prediction routes · dashboard_service.py Dashboard analytics · main.py FastAPI application
Components 24
Application entry
- Web frontend
Agrivision frontend/js/auth.js - FastAPI application
backend/main.py - API router
backend/api_router.py
Identity and access
- Authentication routes
backend/auth.py - Authentication service
backend/auth_service.py - User persistence
backend/user_repository.py - Admin panel
backend/admin.py
AI predictions
- Prediction routes
backend/disease.py - Disease classifier
backend/disease/predictor.py - Fruit classifier
backend/fruit/predictor.py - Vegetable classifier
backend/vegetable/predictor.py - Weed detection
backend/weed/predictor.py - Crop recommender
backend/crop/predictor.py
Farm information
- Fertilizer advice
backend/fertilizer.py - Irrigation advice
backend/irrigation.py - Weather integration
backend/weather.py - Market prices
backend/market.py
History and insights
- SQL database
backend/database.py - Prediction history
backend/history.py - Prediction records
backend/prediction.py - Dashboard analytics
backend/dashboard_service.py - PDF reports
backend/report.py - Notifications
backend/notification.py
Other components
- User
Connections 27
- User → Web frontend: uses
README.md - Web frontend → FastAPI application: sends requests
README.md - FastAPI application → API router: includes
backend/main.py - FastAPI application → SQL database: initializes
backend/main.py - API router → Authentication routes: registers
backend/api_router.py - API router → Prediction routes: registers
backend/api_router.py - API router → Fertilizer advice: registers
backend/api_router.py - API router → Irrigation advice: registers
backend/api_router.py - API router → Weather integration: registers
backend/api_router.py - API router → Market prices: registers
backend/api_router.py - API router → Prediction history: registers
backend/api_router.py - API router → PDF reports: registers
backend/api_router.py - API router → Notifications: registers
backend/api_router.py - API router → Admin panel: registers
backend/api_router.py - Authentication routes → Authentication service: delegates
backend/auth.py - Authentication service → User persistence: uses
backend/auth_service.py - Prediction routes → Disease classifier: invokes
- Prediction routes → Fruit classifier: invokes
- Prediction routes → Vegetable classifier: invokes
- Prediction routes → Weed detection: invokes
- Prediction routes → Crop recommender: invokes
- Dashboard analytics → Prediction records: queries
backend/dashboard_service.py - Dashboard analytics → Prediction history: queries
backend/dashboard_service.py - Dashboard analytics → Weather integration: queries
backend/dashboard_service.py - Dashboard analytics → Market prices: queries
backend/dashboard_service.py - Prediction records → SQL database: uses
backend/prediction.py - Prediction history → SQL database: uses
backend/history.py