How abood207040/el-gaafar-store works
EL-Gaafar Store is a bilingual storefront and store-operations app backed by Supabase. Customers browse the catalog, build a cart, submit delivery or pickup orders, and track them; staff manage products, inventory, orders, customers, and delivery settings, with a separate in-store POS, shifts, returns, and customer debts. The map keeps routing, auth, and localization as shared internal layers. Unsampled pages are included where the README and source index establish capabilities; links involving their runtime calls are omitted unless documented or evidenced.
Main entry points: App.jsx Router and Cart · authService.js Supabase Client and Auth · productsService.js Product Data Service · AdminDashboardPage.jsx Admin Console
Components 30
Customer Storefront
- Store Catalog
src/pages/ShopPage.jsx - Product Details
src/pages/ProductDetailsPage.jsx - Cart and Checkout
src/pages/CheckoutPage.jsx - Order Tracking
src/pages/OrderDetailsPage.jsx - Store Home
src/pages/HomePage.jsx - Customer Account
src/pages/account/AccountDashboard.jsx
Online Administration
- Admin Console
src/pages/admin/AdminDashboardPage.jsx - Product Management
src/pages/admin/AdminProductFormPage.jsx - Catalog Management
src/pages/admin/AdminCatalogPage.jsx - Order Management
src/pages/admin/AdminOrdersPage.jsx - Inventory
src/pages/admin/AdminInventoryPage.jsx - Customer Management
src/pages/admin/AdminCustomersPage.jsx - Delivery Settings
src/pages/admin/AdminDeliveryPage.jsx
In-Store Operations
- Point of Sale
src/components/pos/PosCheckout.jsx - POS State
src/components/pos/PosContext.jsx - Offline Sales and Returns
src/services/adminOfflineService.js - Shifts and Debts
src/components/pos/ShiftManager.jsx
Shared Services
- Router and Cart
src/App.jsx - Auth Provider
src/hooks/useAuth.jsx - Supabase Client and Auth
src/services/authService.js - Catalog Options Hook
src/hooks/useCatalogOptions.js - Product Data Service
src/services/productsService.js - Order Data Service
src/services/ordersService.js - Delivery Data Service
src/services/deliveryService.js - Image Upload
src/services/storageService.js - Localization
src/i18n/Localization.jsx - Order and Stock Rules
src/constants/domain.js
Backend Platform
- Supabase Auth and Database
- Supabase Storage
Other components
- Customer
Connections 37
- Customer → Router and Cart: opens
src/App.jsx - Router and Cart → Store Home: routes to
src/App.jsx - Router and Cart → Store Catalog: routes to
src/App.jsx - Router and Cart → Product Details: routes to
src/App.jsx - Router and Cart → Cart and Checkout: routes to
src/App.jsx - Router and Cart → Order Tracking: routes to
src/App.jsx - Router and Cart → Customer Account: routes to
src/App.jsx - Router and Cart → Admin Console: guards and routes
src/App.jsx - Auth Provider → Supabase Client and Auth: calls
src/hooks/useAuth.jsx - Supabase Client and Auth → Supabase Auth and Database: auth requests
src/services/authService.js - Catalog Management → Catalog Options Hook: uses
src/hooks/useCatalogOptions.js - Catalog Options Hook → Supabase Client and Auth: reads and writes
src/hooks/useCatalogOptions.js - Product Management → Product Data Service: manages products
src/pages/admin/AdminProductFormPage.jsx - Product Management → Image Upload: uploads images
src/pages/admin/AdminProductFormPage.jsx - Catalog Management → Product Data Service: manages catalog
src/pages/admin/AdminCatalogPage.jsx - Catalog Management → Image Upload: uploads images
src/pages/admin/AdminCatalogPage.jsx - Product Data Service → Supabase Client and Auth: queries
src/services/productsService.js - Image Upload → Supabase Client and Auth: uses client
src/services/storageService.js - Image Upload → Supabase Storage: uploads and reads URLs
src/services/storageService.js - Cart and Checkout → Order Data Service: submits orders
src/pages/CheckoutPage.jsx - Cart and Checkout → Delivery Data Service: gets delivery pricing
src/pages/CheckoutPage.jsx - Order Tracking → Order Data Service: loads order details
src/pages/OrderDetailsPage.jsx - Order Data Service → Supabase Client and Auth: queries
src/services/ordersService.js - Delivery Settings → Delivery Data Service: manages rates
src/pages/admin/AdminDeliveryPage.jsx - Delivery Data Service → Supabase Client and Auth: queries
src/services/deliveryService.js - Admin Console → Order Management: routes within
- Admin Console → Inventory: routes within
- Admin Console → Customer Management: routes within
- Order Management → Order Data Service: manages orders
- Point of Sale → POS State: uses state
- POS State → Offline Sales and Returns: calls
src/components/pos/PosContext.jsx - Offline Sales and Returns → Supabase Client and Auth: queries and invokes RPC
src/services/adminOfflineService.js - Offline Sales and Returns → Product Data Service: loads products
src/services/adminOfflineService.js - Shifts and Debts → Offline Sales and Returns: manages shifts
src/components/pos/ShiftManager.jsx - Inventory → Product Data Service: reads products
- Localization → Order and Stock Rules: translates domain states
src/i18n/Localization.jsx - Product Data Service → Order and Stock Rules: uses stock rules
src/services/productsService.js