How dmitryi-88/reactbookshop works
React Book Shop is a browser-based book store. A shopper browses the catalog, searches or filters books, opens a description, and adds books to a persistent cart. From the cart they adjust quantities and submit an order; the app records it, updates stock, and provides an orders view. The README also documents theme persistence, toast notices, and loading/error handling. Paths and wiring for unsampled providers and the orders page are taken only from the tree and README; their internal details are not inferred.
Main entry points: MainPage.jsx Catalog page · UseApi.js Store API · Cart.jsx Cart page · App.jsx Routes and shell
Components 23
App runtime
- React entry
src/main.jsx - Routes and shell
src/App.jsx - Query provider
src/QueryClientProvider.jsx - Store API
src/API/UseApi.js - Toast notice
src/components/Toast/Toast.jsx - Loading state
src/components/LoadingPage/LoadingPage.jsx - Error state
src/components/ErrorPage/ErrorPage.jsx
Book catalog
- Catalog page
src/pages/MainPage/MainPage.jsx - Title search
src/components/SearchBar/SearchBar.jsx - Author filter
src/components/FilterByAuthor/FilterByAuthor.jsx - Book cards
src/components/BooksList/BooksList.jsx - Book details
src/components/BookDescription/BookDescription.jsx
Cart and orders
- Cart page
src/pages/Cart/Cart.jsx - Cart item
src/components/CartItem/CartItem.jsx - Orders page
src/pages/Orders/Orders.jsx
Shared state
- Cart provider
src/context/CartProvider.jsx - Cart reducer
src/reducers/cartReducer.jsx - Local storage hook
src/hooks/UseLocalStorage.jsx - Theme provider
src/context/ThemeProvider.jsx - Toast provider
src/context/ToastProvider.jsx
Other components
- Shopper
- JSON Server
- Browser storage
Connections 32
- Shopper → React entry: opens shop
- React entry → Routes and shell: renders
- React entry → Query provider: provides queries
- React entry → Theme provider: provides theme
- Routes and shell → Catalog page: routes to
- Routes and shell → Cart page: routes to
- Routes and shell → Orders page: routes to
- Routes and shell → Cart provider: provides cart
- Catalog page → Store API: loads catalog
- Store API → JSON Server: fetches books
- Catalog page → Title search: renders
- Catalog page → Author filter: renders
- Catalog page → Book cards: renders results
- Catalog page → Book details: renders details
- Catalog page → Loading state: shows loading
- Catalog page → Error state: shows errors
- Book cards → Cart provider: dispatches add
- Book cards → Toast provider: triggers notice
- Toast provider → Toast notice: shows notice
- Cart page → Cart item: renders items
- Cart page → Store API: creates order
- Cart page → Store API: updates stock
- Store API → JSON Server: writes order
- Store API → JSON Server: patches stock
- Cart page → Cart provider: clears cart
- Cart page → Orders page: navigates after order
- Orders page → Store API: loads orders
- Store API → JSON Server: fetches orders
- Cart provider → Cart reducer: reduces actions
- Cart provider → Local storage hook: persists cart
- Local storage hook → Browser storage: reads and writes
- Theme provider → Local storage hook: persists theme