How adithya-charan/cube-04-returns-manager works
CUBE Returns Manager is a local-first returns inspection prototype. An operator uses a dashboard to enter product/package identifiers, submit return images, and review the resulting inspection; the API stores media, gathers visual observations, applies deterministic identity, completeness, condition, and disposition rules, and persists a result that may require human resolution. QR verification is a separate binding lookup, not an input to inspection decisions. The graph covers both React clients and the backend’s documented capabilities; some backend call details and UI component internals were not sampled, so undocumented links are omitted.
Main entry points: main.py FastAPI routes · src/App.jsx Mobile app · src/App.jsx Website app · CaptureView.jsx Photo capture
Components 22
Operator clients
- Mobile app
mobile/src/App.jsx - Website app
website/src/App.jsx - Dashboard view
website/src/components/DashboardView.jsx - QR entry
website/src/components/QRScanView.jsx - Photo capture
website/src/components/CaptureView.jsx - Inspection detail
website/src/components/InspectionDetailView.jsx
API workflows
- FastAPI routes
src/main.py - QR binding lookup
src/main.py - Media handling
src/main.py - Inspection orchestration
src/main.py - Review resolution
src/main.py
Inspection logic
- Vision observations
src/vision.py - Decision rules
src/engine.py - Domain models
src/models.py
Persistence
- Media storage
src/storage.py - Return repository
src/repository.py - Database tables
src/database.py
Vision providers
- Ollama vision
src/vision_ollama.py - YOLO detector
src/vision_yolo.py
Other components
- Returns operator
- Ollama service
- S3-compatible storage
Connections 31
- Returns operator → Mobile app: uses
README.md - Returns operator → Website app: uses
README.md - Website app → Dashboard view: renders
website/src/App.jsx - Website app → QR entry: renders
website/src/App.jsx - Website app → Photo capture: renders
website/src/App.jsx - Website app → Inspection detail: renders
website/src/App.jsx - Dashboard view → FastAPI routes: loads reviews
README.md - QR entry → QR binding lookup: verifies identifiers
README.md - Photo capture → Media handling: uploads images
website/src/components/CaptureView.jsx - Photo capture → Inspection orchestration: submits inspection
website/src/components/CaptureView.jsx - Inspection detail → FastAPI routes: loads record
README.md - Inspection detail → Review resolution: resolves review
README.md - Mobile app → FastAPI routes: loads reviews
mobile/src/App.jsx - Mobile app → QR binding lookup: verifies identifiers
mobile/src/App.jsx - Mobile app → Media handling: uploads images
mobile/src/App.jsx - Mobile app → Inspection orchestration: submits inspection
mobile/src/App.jsx - FastAPI routes → QR binding lookup: routes binding
src/main.py - FastAPI routes → Media handling: routes media
src/main.py - FastAPI routes → Inspection orchestration: routes inspection
src/main.py - FastAPI routes → Review resolution: routes reviews
src/main.py - Media handling → Media storage: stores file
src/main.py - Media storage → S3-compatible storage: uploads objects
src/storage.py - Inspection orchestration → Vision observations: requests observations
src/main.py - Inspection orchestration → Decision rules: evaluates observations
src/main.py - Inspection orchestration → Return repository: persists decision
src/main.py - Vision observations → Ollama vision: provider implementation
src/vision_ollama.py - Vision observations → YOLO detector: optional detector
src/vision_yolo.py - Ollama vision → Ollama service: requests inference
README.md - Decision rules → Domain models: uses types
src/engine.py - Return repository → Database tables: queries and writes
src/repository.py - Review resolution → Return repository: loads return
src/main.py