How vignesho6/onion-grader works
Onion Quality AI is a farmer-facing onion grading application. Its documented workflow is to capture onion images, assess defects and size, estimate Grade A/URS proportions, and produce a quality report; authenticated routes also support farmer profiles and report history. The tree identifies separate analysis, reporting, and data modules, but their implementation and route-to-module calls were not sampled, so those links are not asserted. The sampled code confirms Supabase-backed authentication and client-side PDF generation.
Main entry points: client.ts Supabase client · auth.tsx Sign in · route.tsx Auth guard · report-pdf.ts PDF export
Components 19
Access and app shell
- Sign in
src/routes/auth.tsx - Auth guard
src/routes/_authenticated/route.tsx - App shell
src/components/app-shell.tsx - Farmer profile
src/routes/_authenticated/profile.tsx - Application router
src/router.tsx
Image grading
- Image capture
src/routes/_authenticated/camera.tsx - AI vision
src/lib/ai-vision.server.ts - Variety detection
src/lib/variety-detect.server.ts - Onion grading
src/lib/onion.server.ts - Small onion grading
src/lib/small-onion.server.ts
Reports
- Report model
src/lib/report-shape.ts - Report display
src/components/report-view.tsx - Report history
src/routes/_authenticated/reports.tsx - Report detail
src/routes/_authenticated/report.$id.tsx - PDF export
src/lib/report-pdf.ts
Supabase integration
- Supabase client
src/integrations/supabase/client.ts - Admin client
src/integrations/supabase/client.server.ts - Supabase
Other components
- Farmer
Connections 13
- Farmer → Sign in: signs in
- Sign in → Supabase client: authenticates
- Auth guard → Supabase client: checks user
- Supabase client → Supabase: auth and data
- Admin client → Supabase: admin access
- Farmer → Image capture: captures images
- Farmer → Farmer profile: manages profile
- Farmer → Report history: views reports
- Farmer → Report detail: opens report
- Farmer → PDF export: exports report
- Report display → Report model: formats verdict
- PDF export → Report model: formats verdict
- Application router → Auth guard: routes access