How saadosama10/hattah-store works
HATTAH is a multilingual catalogue and WhatsApp-order storefront, with a private admin panel for managing products, categories, and inventory. Customers browse localized listings, inspect products and variants, then order directly or build a persisted cart for WhatsApp checkout. The owner signs in to administer the catalogue and inventory. The graph follows documented runtime relationships and indexed source references; unsampled implementation details are omitted where connections cannot be verified.
Main entry points: queries.ts Catalogue queries · admin-auth.ts Session security · products.ts Product actions · inventory.ts Inventory actions
Components 30
Storefront
- Home page
src/app/[locale]/(site)/page.tsx - Shop page
src/app/[locale]/(site)/shop/page.tsx - Shop filters
src/components/shop/ShopClient.tsx - Product page
src/app/[locale]/(site)/product/[id]/page.tsx - Offers page
src/app/[locale]/(site)/offers/page.tsx
Ordering
- Purchase actions
src/components/product/ProductPurchaseActions.tsx - Cart state
src/contexts/CartContext.tsx - Cart drawer
src/components/cart/CartDrawer.tsx - Order message
src/lib/whatsapp.ts
Admin
- Admin login
src/app/[locale]/admin/login/page.tsx - Login form
src/components/admin/LoginForm.tsx - Auth actions
src/actions/auth.ts - Session security
src/lib/admin-auth.ts - Product management
src/components/admin/ProductForm.tsx - Product actions
src/actions/products.ts - Category manager
src/components/admin/CategoryManager.tsx - Category actions
src/actions/categories.ts - Inventory page
src/app/[locale]/admin/(protected)/inventory/page.tsx - Inventory ledger
src/components/admin/InventoryLog.tsx - Inventory actions
src/actions/inventory.ts
Shared platform
- Locale and session routing
src/middleware.ts - Catalogue queries
src/lib/supabase/queries.ts - Public data client
src/lib/supabase/public.ts - Privileged data client
src/lib/supabase/service.ts - Locale routing
src/i18n/routing.ts
Other components
- Customer
- Shop owner
- Supabase database
- Image storage
Connections 42
- Customer → Home page: browses
README.md - Customer → Shop page: browses
README.md - Customer → Product page: selects variants
README.md - Home page → Catalogue queries: loads catalogue
src/app/[locale]/(site)/page.tsx - Shop page → Catalogue queries: loads listings
src/app/[locale]/(site)/shop/page.tsx - Shop page → Shop filters: renders
src/app/[locale]/(site)/shop/page.tsx - Shop filters → Customer: filters results
README.md - Product page → Catalogue queries: loads product
src/app/[locale]/(site)/product/[id]/page.tsx - Product page → Purchase actions: renders
src/app/[locale]/(site)/product/[id]/page.tsx - Purchase actions → Cart state: adds item
src/components/product/ProductPurchaseActions.tsx - Purchase actions → Order message: builds order
src/components/product/ProductPurchaseActions.tsx - Cart state → Cart drawer: provides state
src/components/cart/CartDrawer.tsx - Cart drawer → Order message: builds checkout
src/components/cart/CartDrawer.tsx - Order message → WhatsApp: opens prefilled chat
README.md - WhatsApp → Shop owner: delivers order
README.md - Offers page → Catalogue queries: loads sale items
src/app/[locale]/(site)/offers/page.tsx - Customer → Offers page: views offers
README.md - Customer → Admin login: requests sign-in
README.md - Admin login → Login form: renders
src/app/[locale]/admin/login/page.tsx - Login form → Auth actions: submits credentials
- Auth actions → Session security: checks credentials
src/actions/auth.ts - Locale and session routing → Session security: checks session
README.md - Locale and session routing → Locale routing: routes locales
src/middleware.ts - Shop owner → Product management: edits catalogue
README.md - Product management → Product actions: submits changes
README.md - Product actions → Session security: requires session
src/actions/products.ts - Product actions → Privileged data client: writes products
README.md - Product actions → Image storage: uploads images
README.md - Shop owner → Category manager: manages categories
README.md - Category manager → Category actions: submits changes
src/components/admin/CategoryManager.tsx - Category actions → Session security: requires session
src/actions/categories.ts - Category actions → Privileged data client: writes categories
README.md - Shop owner → Inventory page: records stock
README.md - Inventory page → Inventory ledger: renders ledger
src/app/[locale]/admin/(protected)/inventory/page.tsx - Inventory page → Inventory actions: supplies actions
src/app/[locale]/admin/(protected)/inventory/page.tsx - Inventory ledger → Inventory actions: updates ledger
src/components/admin/InventoryLog.tsx - Inventory actions → Session security: requires session
src/actions/inventory.ts - Inventory actions → Privileged data client: writes ledger
README.md - Catalogue queries → Public data client: queries through
src/lib/supabase/queries.ts - Public data client → Supabase database: reads catalogue
README.md - Privileged data client → Supabase database: writes admin data
README.md - Customer → Locale routing: chooses language
README.md