# shahidii/ecommerce-react architecture

> Architecture diagram of the GitHub repository shahidii/ecommerce-react, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shahidii/ecommerce-react
- Repository: https://github.com/shahidii/ecommerce-react

## Overview

Lumina is a React storefront for browsing Platzi Fake Store products, managing a locally persisted cart, and handling account flows. The main shopper journey is routed through the app to featured/catalog products, product details, cart, and a simulated purchase confirmation; account pages and profile access form a separate auth branch. Product and category requests use a shared API client, while global cart and toast providers support the UI. Some components and pages are documented but unsampled, so their internal connections are omitted unless documented.

Main entry points: [`src/App.jsx`](https://github.com/shahidii/ecommerce-react/blob/main/src/App.jsx) (Route app), [`src/pages/ProductDetail.jsx`](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/ProductDetail.jsx) (Product details), [`src/api/apiClient.js`](https://github.com/shahidii/ecommerce-react/blob/main/src/api/apiClient.js) (API client), [`src/pages/Products.jsx`](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Products.jsx) (Product catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and navigation"]
  node_app["Route app<br/>[App.jsx]"]
  node_navbar["Navigation bar<br/>[Navbar.jsx]"]
end

subgraph group_shop["Shopping experience"]
  node_home["Home page<br/>[Home.jsx]"]
  node_featured["Featured products"]
  node_catalog["Product catalog<br/>[Products.jsx]"]
  node_collections["Collections<br/>[Collections.jsx]"]
  node_detail["Product details<br/>[ProductDetail.jsx]"]
  node_cartpage["Shopping cart<br/>[Cart.jsx]"]
  node_cartstate["Cart state<br/>[CartContext.jsx]"]
  node_success["Order confirmation<br/>[OrderSuccess.jsx]"]
end

subgraph group_account["Accounts and feedback"]
  node_login["Login<br/>[Login.jsx]"]
  node_signup["Signup<br/>[Signup.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_routeguards["Route guards<br/>[ProtectedRoute.jsx]"]
  node_toaststate["Toast state<br/>[ToastContext.jsx]"]
  node_toastview["Toast display<br/>[Toast.jsx]"]
end

subgraph group_data["API access"]
  node_productsapi["Product service<br/>[productsService.js]"]
  node_categoriesapi["Category service"]
  node_authapi["Auth service<br/>[authService.js]"]
  node_client["API client<br/>[apiClient.js]"]
  node_errors["Error handling<br/>[errorHandler.js]"]
end

node_shopper(("Shopper"))
node_storeapi{{"Platzi Store API"}}

node_shopper -->|"visits"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_collections
node_app -->|"routes to"| node_detail
node_app -->|"routes to"| node_cartpage
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_signup
node_app -->|"protects route"| node_profile
node_app -->|"renders"| node_navbar
node_home -.->|"renders"| node_featured
node_featured -->|"fetches products"| node_productsapi
node_catalog -->|"fetches products"| node_productsapi
node_catalog -->|"fetches categories"| node_categoriesapi
node_detail -->|"fetches product"| node_productsapi
node_featured -->|"adds product"| node_cartstate
node_catalog -->|"adds product"| node_cartstate
node_detail -->|"adds product"| node_cartstate
node_cartpage -->|"manages items"| node_cartstate
node_cartpage -->|"renders confirmation"| node_success
node_detail -->|"renders confirmation"| node_success
node_app -->|"routes through"| node_routeguards
node_login -.->|"authenticates via"| node_authapi
node_signup -.->|"registers via"| node_authapi
node_profile -.->|"loads account"| node_authapi
node_toaststate -->|"renders"| node_toastview
node_cartpage -->|"publishes notices"| node_toaststate
node_detail -->|"publishes notices"| node_toaststate
node_productsapi -->|"requests through"| node_client
node_categoriesapi -->|"requests through"| node_client
node_authapi -->|"requests through"| node_client
node_client -->|"normalizes errors"| node_errors
node_client -->|"sends requests"| node_storeapi

click node_app "https://github.com/shahidii/ecommerce-react/blob/main/src/App.jsx"
click node_navbar "https://github.com/shahidii/ecommerce-react/blob/main/src/components/layouts/Navbar.jsx"
click node_home "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Home.jsx"
click node_featured "https://github.com/shahidii/ecommerce-react/blob/main/src/components/home/FeaturedProducts.jsx"
click node_catalog "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Products.jsx"
click node_collections "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Collections.jsx"
click node_detail "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/ProductDetail.jsx"
click node_cartpage "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Cart.jsx"
click node_cartstate "https://github.com/shahidii/ecommerce-react/blob/main/src/context/CartContext.jsx"
click node_success "https://github.com/shahidii/ecommerce-react/blob/main/src/components/ui/OrderSuccess.jsx"
click node_login "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Login.jsx"
click node_signup "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Signup.jsx"
click node_profile "https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Profile.jsx"
click node_routeguards "https://github.com/shahidii/ecommerce-react/blob/main/src/components/auth/ProtectedRoute.jsx"
click node_toaststate "https://github.com/shahidii/ecommerce-react/blob/main/src/context/ToastContext.jsx"
click node_toastview "https://github.com/shahidii/ecommerce-react/blob/main/src/components/ui/Toast.jsx"
click node_productsapi "https://github.com/shahidii/ecommerce-react/blob/main/src/api/productsService.js"
click node_categoriesapi "https://github.com/shahidii/ecommerce-react/blob/main/src/api/categoriesService.js"
click node_authapi "https://github.com/shahidii/ecommerce-react/blob/main/src/api/authService.js"
click node_client "https://github.com/shahidii/ecommerce-react/blob/main/src/api/apiClient.js"
click node_errors "https://github.com/shahidii/ecommerce-react/blob/main/src/api/errorHandler.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_navbar toneBlue
class node_home,node_featured,node_catalog,node_collections,node_detail,node_cartpage,node_cartstate,node_success toneAmber
class node_login,node_signup,node_profile,node_routeguards,node_toaststate,node_toastview,node_storeapi toneMint
class node_productsapi,node_categoriesapi,node_authapi,node_client,node_errors toneRose
class node_shopper toneIndigo
```

## Components

### App and navigation

- [Route app](https://github.com/shahidii/ecommerce-react/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation bar](https://github.com/shahidii/ecommerce-react/blob/main/src/components/layouts/Navbar.jsx): `src/components/layouts/Navbar.jsx`

### Shopping experience

- [Home page](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Featured products](https://github.com/shahidii/ecommerce-react/blob/main/src/components/home/FeaturedProducts.jsx): `src/components/home/FeaturedProducts.jsx`
- [Product catalog](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Products.jsx): `src/pages/Products.jsx`
- [Collections](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Collections.jsx): `src/pages/Collections.jsx`
- [Product details](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/ProductDetail.jsx): `src/pages/ProductDetail.jsx`
- [Shopping cart](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Cart.jsx): `src/pages/Cart.jsx`
- [Cart state](https://github.com/shahidii/ecommerce-react/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Order confirmation](https://github.com/shahidii/ecommerce-react/blob/main/src/components/ui/OrderSuccess.jsx): `src/components/ui/OrderSuccess.jsx`

### Accounts and feedback

- [Login](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Login.jsx): `src/pages/Login.jsx`
- [Signup](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Signup.jsx): `src/pages/Signup.jsx`
- [Profile](https://github.com/shahidii/ecommerce-react/blob/main/src/pages/Profile.jsx): `src/pages/Profile.jsx`
- [Route guards](https://github.com/shahidii/ecommerce-react/blob/main/src/components/auth/ProtectedRoute.jsx): `src/components/auth/ProtectedRoute.jsx`
- [Toast state](https://github.com/shahidii/ecommerce-react/blob/main/src/context/ToastContext.jsx): `src/context/ToastContext.jsx`
- [Toast display](https://github.com/shahidii/ecommerce-react/blob/main/src/components/ui/Toast.jsx): `src/components/ui/Toast.jsx`

### API access

- [Product service](https://github.com/shahidii/ecommerce-react/blob/main/src/api/productsService.js): `src/api/productsService.js`
- [Category service](https://github.com/shahidii/ecommerce-react/blob/main/src/api/categoriesService.js): `src/api/categoriesService.js`
- [Auth service](https://github.com/shahidii/ecommerce-react/blob/main/src/api/authService.js): `src/api/authService.js`
- [API client](https://github.com/shahidii/ecommerce-react/blob/main/src/api/apiClient.js): `src/api/apiClient.js`
- [Error handling](https://github.com/shahidii/ecommerce-react/blob/main/src/api/errorHandler.js): `src/api/errorHandler.js`

### Other components

- **Shopper**
- **Platzi Store API**

## Connections

- Shopper → Route app: visits (evidence: `README.md`)
- Route app → Home page: routes to (evidence: `src/App.jsx`)
- Route app → Product catalog: routes to (evidence: `src/App.jsx`)
- Route app → Collections: routes to (evidence: `src/App.jsx`)
- Route app → Product details: routes to (evidence: `src/App.jsx`)
- Route app → Shopping cart: routes to (evidence: `src/App.jsx`)
- Route app → Login: routes to (evidence: `src/App.jsx`)
- Route app → Signup: routes to (evidence: `src/App.jsx`)
- Route app → Profile: protects route (evidence: `src/App.jsx`)
- Route app → Navigation bar: renders (evidence: `src/App.jsx`)
- Home page → Featured products: renders
- Featured products → Product service: fetches products (evidence: `src/components/home/FeaturedProducts.jsx`)
- Product catalog → Product service: fetches products (evidence: `src/pages/Products.jsx`)
- Product catalog → Category service: fetches categories (evidence: `src/pages/Products.jsx`)
- Product details → Product service: fetches product (evidence: `src/pages/ProductDetail.jsx`)
- Featured products → Cart state: adds product (evidence: `src/components/home/FeaturedProducts.jsx`)
- Product catalog → Cart state: adds product (evidence: `src/pages/Products.jsx`)
- Product details → Cart state: adds product (evidence: `src/pages/ProductDetail.jsx`)
- Shopping cart → Cart state: manages items (evidence: `src/pages/Cart.jsx`)
- Shopping cart → Order confirmation: renders confirmation (evidence: `src/pages/Cart.jsx`)
- Product details → Order confirmation: renders confirmation (evidence: `src/pages/ProductDetail.jsx`)
- Route app → Route guards: routes through (evidence: `src/App.jsx`)
- Login → Auth service: authenticates via
- Signup → Auth service: registers via
- Profile → Auth service: loads account
- Toast state → Toast display: renders (evidence: `src/context/ToastContext.jsx`)
- Shopping cart → Toast state: publishes notices (evidence: `src/pages/Cart.jsx`)
- Product details → Toast state: publishes notices (evidence: `src/pages/ProductDetail.jsx`)
- Product service → API client: requests through (evidence: `src/api/productsService.js`)
- Category service → API client: requests through (evidence: `src/api/categoriesService.js`)
- Auth service → API client: requests through (evidence: `src/api/authService.js`)
- API client → Error handling: normalizes errors (evidence: `src/api/apiClient.js`)
- API client → Platzi Store API: sends requests (evidence: `src/api/apiClient.js`)
