# mariammakhlof/shop-space architecture

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

- Interactive diagram: https://gitdiagram.com/mariammakhlof/shop-space
- Repository: https://github.com/mariammakhlof/shop-space

## Overview

ShopSpace is a browser-based demo storefront. Visitors enter the routed app, load a product catalog, search or filter it, choose a grid or list view, and add products to a locally saved cart; the sidebar also loads categories and controls the theme. Redux holds cart, view, and theme state, while browser storage persists cart and theme choices. The README documents read-only DummyJSON data and static hosting. Some component details are unsampled, so the graph shows only evidenced calls and documented behavior.

Main entry points: [`src/components/redux/cartSlice.js`](https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/cartSlice.js) (Cart State), [`src/components/redux/store.js`](https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/store.js) (Redux Store), [`src/App.js`](https://github.com/mariammakhlof/shop-space/blob/main/src/App.js) (Routed App), [`src/components/SideBar.js`](https://github.com/mariammakhlof/shop-space/blob/main/src/components/SideBar.js) (Store Sidebar)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and Navigation"]
  node_app["Routed App<br/>[App.js]"]
  node_layout["Page Layout<br/>[Layout.js]"]
  node_sidebar["Store Sidebar<br/>[SideBar.js]"]
end

subgraph group_catalog["Product Catalog"]
  node_catalog["Catalog and Filters<br/>[PhotoStore.js]"]
  node_productapi{{"DummyJSON Products"}}
  node_categoryapi{{"DummyJSON Categories"}}
end

subgraph group_cart["Cart"]
  node_cartpage["Cart Page<br/>[PhotoStore.js]"]
end

subgraph group_state["State and Persistence"]
  node_reduxstore["Redux Store<br/>[store.js]"]
  node_cartstate["Cart State<br/>[cartSlice.js]"]
  node_productstate["View State<br/>[productSlice.js]"]
  node_themestate["Theme State<br/>[themeSlice.js]"]
  node_browserstorage[("Browser Storage")]
end

node_visitor(("Store Visitor"))

node_visitor -->|"opens store"| node_app
node_app -->|"routes through"| node_layout
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_cartpage
node_layout -->|"renders"| node_sidebar
node_catalog -->|"fetches products"| node_productapi
node_sidebar -->|"fetches categories"| node_categoryapi
node_catalog -->|"dispatches cart actions"| node_cartstate
node_cartpage -->|"dispatches cart actions"| node_cartstate
node_catalog -->|"sets view"| node_productstate
node_sidebar -->|"reads cart count"| node_cartstate
node_sidebar -->|"toggles theme"| node_themestate
node_layout -->|"reads theme"| node_themestate
node_reduxstore -->|"registers reducer"| node_cartstate
node_reduxstore -->|"registers reducer"| node_productstate
node_reduxstore -->|"registers reducer"| node_themestate
node_cartstate -->|"loads cart"| node_browserstorage
node_themestate -->|"loads theme"| node_browserstorage
node_reduxstore -->|"persists changes"| node_browserstorage

click node_app "https://github.com/mariammakhlof/shop-space/blob/main/src/App.js"
click node_layout "https://github.com/mariammakhlof/shop-space/blob/main/src/components/Layout.js"
click node_sidebar "https://github.com/mariammakhlof/shop-space/blob/main/src/components/SideBar.js"
click node_catalog "https://github.com/mariammakhlof/shop-space/blob/main/src/components/PhotoStore.js"
click node_cartpage "https://github.com/mariammakhlof/shop-space/blob/main/src/components/PhotoStore.js"
click node_reduxstore "https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/store.js"
click node_cartstate "https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/cartSlice.js"
click node_productstate "https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/productSlice.js"
click node_themestate "https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/themeSlice.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_layout,node_sidebar toneBlue
class node_catalog,node_productapi,node_categoryapi toneAmber
class node_cartpage toneMint
class node_reduxstore,node_cartstate,node_productstate,node_themestate,node_browserstorage toneRose
class node_visitor toneIndigo
```

## Components

### App and Navigation

- [Routed App](https://github.com/mariammakhlof/shop-space/blob/main/src/App.js): `src/App.js`
- [Page Layout](https://github.com/mariammakhlof/shop-space/blob/main/src/components/Layout.js): `src/components/Layout.js`
- [Store Sidebar](https://github.com/mariammakhlof/shop-space/blob/main/src/components/SideBar.js): `src/components/SideBar.js`

### Product Catalog

- [Catalog and Filters](https://github.com/mariammakhlof/shop-space/blob/main/src/components/PhotoStore.js): `src/components/PhotoStore.js`
- **DummyJSON Products**
- **DummyJSON Categories**

### Cart

- [Cart Page](https://github.com/mariammakhlof/shop-space/blob/main/src/components/PhotoStore.js): `src/components/PhotoStore.js`

### State and Persistence

- [Redux Store](https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/store.js): `src/components/redux/store.js`
- [Cart State](https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/cartSlice.js): `src/components/redux/cartSlice.js`
- [View State](https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/productSlice.js): `src/components/redux/productSlice.js`
- [Theme State](https://github.com/mariammakhlof/shop-space/blob/main/src/components/redux/themeSlice.js): `src/components/redux/themeSlice.js`
- **Browser Storage**

### Other components

- **Store Visitor**

## Connections

- Store Visitor → Routed App: opens store (evidence: `README.md`)
- Routed App → Page Layout: routes through (evidence: `src/App.js`)
- Routed App → Catalog and Filters: routes to (evidence: `src/App.js`)
- Routed App → Cart Page: routes to (evidence: `src/App.js`)
- Page Layout → Store Sidebar: renders (evidence: `src/components/Layout.js`)
- Catalog and Filters → DummyJSON Products: fetches products (evidence: `src/components/PhotoStore.js`)
- Store Sidebar → DummyJSON Categories: fetches categories (evidence: `src/components/SideBar.js`)
- Catalog and Filters → Cart State: dispatches cart actions (evidence: `src/components/PhotoStore.js`)
- Cart Page → Cart State: dispatches cart actions (evidence: `src/components/PhotoStore.js`)
- Catalog and Filters → View State: sets view (evidence: `src/components/PhotoStore.js`)
- Store Sidebar → Cart State: reads cart count (evidence: `src/components/SideBar.js`)
- Store Sidebar → Theme State: toggles theme (evidence: `src/components/SideBar.js`)
- Page Layout → Theme State: reads theme (evidence: `src/components/Layout.js`)
- Redux Store → Cart State: registers reducer (evidence: `src/components/redux/store.js`)
- Redux Store → View State: registers reducer (evidence: `src/components/redux/store.js`)
- Redux Store → Theme State: registers reducer (evidence: `src/components/redux/store.js`)
- Cart State → Browser Storage: loads cart (evidence: `src/components/redux/cartSlice.js`)
- Theme State → Browser Storage: loads theme (evidence: `src/components/redux/themeSlice.js`)
- Redux Store → Browser Storage: persists changes (evidence: `src/components/redux/store.js`)
