How vignesho6/synergy_forge works
ONION_GRADE is a Flutter onion-grading and procurement app backed by a FastAPI computer-vision service. The main workflow is to capture and upload onion samples, classify and grade them, then review reports and track batches; seller screens also support QR-based receipt checks and quality comparison. The backend pipeline explicitly coordinates detection and lot classification. The README and tree document additional app capabilities whose wiring is not shown in the sampled source, so those links are omitted.
Main entry points: analysis.py Analysis routes · deep_pipeline.py Grading pipeline · batch_provider.dart Batch state · main.py FastAPI app
Components 20
Flutter app
- Capture and review
ONION_GRADE/lib/screens/procurement - Procurement results
ONION_GRADE/lib/screens/procurement - Seller workflows
ONION_GRADE/lib/screens/seller - Batch state
ONION_GRADE/lib/providers/batch_provider.dart - Analysis state
ONION_GRADE/lib/providers/analysis_provider.dart - Analysis client
ONION_GRADE/lib/services/api_analysis_service.dart - Batch repository
ONION_GRADE/lib/services/batch_repository.dart
Backend API
- FastAPI app
ONION_GRADE/backend/main.py - Analysis routes
ONION_GRADE/backend/api/analysis.py - Auth routes
ONION_GRADE/backend/api/auth.py
Image grading
- Analysis service
ONION_GRADE/backend/services/analysis_service.py - Grading pipeline
ONION_GRADE/backend/dl/deep_pipeline.py - Onion detector
ONION_GRADE/backend/dl/yolo_detector.py - Lot classifier
ONION_GRADE/backend/dl/mobilenet_classifier.py - Model registry
ONION_GRADE/backend/dl/model_loader.py
Identity and data
- Supabase auth manager
ONION_GRADE/backend/auth/supabase_auth.py - Supabase data service
ONION_GRADE/backend/services/supabase_db.py
Other components
- Procurement user
- Seller
- Supabase
Connections 21
- Procurement user → Capture and review: captures samples
- Capture and review → Analysis state: submits analysis
- Analysis state → Analysis client: requests analysis
- Analysis client → Analysis routes: uploads images
- Analysis routes → Analysis service
- Analysis service → Grading pipeline: runs grading
- Grading pipeline → Onion detector: detects bulbs
- Grading pipeline → Lot classifier: classifies lot
- Onion detector → Model registry: loads detector
- Lot classifier → Model registry: loads classifier
- Analysis routes → Procurement results: returns analysis
- Procurement user → Batch state: manages batches
- Batch state → Batch repository: uses repository
- Batch repository → Supabase data service: persists batches
- Seller → Seller workflows: checks batch
- Seller workflows → Batch state: views batch
- FastAPI app → Analysis routes: mounts routes
- FastAPI app → Auth routes: mounts routes
- Auth routes → Supabase auth manager: validates tokens
- Supabase auth manager → Supabase: verifies identity
- Supabase data service → Supabase: reads and writes