How minhkiet05/stationery-store works
Stationery-store is a browser-based stationery shop with customer shopping, account, and review flows plus an administration dashboard. Customers enter through routed storefront pages, discover products, inspect details and reviews, manage a cart, and access account and order features; review submission is a distinct post-purchase stage. The frontend’s shared API, query cache, and session scoping form the internal service layer. The README gives little product detail, so capabilities are grounded mainly in the route tree and source index. Backend implementation is not present in the supplied tree.
Main entry points: api.ts HTTP API client · ProductDetail.tsx Product detail · App.tsx Route application · storeQueries.ts Store query layer
Components 29
Storefront
- Route application
frontend/src/App.tsx - Home catalog
frontend/src/pages/homePage/HomePage.tsx - Product search
frontend/src/pages/searchPage/SearchPage.tsx - Catalog data
frontend/src/pages/searchPage/catalogData.ts - Product detail
frontend/src/pages/productDetail/ProductDetail.tsx - Product card
frontend/src/components/productCard/ProductCard.tsx - Recommendations
frontend/src/components/recommendations/Recommendations.tsx - Store policies
frontend/src/pages/policy/Policy.tsx
Customer account
- Login and auth
frontend/src/pages/login/Login.tsx - Profile and orders
frontend/src/pages/myProfile/MyProfile.tsx - Purchase reviews
frontend/src/pages/review/ReviewPage.tsx - Favorites storage
frontend/src/utils/favoriteStorage.ts
Administration
- Admin dashboard
frontend/src/pages/dashboard/ReviewsPage.jsx
Frontend services
- Cart service
frontend/src/services/cartService.ts - Guest cart
frontend/src/utils/guestCart.ts - Authentication service
frontend/src/services/authService.ts - Review service
frontend/src/services/reviewService.ts - Admin review API
frontend/src/services/adminReviewApi.js - Dashboard API
frontend/src/services/dashboardApi.js - HTTP API client
frontend/src/services/api.ts - Store query layer
frontend/src/services/storeQueries.ts - Product service
frontend/src/services/productService.ts - Catalog service
frontend/src/services/catalogService.ts - Query cache
frontend/src/services/queryCache.js - Session scope
frontend/src/services/useSessionScope.js - Cart mutations
frontend/src/services/useCartMutation.ts - Notifications
frontend/src/utils/notifications.ts
Other components
- Shopper
- Store backend
Connections 45
- Shopper → Route application: opens
frontend/src/App.tsx - Route application → Home catalog: routes to
frontend/src/App.tsx - Route application → Product search: routes to
frontend/src/App.tsx - Route application → Product detail: routes to
frontend/src/App.tsx - Route application → Profile and orders: routes to
frontend/src/App.tsx - Route application → Purchase reviews: routes to
frontend/src/App.tsx - Route application → Store policies: routes to
frontend/src/App.tsx - Home catalog → Store query layer: loads catalog
frontend/src/pages/homePage/HomePage.tsx - Home catalog → Catalog service: loads catalog
frontend/src/pages/homePage/HomePage.tsx - Home catalog → Catalog data: uses catalog data
frontend/src/pages/homePage/HomePage.tsx - Home catalog → Product card: renders cards
frontend/src/pages/homePage/HomePage.tsx - Product search → Catalog service: searches catalog
frontend/src/pages/searchPage/SearchPage.tsx - Product search → Catalog data: uses catalog data
frontend/src/pages/searchPage/SearchPage.tsx - Product search → Query cache: uses cache
frontend/src/pages/searchPage/SearchPage.tsx - Product detail → Store query layer: loads product data
frontend/src/pages/productDetail/ProductDetail.tsx - Product detail → Product service: loads product
frontend/src/pages/productDetail/ProductDetail.tsx - Product detail → Cart service: updates cart
frontend/src/pages/productDetail/ProductDetail.tsx - Product detail → Cart mutations: uses mutations
frontend/src/pages/productDetail/ProductDetail.tsx - Product detail → Recommendations: shows recommendations
frontend/src/pages/productDetail/ProductDetail.tsx - Product detail → Favorites storage: toggles favorites
frontend/src/pages/productDetail/ProductDetail.tsx - Product detail → Guest cart: uses guest cart
frontend/src/pages/productDetail/ProductDetail.tsx - Login and auth → Authentication service: authenticates
frontend/src/pages/login/Login.tsx - Authentication service → Cart service: merges guest cart
frontend/src/services/authService.ts - Authentication service → Guest cart: clears guest cart
frontend/src/services/authService.ts - Profile and orders → Favorites storage: reads favorites
frontend/src/utils/favoriteStorage.ts - Purchase reviews → Review service: submits review
frontend/src/pages/review/ReviewPage.tsx - Admin dashboard → Admin review API: exports reviews
frontend/src/pages/dashboard/ReviewsPage.jsx - Admin dashboard → Dashboard API: loads dashboard data
frontend/src/pages/dashboard/ReviewsPage.jsx - Admin review API → HTTP API client: sends requests
frontend/src/services/adminReviewApi.js - Dashboard API → HTTP API client: sends requests
frontend/src/services/dashboardApi.js - Store query layer → Product service: queries products
frontend/src/services/storeQueries.ts - Store query layer → Review service: queries reviews
frontend/src/services/storeQueries.ts - Store query layer → Authentication service: queries user
frontend/src/services/storeQueries.ts - Store query layer → Query cache: keys and times
frontend/src/services/storeQueries.ts - Store query layer → Session scope: scopes queries
frontend/src/services/storeQueries.ts - Product service → HTTP API client: fetches products
frontend/src/services/productService.ts - Catalog service → HTTP API client: fetches catalog
frontend/src/services/catalogService.ts - Review service → HTTP API client: sends review requests
frontend/src/services/reviewService.ts - Authentication service → HTTP API client: sends auth requests
frontend/src/services/authService.ts - HTTP API client → Store backend: HTTP requests
frontend/src/services/api.ts - HTTP API client → Query cache: invalidates data
frontend/src/services/api.ts - HTTP API client → Notifications: reports errors
frontend/src/services/api.ts - Cart service → HTTP API client: sends cart requests
frontend/src/services/cartService.ts - Cart service → Guest cart: uses guest cart
frontend/src/services/cartService.ts - Favorites storage → Notifications: reports changes
frontend/src/utils/favoriteStorage.ts