How rithishkumar7/food_product_authenticator works
This repository is a React application for checking food-product authenticity against FSSAI-related records, not the Supabase CLI described in the supplied README. The main flow is image scanning or manual entry, followed by OCR when applicable, verification, and display of results; users can also browse products and submit reports, while administrators manage records and review reports. Edges reflect sampled calls, routing, or source-index references. Several page and feature implementations were not sampled, so their internal links are omitted.
Main entry points: VerifyPage.tsx Verification page · App.tsx App routing · AdminPage.tsx Admin console · client.ts Supabase client
Components 19
Application shell
- App routing
src/App.tsx - Home page
src/pages/Index.tsx
Product verification
- Verification page
src/pages/VerifyPage.tsx - Image upload
src/components/ImageUpload.tsx - Manual entry
src/components/ManualEntryForm.tsx - OCR extraction
src/lib/ocr.ts - Verification checks
src/lib/verification.ts - Verification results
src/components/VerificationResults.tsx
Catalog and reports
- Product catalog
src/pages/ProductsPage.tsx - Report submission
src/pages/ReportPage.tsx - Report dialog
src/components/ReportDialog.tsx
Administration and data
- Admin console
src/pages/AdminPage.tsx - Admin authentication
src/contexts/AdminAuthContext.tsx - Product data hooks
src/hooks/useProducts.ts - Product editor
src/components/EditProductDialog.tsx - Product domain types
src/types/product.ts - Supabase client
src/integrations/supabase/client.ts
Other components
- User
- Supabase backend
Connections 23
- User → App routing: opens
src/App.tsx - App routing → Home page: routes to
src/App.tsx - App routing → Verification page: routes to
src/App.tsx - App routing → Product catalog: routes to
src/App.tsx - App routing → Report submission: routes to
src/App.tsx - App routing → Admin console: routes to
src/App.tsx - Verification page → Image upload: renders
src/pages/VerifyPage.tsx - Verification page → Manual entry: renders
src/pages/VerifyPage.tsx - Verification page → OCR extraction: calls
src/pages/VerifyPage.tsx - Verification page → Verification checks: calls
src/pages/VerifyPage.tsx - Verification page → Verification results: renders
src/pages/VerifyPage.tsx - Verification page → Report dialog: renders
src/pages/VerifyPage.tsx - OCR extraction → Product domain types: uses types
src/lib/ocr.ts - Verification checks → Product domain types: uses types
src/lib/verification.ts - Verification checks → Supabase client: queries
src/lib/verification.ts - Report submission → Product data hooks: uses
src/pages/ReportPage.tsx - Admin console → Admin authentication: uses
src/pages/AdminPage.tsx - Admin console → Product data hooks: uses
src/pages/AdminPage.tsx - Admin console → Product editor: renders
src/pages/AdminPage.tsx - Admin console → Product domain types: uses types
src/pages/AdminPage.tsx - Admin authentication → Supabase client: authenticates via
src/contexts/AdminAuthContext.tsx - Product data hooks → Supabase client: reads and writes
src/hooks/useProducts.ts - Supabase client → Supabase backend: connects to
src/integrations/supabase/client.ts