How yaramohammed20/techmart-e-commerce works
TechMart is a Next.js storefront backed by the RouteMisr commerce API. Shoppers browse catalogs and product details, add items to cart or wishlist, then review the cart and proceed through checkout; authenticated users can also manage profiles, addresses, and order history. The graph highlights these domain stages and the API client as the internal integration layer. Checkout and order-history capabilities are included as documented or present in the tree; their detailed calls are not shown in the excerpts.
Main entry points: api.ts Commerce API client · ProductCard.tsx Product card · products/page.tsx Catalog browsing · cart/page.tsx Cart management
Components 28
Storefront
- Home
src/app/page.tsx - Catalog browsing
src/app/(pages)/products/page.tsx - Categories
src/app/(pages)/categories/page.tsx - Category detail
src/app/(pages)/categories/[id]/page.tsx - Subcategory
src/app/(pages)/subcategory/[id]/page.tsx - Brands
src/app/(pages)/brands/page.tsx - Brand detail
src/app/(pages)/brands/[id]/page.tsx - Product detail
src/app/(pages)/products/[id]/page.tsx - Product card
src/components/products/ProductCard.tsx - Loading indicator
src/components/shared/LoadingSpinner.tsx - Rating display
src/helpers/rating.tsx - Price formatting
src/helpers/currency.ts - Button UI
src/components/ui/button.tsx - Separator UI
src/components/ui/separator.tsx - Navigation
src/components/layout/navbar.tsx - Footer
src/components/layout/footer.tsx
Shopping
- Cart management
src/app/(pages)/cart/page.tsx - Checkout
src/app/(pages)/checkout/page.tsx - Wishlist
src/app/(pages)/wishlist/page.tsx - Wishlist control
src/components/ui/WishlistButton.tsx
Account
- Sign in
src/app/auth/signin/page.tsx - Registration
src/app/auth/register/page.tsx - Auth route
src/app/api/auth/[...nextauth]/route.ts - Profile and addresses
src/app/user/page.tsx - Order history
src/lib/api.ts
Integration
- Commerce API client
src/lib/api.ts
Other components
- Shopper
- RouteMisr API
Connections 36
- Shopper → Home: opens
- Shopper → Catalog browsing: browses
- Shopper → Categories: browses
- Shopper → Brands: browses
src/app/(pages)/brands/page.tsx - Catalog browsing → Commerce API client: fetches listings
src/app/(pages)/products/page.tsx - Categories → Commerce API client: loads categories
src/app/(pages)/categories/page.tsx - Category detail → Commerce API client: loads category
src/app/(pages)/categories/[id]/page.tsx - Subcategory → Commerce API client: loads products
src/app/(pages)/subcategory/[id]/page.tsx - Brands → Commerce API client: loads brands
src/app/(pages)/brands/page.tsx - Brand detail → Commerce API client: loads products
src/app/(pages)/brands/[id]/page.tsx - Catalog browsing → Product card: renders
src/app/(pages)/products/page.tsx - Product card → Commerce API client: adds cart item
src/components/products/ProductCard.tsx - Product card → Commerce API client: adds wishlist item
src/components/products/ProductCard.tsx - Product card → Rating display: renders stars
src/components/products/ProductCard.tsx - Product card → Price formatting: formats price
src/components/products/ProductCard.tsx - Product card → Button UI: uses
src/components/products/ProductCard.tsx - Product detail → Commerce API client: loads product
src/app/(pages)/products/[id]/page.tsx - Cart management → Commerce API client: reads and updates
src/app/(pages)/cart/page.tsx - Cart management → Price formatting: formats totals
src/app/(pages)/cart/page.tsx - Cart management → Checkout: links to
src/app/(pages)/cart/page.tsx - Checkout → Commerce API client: starts checkout
src/app/(pages)/checkout/page.tsx - Wishlist → Commerce API client: loads wishlist
src/app/(pages)/wishlist/page.tsx - Wishlist control → Commerce API client: updates wishlist
src/components/ui/WishlistButton.tsx - Sign in → Commerce API client: authenticates
src/lib/api.ts - Registration → Commerce API client: registers account
- Shopper → Sign in: signs in
- Shopper → Registration: registers
- Auth route → RouteMisr API: auth integration
- Profile and addresses → Commerce API client: manages profile
src/app/user/page.tsx - Order history → RouteMisr API: reads orders
- Commerce API client → RouteMisr API: sends requests
src/lib/api.ts - Catalog browsing → Loading indicator: shows while loading
src/app/(pages)/products/page.tsx - Product detail → Loading indicator: shows while loading
src/app/(pages)/products/[id]/page.tsx - Wishlist → Loading indicator: shows while loading
src/app/(pages)/wishlist/page.tsx - Navigation → Commerce API client: utility import
- Shopper → Profile and addresses: manages account