How frontfury/deshi-cart-client works
DeshiCart’s checked-in product is a React storefront and account interface; its main user journey is browsing products, adding items to a server-backed cart, and using customer, seller, or admin pages. Firebase provides client authentication, while an authenticated Axios client sends API requests to a separately hosted backend. The README describes broader product, order, admin, and email capabilities, but no backend source is present in this tree. Unsampled capabilities are represented only where the README supports them; implementation details and several API interactions remain unverified.
Main entry points: useAxiosSecure.jsx Secure API client · useAuth.jsx Auth hook · router.jsx Route map · useRole.jsx Role lookup
Components 22
Storefront and routing
- Route map
src/routes/router.jsx - Storefront
src/App.jsx - Site shell
src/layouts/RootLayout.jsx - Navigation
src/pages/Shared/Navbar/Navbar.jsx - Footer
src/pages/Shared/Footer/Footer.jsx
Identity and access
- Account entry
src/App.jsx - Auth provider
src/context/AuthContext/AuthProvider.jsx - Auth context
src/context/AuthContext/AuthContext.jsx - Firebase Auth
src/firebase/firebase.init.js - Auth hook
src/hooks/useAuth.jsx - Route guards
src/routes/RoleRoute.jsx - Private guard
src/routes/PrivateRoute.jsx - Role lookup
src/hooks/useRole.jsx
Commerce and accounts
- Product workspace
src/pages/AccountPages.jsx - Customer account
src/pages/AccountPages.jsx - Profile hooks
src/hooks/useSaveProfile.jsx - Seller products
src/hooks/useSellerProducts.jsx - Product creation
src/hooks/useCreateProduct.jsx - User sync
src/hooks/useCreateUser.jsx
API access
- Secure API client
src/hooks/useAxiosSecure.jsx - DeshiCart API
Other components
- Shopper
Connections 34
- Shopper → Route map: opens pages
src/routes/router.jsx - Route map → Site shell: uses layout
src/routes/router.jsx - Route map → Storefront: routes to
src/routes/router.jsx - Route map → Private guard: protects pages
src/routes/router.jsx - Route map → Route guards: checks roles
src/routes/router.jsx - Site shell → Navigation: renders
src/layouts/RootLayout.jsx - Site shell → Footer: renders
src/layouts/RootLayout.jsx - Shopper → Account entry: signs in
- Auth provider → Auth context: provides state
src/context/AuthContext/AuthProvider.jsx - Auth provider → Firebase Auth: uses auth
src/context/AuthContext/AuthProvider.jsx - Auth hook → Auth context: reads context
src/hooks/useAuth.jsx - Private guard → Auth hook: checks user
src/routes/PrivateRoute.jsx - Route guards → Auth hook: checks user
src/routes/RoleRoute.jsx - Route guards → Role lookup: checks role
src/routes/RoleRoute.jsx - Navigation → Role lookup: loads role
src/pages/Shared/Navbar/Navbar.jsx - Role lookup → Auth hook: reads user
src/hooks/useRole.jsx - Role lookup → Firebase Auth: reads token
src/hooks/useRole.jsx - Role lookup → Secure API client: requests role
src/hooks/useRole.jsx - Storefront → Auth hook: reads user
src/App.jsx - Storefront → Secure API client: adds cart item
src/App.jsx - Storefront → User sync: syncs user
src/App.jsx - Customer account → Profile hooks: saves profile
src/pages/AccountPages.jsx - Customer account → Secure API client: loads commerce data
src/pages/AccountPages.jsx - Customer account → Auth hook: reads user
src/pages/AccountPages.jsx - Product workspace → Product creation: creates listing
src/pages/AccountPages.jsx - Product workspace → Seller products: loads listings
src/pages/AccountPages.jsx - Profile hooks → Secure API client: sends profile
src/hooks/useSaveProfile.jsx - Seller products → Secure API client: loads products
src/hooks/useSellerProducts.jsx - Product creation → Secure API client: submits product
src/hooks/useCreateProduct.jsx - User sync → DeshiCart API: posts user
src/hooks/useCreateUser.jsx - Secure API client → Firebase Auth: gets token
src/hooks/useAxiosSecure.jsx - Secure API client → Auth hook: logs out on error
src/hooks/useAxiosSecure.jsx - Secure API client → DeshiCart API: sends requests
src/hooks/useAxiosSecure.jsx - DeshiCart API → Shopper: serves commerce APIs
README.md