How mohitsinghs0/foodfax-shop works
FoodFax is a shop-owner dashboard for onboarding and verifying a merchant, then managing its menu, orders, sales, and shop settings. The browser app routes users through authentication and setup into operational screens; shared owner state coordinates much of the application and accesses Supabase. The README describes only a generic AI Studio app, so product capabilities are inferred from the source index and excerpts. Unsampled screens are represented by their paths, but only evidenced relationships are drawn.
Main entry points: OwnerAppContext.tsx Owner app state · App.tsx Screen routing · supabaseClient.ts Supabase client · ShopSetupScreen.tsx Shop setup and KYC
Components 30
Application shell
- Web entry
src/main.tsx - Screen routing
src/App.tsx
Merchant operations
- Sign-in and registration
src/screens/LoginScreen.tsx - Shop setup and KYC
src/screens/ShopSetupScreen.tsx - KYC status
src/screens/KycStatusScreen.tsx - Dashboard
src/screens/DashboardScreen.tsx - Menu management
src/screens/AddEditMenuItemModal.tsx - Menu categories
src/screens/CategoryManagerModal.tsx - Order management
src/screens/OrdersScreen.tsx - Sales reporting
src/screens/SalesScreen.tsx - Shop profile
src/screens/ShopProfileModal.tsx - Shop settings
src/screens/ShopSettingsModal.tsx - Shop QR
src/screens/ShopQrScreen.tsx - Fulfillment analytics
src/components/FulfillmentAnalyticsChart.tsx - Customer discovery map
src/components/CustomerDiscoveryMapWidget.tsx - Customer proximity
src/components/CustomerProximityRadar.tsx - Optimization diagnostics
src/components/OptimizationDiagnosticsModal.tsx
State and services
- Owner app state
src/context/OwnerAppContext.tsx - Supabase client
src/lib/supabaseClient.ts - Supabase
- Order service
src/services/orderService.ts - Shop service
src/services/shopService.ts - Document and image storage
src/services/storageService.ts - API cache
src/services/apiCache.ts - Notifications
src/services/notificationService.ts - Sound feedback
src/services/soundService.ts
Security and media
- Authentication safeguards
src/services/authSecurityService.ts - Tenant and file validation
src/utils/security.ts - Image compression
src/utils/imageCompression.ts
Other components
- Shop owner
Connections 26
- Shop owner → Web entry: opens app
src/main.tsx - Web entry → Screen routing: renders
src/main.tsx - Screen routing → Owner app state: provides state
src/App.tsx - Screen routing → Sign-in and registration: routes to
src/App.tsx - Screen routing → Shop setup and KYC: routes to
src/App.tsx - Screen routing → KYC status: routes to
src/App.tsx - Screen routing → Dashboard: routes to
src/App.tsx - Screen routing → Order management: routes to
src/App.tsx - Screen routing → Sales reporting: routes to
src/App.tsx - Owner app state → Supabase client: gets client
src/context/OwnerAppContext.tsx - Supabase client → Supabase: connects to
src/lib/supabaseClient.ts - Owner app state → Tenant and file validation: validates inputs
src/context/OwnerAppContext.tsx - Shop setup and KYC → Owner app state: submits shop data
src/screens/ShopSetupScreen.tsx - Shop setup and KYC → Tenant and file validation: validates KYC file
src/screens/ShopSetupScreen.tsx - Shop setup and KYC → Image compression: compresses uploads
src/screens/ShopSetupScreen.tsx - Document and image storage → Tenant and file validation: validates document
src/services/storageService.ts - Document and image storage → Image compression: compresses image
src/services/storageService.ts - Document and image storage → Supabase client: uploads to
src/services/storageService.ts - Order management → Owner app state: uses shared state
src/screens/OrdersScreen.tsx - Owner app state → Order service: uses service
- Order service → Supabase client: queries data
src/services/orderService.ts - Shop service → Supabase client: queries data
src/services/shopService.ts - Owner app state → Notifications: uses notifications
src/context/OwnerAppContext.tsx - Owner app state → Sound feedback: uses sound
src/context/OwnerAppContext.tsx - Optimization diagnostics → Owner app state: reads diagnostics
src/components/OptimizationDiagnosticsModal.tsx - Optimization diagnostics → API cache: inspects cache
src/components/OptimizationDiagnosticsModal.tsx