How creativearun/agriflow works
AgriFlow is a farm-to-market platform whose principal journey runs from farmer produce listing and quality/market analysis through buyer matching and aggregation to shipment planning and tracking. The tree contains a React client, a FastAPI intelligence service, and an Express logistics service; the README also describes a Spring core backend, but no corresponding source is present here. The graph preserves major documented stages and capabilities; unsampled service internals and cross-service wiring are omitted unless documented or visible in the excerpts.
Main entry points: main.py Intelligence API · agriculture_service.py Combined Analysis · services.js API Client · quality_service.py Quality Assessment
Components 28
Farmer and Buyer Client
- FarmFlow Interface
frontend/src/components/farmlink-app.jsx - Shipment Map
frontend/src/components/MapLeaflet.jsx - Voice Input
frontend/src/components/VoiceInputButton.jsx - Text to Speech
frontend/src/components/TextToSpeechButton.jsx - AI Assistant
frontend/src/components/AIAssistantModal.jsx - API Client
frontend/src/lib/api/services.js
Farm Intelligence
- Intelligence API
agriflow-farm-intelligence-api/app/main.py - Quality Assessment
agriflow-farm-intelligence-api/app/services/quality_service.py - Vision Model
agriflow-farm-intelligence-api/app/models/quality_model.py - Price Forecasting
agriflow-farm-intelligence-api/app/services/price_service.py - Price Model
agriflow-farm-intelligence-api/app/models/price_model.py - Demand Forecasting
agriflow-farm-intelligence-api/app/services/demand_service.py - Buyer Matching
agriflow-farm-intelligence-api/app/services/matching_service.py - Supply Aggregation
agriflow-farm-intelligence-api/app/services/aggregation_service.py - Combined Analysis
agriflow-farm-intelligence-api/app/services/agriculture_service.py - Multilingual Advice
agriflow-farm-intelligence-api/app/services/language_service.py
Shipment Logistics
- Logistics API
logistics-service/src/app.js - Shipment Management
logistics-service/src/controllers/shipment.controller.js - GPS Tracking
logistics-service/src/controllers/tracking.controller.js - Route Planning
logistics-service/src/controllers/route.controller.js - Route Recalculation
logistics-service/src/controllers/recalculation.controller.js - Recalculation Service
logistics-service/src/services/recalculation.service.js - Location State
logistics-service/src/services/tracking.service.js - Live Events
logistics-service/src/socket/socket.js
External Services
- OSRM Routing
- Hosted Vision Model
- Core Backend
Other components
- Farmer / Buyer
Connections 41
- Farmer / Buyer → FarmFlow Interface: uses
- FarmFlow Interface → API Client: requests data
frontend/src/components/farmlink-app.jsx - FarmFlow Interface → Shipment Map: renders
frontend/src/components/farmlink-app.jsx - FarmFlow Interface → AI Assistant: opens assistant
frontend/src/components/farmlink-app.jsx - AI Assistant → Voice Input: accepts speech
frontend/src/components/AIAssistantModal.jsx - AI Assistant → Text to Speech: speaks response
frontend/src/components/AIAssistantModal.jsx - Shipment Map → API Client: requests logistics
frontend/src/components/MapLeaflet.jsx - API Client → Core Backend: calls API
frontend/src/lib/api/services.js - API Client → Intelligence API: calls API
frontend/src/lib/api/services.js - API Client → Logistics API: calls API
frontend/src/lib/api/services.js - Intelligence API → Quality Assessment: routes requests
agriflow-farm-intelligence-api/app/main.py - Intelligence API → Price Forecasting: routes requests
agriflow-farm-intelligence-api/app/main.py - Intelligence API → Buyer Matching: routes requests
agriflow-farm-intelligence-api/app/main.py - Intelligence API → Supply Aggregation: routes requests
agriflow-farm-intelligence-api/app/main.py - Intelligence API → Combined Analysis: routes requests
agriflow-farm-intelligence-api/app/main.py - Quality Assessment → Vision Model: analyzes image
agriflow-farm-intelligence-api/app/services/quality_service.py - Quality Assessment → Multilingual Advice: localizes description
agriflow-farm-intelligence-api/app/services/quality_service.py - Vision Model → Hosted Vision Model: requests analysis
- Price Forecasting → Price Model: forecasts prices
agriflow-farm-intelligence-api/app/services/price_service.py - Price Forecasting → Multilingual Advice: formats advice
agriflow-farm-intelligence-api/app/services/price_service.py - Combined Analysis → Quality Assessment: assesses quality
agriflow-farm-intelligence-api/app/services/agriculture_service.py - Combined Analysis → Price Forecasting: forecasts prices
agriflow-farm-intelligence-api/app/services/agriculture_service.py - Combined Analysis → Demand Forecasting: forecasts demand
agriflow-farm-intelligence-api/app/services/agriculture_service.py - Combined Analysis → Buyer Matching: finds buyers
agriflow-farm-intelligence-api/app/services/agriculture_service.py - Combined Analysis → Supply Aggregation: aggregates insights
agriflow-farm-intelligence-api/app/services/agriculture_service.py - Buyer Matching → Multilingual Advice: localizes reasons
agriflow-farm-intelligence-api/app/services/matching_service.py - Logistics API → Shipment Management: routes requests
logistics-service/src/app.js - Logistics API → GPS Tracking: routes requests
logistics-service/src/app.js - Logistics API → Route Planning: routes requests
logistics-service/src/app.js - Logistics API → Route Recalculation: routes requests
logistics-service/src/app.js - GPS Tracking → Location State: updates location
logistics-service/src/controllers/tracking.controller.js - GPS Tracking → Route Planning: gets route
logistics-service/src/controllers/tracking.controller.js - GPS Tracking → Recalculation Service: recalculates route
logistics-service/src/controllers/tracking.controller.js - GPS Tracking → Live Events: emits location
logistics-service/src/controllers/tracking.controller.js - Route Recalculation → Recalculation Service: recalculates route
logistics-service/src/controllers/recalculation.controller.js - Recalculation Service → OSRM Routing: requests road route
logistics-service/src/services/recalculation.service.js - API Client → Live Events: subscribes updates
frontend/src/lib/api/services.js - Farmer / Buyer → Quality Assessment: submits produce
- Quality Assessment → Price Forecasting: continues workflow
- Buyer Matching → Supply Aggregation: contributes supply
- Supply Aggregation → Shipment Management: leads to order delivery