# dvdenys/react-game-shop architecture

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

- Interactive diagram: https://gitdiagram.com/dvdenys/react-game-shop
- Repository: https://github.com/dvdenys/react-game-shop

## Overview

This is a React/Redux game shop: users browse a locally defined game catalogue, open game details, add or remove games from the cart, and review an order total. The app mounts a routed interface backed by Redux; cart state is initialized from and persisted to local storage. The map preserves the README-described order flow and the indexed product modules. Unsampled route configuration and components are shown where identifiable, but their unverified connections are omitted.

Main entry points: [`src/components/GameItem/GameItem.jsx`](https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameItem/GameItem.jsx) (Game item), [`src/utils/utils.js`](https://github.com/dvdenys/react-game-shop/blob/main/src/utils/utils.js) (Shop utilities), [`src/components/CartBlock/CartBlock.jsx`](https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartBlock/CartBlock.jsx) (Cart summary), [`src/components/CartMenu/CartMenu.jsx`](https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartMenu/CartMenu.jsx) (Cart menu)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Application shell"]
  node_entry["React entry<br/>[index.js]"]
  node_app["App router<br/>[App.jsx]"]
  node_routeconfig["Route config<br/>[routesConfig.js]"]
  node_header["Header<br/>[Header.jsx]"]
end

subgraph group_catalogue["Game catalogue"]
  node_home["Home page<br/>[HomePage.jsx]"]
  node_games["Game catalogue data<br/>[games.js]"]
  node_gameitem["Game item<br/>[GameItem.jsx]"]
  node_gamepage["Game detail page<br/>[GamePage.jsx]"]
  node_gamecover["Game cover<br/>[GameCover.jsx]"]
  node_gamegenre["Game genre<br/>[GameGenre.jsx]"]
end

subgraph group_cart["Cart and ordering"]
  node_gamebuy["Purchase control<br/>[GameBuy.jsx]"]
  node_cartblock["Cart summary<br/>[CartBlock.jsx]"]
  node_cartmenu["Cart menu<br/>[CartMenu.jsx]"]
  node_cartitem["Cart item<br/>[CartItem.jsx]"]
  node_itemsincart["Cart count<br/>[ItemsInCart.jsx]"]
  node_orderpage["Order page<br/>[OrderPage.jsx]"]
  node_orderitem["Order item<br/>[OrderItem.jsx]"]
  node_button["UI button<br/>[UiButton.jsx]"]
end

subgraph group_state["State and persistence"]
  node_store["Redux store<br/>[store.js]"]
  node_cartreducer["Cart state<br/>[reducer.js]"]
  node_gamesreducer["Current game state<br/>[reducer.js]"]
  node_utils["Shop utilities<br/>[utils.js]"]
end

node_shopper(("Shopper"))

node_shopper -->|"opens shop"| node_entry
node_entry -->|"mounts"| node_app
node_entry -->|"provides state"| node_store
node_app -->|"maps routes"| node_routeconfig
node_app -->|"renders"| node_header
node_home -->|"maps catalogue"| node_games
node_home -->|"renders"| node_gameitem
node_gameitem -->|"renders"| node_gamecover
node_gameitem -->|"renders"| node_gamegenre
node_gameitem -->|"renders"| node_gamebuy
node_gameitem -->|"sets current game"| node_gamesreducer
node_gamepage -->|"renders"| node_gamecover
node_gamepage -->|"renders"| node_gamegenre
node_gamepage -->|"renders"| node_gamebuy
node_gamebuy -->|"dispatches cart actions"| node_cartreducer
node_gamebuy -->|"renders"| node_button
node_cartblock -->|"renders"| node_cartmenu
node_cartblock -->|"renders count"| node_itemsincart
node_cartblock -->|"calculates total"| node_utils
node_cartmenu -->|"renders items"| node_cartitem
node_cartmenu -->|"renders action"| node_button
node_cartmenu -->|"calculates total"| node_utils
node_cartblock -->|"navigates to order"| node_orderpage
node_orderpage -->|"renders items"| node_orderitem
node_orderpage -->|"formats summary"| node_utils
node_store -->|"registers reducer"| node_cartreducer
node_store -->|"registers reducer"| node_gamesreducer
node_store -->|"persists state"| node_utils
node_cartreducer -->|"loads saved cart"| node_utils

click node_entry "https://github.com/dvdenys/react-game-shop/blob/main/src/index.js"
click node_app "https://github.com/dvdenys/react-game-shop/blob/main/src/containers/App/App.jsx"
click node_routeconfig "https://github.com/dvdenys/react-game-shop/blob/main/src/routes/routesConfig.js"
click node_header "https://github.com/dvdenys/react-game-shop/blob/main/src/components/Header/Header.jsx"
click node_home "https://github.com/dvdenys/react-game-shop/blob/main/src/Pages/HomePage/HomePage.jsx"
click node_games "https://github.com/dvdenys/react-game-shop/blob/main/src/constants/games.js"
click node_gameitem "https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameItem/GameItem.jsx"
click node_gamepage "https://github.com/dvdenys/react-game-shop/blob/main/src/Pages/GamePage/GamePage.jsx"
click node_gamecover "https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameCover/GameCover.jsx"
click node_gamegenre "https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameGenre/GameGenre.jsx"
click node_gamebuy "https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameBuy/GameBuy.jsx"
click node_cartblock "https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartBlock/CartBlock.jsx"
click node_cartmenu "https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartMenu/CartMenu.jsx"
click node_cartitem "https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartItem/CartItem.jsx"
click node_itemsincart "https://github.com/dvdenys/react-game-shop/blob/main/src/components/ItemsInCart/ItemsInCart.jsx"
click node_orderpage "https://github.com/dvdenys/react-game-shop/blob/main/src/Pages/OrderPage/OrderPage.jsx"
click node_orderitem "https://github.com/dvdenys/react-game-shop/blob/main/src/components/OrderItem/OrderItem.jsx"
click node_button "https://github.com/dvdenys/react-game-shop/blob/main/src/components/UI/UiButton/UiButton.jsx"
click node_store "https://github.com/dvdenys/react-game-shop/blob/main/src/store/store.js"
click node_cartreducer "https://github.com/dvdenys/react-game-shop/blob/main/src/store/cart/reducer.js"
click node_gamesreducer "https://github.com/dvdenys/react-game-shop/blob/main/src/store/games/reducer.js"
click node_utils "https://github.com/dvdenys/react-game-shop/blob/main/src/utils/utils.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_entry,node_app,node_routeconfig,node_header toneBlue
class node_home,node_games,node_gameitem,node_gamepage,node_gamecover,node_gamegenre toneAmber
class node_gamebuy,node_cartblock,node_cartmenu,node_cartitem,node_itemsincart,node_orderpage,node_orderitem,node_button toneMint
class node_store,node_cartreducer,node_gamesreducer,node_utils toneRose
class node_shopper toneIndigo
```

## Components

### Application shell

- [React entry](https://github.com/dvdenys/react-game-shop/blob/main/src/index.js): `src/index.js`
- [App router](https://github.com/dvdenys/react-game-shop/blob/main/src/containers/App/App.jsx): `src/containers/App/App.jsx`
- [Route config](https://github.com/dvdenys/react-game-shop/blob/main/src/routes/routesConfig.js): `src/routes/routesConfig.js`
- [Header](https://github.com/dvdenys/react-game-shop/blob/main/src/components/Header/Header.jsx): `src/components/Header/Header.jsx`

### Game catalogue

- [Home page](https://github.com/dvdenys/react-game-shop/blob/main/src/Pages/HomePage/HomePage.jsx): `src/Pages/HomePage/HomePage.jsx`
- [Game catalogue data](https://github.com/dvdenys/react-game-shop/blob/main/src/constants/games.js): `src/constants/games.js`
- [Game item](https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameItem/GameItem.jsx): `src/components/GameItem/GameItem.jsx`
- [Game detail page](https://github.com/dvdenys/react-game-shop/blob/main/src/Pages/GamePage/GamePage.jsx): `src/Pages/GamePage/GamePage.jsx`
- [Game cover](https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameCover/GameCover.jsx): `src/components/GameCover/GameCover.jsx`
- [Game genre](https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameGenre/GameGenre.jsx): `src/components/GameGenre/GameGenre.jsx`

### Cart and ordering

- [Purchase control](https://github.com/dvdenys/react-game-shop/blob/main/src/components/GameBuy/GameBuy.jsx): `src/components/GameBuy/GameBuy.jsx`
- [Cart summary](https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartBlock/CartBlock.jsx): `src/components/CartBlock/CartBlock.jsx`
- [Cart menu](https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartMenu/CartMenu.jsx): `src/components/CartMenu/CartMenu.jsx`
- [Cart item](https://github.com/dvdenys/react-game-shop/blob/main/src/components/CartItem/CartItem.jsx): `src/components/CartItem/CartItem.jsx`
- [Cart count](https://github.com/dvdenys/react-game-shop/blob/main/src/components/ItemsInCart/ItemsInCart.jsx): `src/components/ItemsInCart/ItemsInCart.jsx`
- [Order page](https://github.com/dvdenys/react-game-shop/blob/main/src/Pages/OrderPage/OrderPage.jsx): `src/Pages/OrderPage/OrderPage.jsx`
- [Order item](https://github.com/dvdenys/react-game-shop/blob/main/src/components/OrderItem/OrderItem.jsx): `src/components/OrderItem/OrderItem.jsx`
- [UI button](https://github.com/dvdenys/react-game-shop/blob/main/src/components/UI/UiButton/UiButton.jsx): `src/components/UI/UiButton/UiButton.jsx`

### State and persistence

- [Redux store](https://github.com/dvdenys/react-game-shop/blob/main/src/store/store.js): `src/store/store.js`
- [Cart state](https://github.com/dvdenys/react-game-shop/blob/main/src/store/cart/reducer.js): `src/store/cart/reducer.js`
- [Current game state](https://github.com/dvdenys/react-game-shop/blob/main/src/store/games/reducer.js): `src/store/games/reducer.js`
- [Shop utilities](https://github.com/dvdenys/react-game-shop/blob/main/src/utils/utils.js): `src/utils/utils.js`

### Other components

- **Shopper**

## Connections

- Shopper → React entry: opens shop (evidence: `README.md`)
- React entry → App router: mounts (evidence: `src/index.js`)
- React entry → Redux store: provides state (evidence: `src/index.js`)
- App router → Route config: maps routes (evidence: `src/containers/App/App.jsx`)
- App router → Header: renders (evidence: `src/containers/App/App.jsx`)
- Home page → Game catalogue data: maps catalogue (evidence: `src/Pages/HomePage/HomePage.jsx`)
- Home page → Game item: renders (evidence: `src/Pages/HomePage/HomePage.jsx`)
- Game item → Game cover: renders (evidence: `src/components/GameItem/GameItem.jsx`)
- Game item → Game genre: renders (evidence: `src/components/GameItem/GameItem.jsx`)
- Game item → Purchase control: renders (evidence: `src/components/GameItem/GameItem.jsx`)
- Game item → Current game state: sets current game (evidence: `src/components/GameItem/GameItem.jsx`)
- Game detail page → Game cover: renders (evidence: `src/Pages/GamePage/GamePage.jsx`)
- Game detail page → Game genre: renders (evidence: `src/Pages/GamePage/GamePage.jsx`)
- Game detail page → Purchase control: renders (evidence: `src/Pages/GamePage/GamePage.jsx`)
- Purchase control → Cart state: dispatches cart actions (evidence: `src/components/GameBuy/GameBuy.jsx`)
- Purchase control → UI button: renders (evidence: `src/components/GameBuy/GameBuy.jsx`)
- Cart summary → Cart menu: renders (evidence: `src/components/CartBlock/CartBlock.jsx`)
- Cart summary → Cart count: renders count (evidence: `src/components/CartBlock/CartBlock.jsx`)
- Cart summary → Shop utilities: calculates total (evidence: `src/components/CartBlock/CartBlock.jsx`)
- Cart menu → Cart item: renders items (evidence: `src/components/CartMenu/CartMenu.jsx`)
- Cart menu → UI button: renders action (evidence: `src/components/CartMenu/CartMenu.jsx`)
- Cart menu → Shop utilities: calculates total (evidence: `src/components/CartMenu/CartMenu.jsx`)
- Cart summary → Order page: navigates to order (evidence: `src/components/CartBlock/CartBlock.jsx`)
- Order page → Order item: renders items (evidence: `src/Pages/OrderPage/OrderPage.jsx`)
- Order page → Shop utilities: formats summary (evidence: `src/Pages/OrderPage/OrderPage.jsx`)
- Redux store → Cart state: registers reducer (evidence: `src/store/store.js`)
- Redux store → Current game state: registers reducer (evidence: `src/store/store.js`)
- Redux store → Shop utilities: persists state (evidence: `src/store/store.js`)
- Cart state → Shop utilities: loads saved cart (evidence: `src/store/cart/reducer.js`)
