How geniusstudent24/amazon-app works
amazon-app is a storefront with a React shopping flow backed by an Express API: shoppers browse products, manage a cart, authenticate, and place or review orders. The backend also supports profile and delivery-location operations and an AI chat endpoint. The graph distinguishes frontend route/state layers from API services and persistence models. The README contains no capability detail; several page and service implementations were not excerpted, so their internal links are omitted where evidence is unavailable.
Main entry points: App.jsx Route application · order.jsx Order service · auth.jsx Authentication and cart · CartContext.jsx Cart state
Components 31
Storefront
- Route application
src/App.jsx - Home discovery
src/pages/Home.jsx - Product lists
src/pages/ProductLists.jsx - Product detail
src/pages/ProductDetail.jsx - Navigation UI
src/components/Navbar.jsx - Department menu
src/components/Menu.jsx - Footer UI
src/components/Footer.jsx - AI assistant UI
src/components/AiAssistant.jsx
Shopping
- Product state
src/context/ProductContext.jsx - Cart state
src/context/CartContext.jsx - Cart page
src/pages/Cart.jsx - Checkout
src/pages/Checkout.jsx - Order confirmation
src/pages/OrderPlaced.jsx - Order history
src/pages/MyOrders.jsx
Account
- Login
src/pages/Login.jsx - Profile
src/pages/profile.jsx - Browsing history
src/pages/BrowsingHistory.jsx - Language settings
src/pages/LanguageSetting.jsx
API services
- Express application
backend/app.js - Product API
backend/routes/productRoutes.js - Authentication and cart
backend/services/auth.jsx - Order service
backend/services/order.jsx - AI chat service
backend/services/aiChat.js - JWT middleware
backend/midleware/auth.jsx
Persistence
- Product catalog data
backend/data/db.json - User model
backend/model/user.jsx - Cart model
backend/model/Cart.jsx - Order model
backend/model/Order.jsx - Location model
backend/model/Location.jsx
Other components
- Shopper
- MongoDB
Connections 36
- Shopper → Route application: uses
src/App.jsx - Route application → Home discovery: routes
src/App.jsx - Route application → Product lists: routes
src/App.jsx - Route application → Product detail: routes
src/App.jsx - Route application → Cart page: routes
src/App.jsx - Route application → Checkout: routes
src/App.jsx - Route application → Order confirmation: routes
src/App.jsx - Route application → Order history: routes
src/App.jsx - Route application → Login: routes
src/App.jsx - Route application → Profile: routes
src/App.jsx - Route application → Browsing history: routes
src/App.jsx - Route application → Language settings: routes
src/App.jsx - Route application → AI assistant UI: renders
src/App.jsx - Home discovery → Product state: reads products
src/pages/Home.jsx - Product state → Product API: fetches products
src/context/ProductContext.jsx - Product API → Product catalog data: reads catalog
backend/routes/productRoutes.js - Cart state → Authentication and cart: cart requests
src/context/CartContext.jsx - Cart state → Product API: loads product details
src/context/CartContext.jsx - Navigation UI → Cart state: reads count
src/components/Navbar.jsx - Cart page → Cart state: uses cart
src/pages/Cart.jsx - Checkout → Cart state: uses cart
src/pages/Checkout.jsx - Order confirmation → Cart state: uses cart
src/pages/OrderPlaced.jsx - Express application → Authentication and cart: mounts routes
backend/app.js - Express application → Order service: mounts routes
backend/app.js - Express application → Product API: mounts routes
backend/app.js - Express application → AI chat service: requests response
backend/app.js - Authentication and cart → JWT middleware: guards requests
backend/services/auth.jsx - Order service → JWT middleware: guards requests
backend/services/order.jsx - Authentication and cart → User model: reads and writes
backend/services/auth.jsx - Authentication and cart → Cart model: reads and writes
backend/services/auth.jsx - Authentication and cart → Location model: reads and writes
backend/services/auth.jsx - Order service → Order model: reads and writes
backend/services/order.jsx - Order service → Cart model: clears cart
backend/services/order.jsx - Order service → User model: loads user
backend/services/order.jsx - Order service → Location model: loads location
backend/services/order.jsx - Express application → MongoDB: connects
backend/app.js