How prronald/beer-challenge works
Beer Challenge is a beer-catalog browsing application: a visitor lands on a welcome screen, moves to a product list, and can open a beer’s detail page to inspect its size, price, and stock. The React client retrieves catalog and stock data through Redux async thunks from a separate Express server. The graph includes the catalog, detail, routing/state, and server data stages. Relationships reflect the shown imports, dispatches, routes, and HTTP requests; unsampled modules are represented only where the tree or README supports them.
Main entry points: ViewProduct.jsx Product detail page · main.jsx App entry and routes · App.jsx Catalog page · itemsSlice.js Catalog and stock state
Components 21
React client
- App entry and routes
src/main.jsx - Welcome screen
src/components/Welcome.jsx - Error page
src/components/ErrorPage.jsx - Redux store
src/store.js - Catalog and stock state
src/body/itemsSlice.js
Catalog browsing
- Catalog page
src/App.jsx - Catalog header
src/header/Header.jsx - Catalog body
src/body/Body.jsx - Catalog loader
src/body/Items.jsx - Product cards
src/body/Products.jsx - Product link
src/AddButton.jsx
Product details
- Product detail page
src/viewproduct/ViewProduct.jsx - Detail navigation
src/viewproduct/Nav.jsx - Product image
src/viewproduct/ImgView.jsx - Cart action button
src/viewproduct/ButtonAdd.jsx - Size label formatter
src/viewproduct/truncateString.js - Redirect helper
src/functions/redirect.js
Beer API
- Express API routes
beer-server-challenge/server.js - Beer catalog data
beer-server-challenge/items/products.js - Stock and price data
beer-server-challenge/items/stock-price.js
Other components
- Visitor
Connections 23
- Visitor → App entry and routes: opens app
src/main.jsx - App entry and routes → Welcome screen: routes to
src/main.jsx - App entry and routes → Catalog page: routes to
src/main.jsx - App entry and routes → Product detail page: routes to
src/main.jsx - App entry and routes → Error page: routes errors to
src/main.jsx - Welcome screen → Catalog page: navigates to
src/components/Welcome.jsx - Catalog page → Catalog header: renders
src/App.jsx - Catalog page → Catalog body: renders
src/App.jsx - Catalog body → Catalog loader: renders
src/body/Body.jsx - Catalog loader → Catalog and stock state: dispatches fetches
src/body/Items.jsx - Catalog loader → Product cards: renders results
src/body/Items.jsx - Product cards → Product link: renders links
src/body/Products.jsx - Product link → Product detail page: links to
- Product detail page → Catalog and stock state: dispatches fetches
src/viewproduct/ViewProduct.jsx - Product detail page → Detail navigation: renders
src/viewproduct/ViewProduct.jsx - Product detail page → Product image: renders
src/viewproduct/ViewProduct.jsx - Product detail page → Cart action button: renders
src/viewproduct/ViewProduct.jsx - Product detail page → Size label formatter: formats sizes
src/viewproduct/ViewProduct.jsx - Product detail page → Redirect helper: imports helper
src/viewproduct/ViewProduct.jsx - Redux store → Catalog and stock state: uses reducers
src/store.js - Catalog and stock state → Express API routes: requests catalog and stock
src/body/itemsSlice.js - Express API routes → Beer catalog data: serves catalog
beer-server-challenge/server.js - Express API routes → Stock and price data: serves stock and prices
beer-server-challenge/server.js