How chifie/sokodigital_frontend works
SokoDigital is a Tanzania-focused buyer-and-seller marketplace. Buyers discover products, inspect listings, maintain a cart or wishlist, check out, and track orders; sellers onboard and manage listings and storefronts, while administrators moderate and review marketplace activity. The React app routes these experiences through page components, with shared state, mock catalog data, and optional Supabase services. README documents the broader feature set; some page and backend internals were not sampled, so those connections are shown only where the README or indexed references support them.
Main entry points: App.tsx Route application · ProductCard.tsx Product cards · ProductDetailPage.tsx Product details · cart-context.tsx Cart state
Components 32
App and discovery
- Route application
src/App.tsx - Home and deals
src/pages/Landing.tsx - Browse catalog
src/pages/MarketplacePage.tsx - Product details
src/pages/ProductDetailPage.tsx - Categories and shops
src/pages/CategoriesPage.tsx - Promotions
src/pages/DealsPage.tsx - Product cards
src/components/product/ProductCard.tsx - Mock catalog data
src/lib/constants.ts
Buyer commerce
- Cart state
src/lib/cart-context.tsx - Cart and checkout
src/pages/CartPage.tsx - Checkout
src/pages/CheckoutPage.tsx - Order tracking
src/pages/OrderConfirmationPage.tsx - Wishlist
src/lib/wishlist-context.tsx
Accounts and operations
- Authentication
src/lib/auth.tsx - Login and signup
src/pages/AuthPage.tsx - Buyer dashboard
src/pages/DashboardPage.tsx - Seller management
src/pages/SellerOnboardingPage.tsx - Seller listings
src/pages/SellerListingsPage.tsx - Listing editor
src/pages/SellerProductFormPage.tsx - Seller storefront
src/pages/StorePage.tsx - Buyer messaging
src/pages/MessagesPage.tsx - Admin dashboard
src/pages/AdminDashboardPage.tsx
Shared services
- AI assistant
src/components/site/AIWidget.tsx - AI chat page
src/pages/AIChatPage.tsx - AI edge function
supabase/functions/soko-ai/index.ts - AI gateway
supabase/functions/_shared/ai-gateway.ts - Supabase client
src/integrations/supabase/client.ts - Newsletter signup
src/components/layout/Footer.tsx - Newsletter function
supabase/functions/newsletter-subscribe/index.ts - Language support
src/lib/i18n.tsx - Theme support
src/hooks/use-theme.tsx
Other components
- Buyer or seller
Connections 44
- Buyer or seller → Route application: opens
src/App.tsx - Route application → Home and deals: routes to
src/App.tsx - Route application → Browse catalog: routes to
src/App.tsx - Route application → Product details: routes to
src/App.tsx - Route application → Categories and shops: routes to
src/App.tsx - Route application → Promotions: routes to
README.md - Route application → Cart and checkout: routes to
README.md - Route application → Checkout: routes to
README.md - Route application → Order tracking: routes to
README.md - Route application → Login and signup: routes to
README.md - Route application → Buyer dashboard: routes to
README.md - Route application → Seller management: routes to
src/App.tsx - Route application → Seller listings: routes to
README.md - Route application → Listing editor: routes to
README.md - Route application → Seller storefront: routes to
README.md - Route application → Buyer messaging: routes to
README.md - Route application → Admin dashboard: routes to
src/App.tsx - Route application → AI chat page: routes to
README.md - Home and deals → Product cards: renders
src/pages/Landing.tsx - Browse catalog → Product cards: renders
src/pages/MarketplacePage.tsx - Product details → Product cards: renders
src/pages/ProductDetailPage.tsx - Home and deals → Mock catalog data: reads
src/pages/Landing.tsx - Browse catalog → Mock catalog data: reads
src/pages/MarketplacePage.tsx - Product details → Mock catalog data: reads
src/pages/ProductDetailPage.tsx - Product cards → Cart state: updates
src/components/product/ProductCard.tsx - Product details → Cart state: updates
src/pages/ProductDetailPage.tsx - Cart and checkout → Cart state: uses state
README.md - Checkout → Cart state: uses state
README.md - Checkout → Order tracking: creates order
- Product cards → Wishlist: supports saving
- Login and signup → Authentication: authenticates
src/pages/AuthPage.tsx - Authentication → Supabase client: reads roles
src/lib/auth.tsx - Buyer dashboard → Authentication: uses identity
- Seller management → Seller listings: manages listings
- Seller listings → Listing editor: edits listings
- Seller management → Seller storefront: publishes storefront
- AI assistant → Supabase client: uses client
src/components/site/AIWidget.tsx - AI chat page → AI edge function: requests answers
README.md - AI assistant → AI edge function: requests answers
- AI edge function → AI gateway: delegates
supabase/functions/soko-ai/index.ts - Newsletter signup → Newsletter function: submits signup
README.md - Newsletter signup → Supabase client: uses client
src/components/layout/Footer.tsx - Language support → Buyer or seller: localizes interface
README.md - Theme support → Buyer or seller: sets appearance
README.md