# rifat-2010/programming-hero-assignment-11__client-side- architecture

> Architecture diagram of the GitHub repository rifat-2010/programming-hero-assignment-11__client-side-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rifat-2010/programming-hero-assignment-11__client-side-
- Repository: https://github.com/rifat-2010/programming-hero-assignment-11__client-side-

## Overview

BookCourier is a React client for browsing library books, requesting delivery, and managing orders through customer, librarian, and administrator dashboards. The main route flow is browsing the catalog, viewing a book, initiating a purchase/request, then monitoring the order; the README also describes wishlist and review capabilities. The server is external to this tree. Edges are limited to route declarations, shown imports/calls, or README-documented capabilities; unsampled feature implementations are represented at their existing page paths.

Main entry points: [`src/routes/router.jsx`](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/routes/router.jsx) (Route dispatch), [`src/pages/Dashboard/Customer/MyOrders.jsx`](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Customer/MyOrders.jsx) (Customer orders), [`src/pages/BookDetailsPage.jsx`](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/BookDetailsPage.jsx) (Book details), [`src/pages/Books.jsx`](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Books.jsx) (Book catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Reader experience"]
  node_router["Route dispatch<br/>[router.jsx]"]
  node_home["Home discovery<br/>[HomePage.jsx]"]
  node_catalog["Book catalog<br/>[Books.jsx]"]
  node_bookcard["Book cards<br/>[BookCart.jsx]"]
  node_bookdetails["Book details"]
  node_reviews["Book reviews<br/>[ReviewForm.jsx]"]
  node_wishlist["Wishlist<br/>[MyWishlist.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authprovider["Auth provider<br/>[AuthProvider.jsx]"]
  node_firebase["Firebase auth<br/>[firebase.config.js]"]
  node_authhook["Auth access hook<br/>[useAuth.jsx]"]
  node_rolehook["Role lookup<br/>[useRole.jsx]"]
  node_securehttp["Secure HTTP client<br/>[useAxiosSecure.jsx]"]
  node_signin["Sign in<br/>[SignIn.jsx]"]
  node_signup["Sign up<br/>[SignUp.jsx]"]
end

subgraph group_orders["Orders and delivery"]
  node_purchase["Purchase request<br/>[PurchaseModal.jsx]"]
  node_orderspage["Customer orders<br/>[MyOrders.jsx]"]
  node_payment["Payment return<br/>[PaymentSuccess.jsx]"]
  node_server{{"BookCourier API"}}
end

subgraph group_operations["Library operations"]
  node_sellerbooks["Inventory management<br/>[MyBooks.jsx]"]
  node_addbook["Add book<br/>[AddBookCart.jsx]"]
  node_sellerorders["Order processing<br/>[ManageOrders.jsx]"]
  node_users["User administration<br/>[ManageUsers.jsx]"]
  node_stats["Role statistics<br/>[Statistics.jsx]"]
end

node_reader(("Reader"))

node_reader -->|"opens"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_catalog
node_router -->|"routes to"| node_bookdetails
node_router -->|"routes to"| node_orderspage
node_router -->|"routes to"| node_signin
node_router -->|"routes to"| node_signup
node_router -->|"routes to"| node_wishlist
node_router -->|"routes to"| node_sellerbooks
node_router -->|"routes to"| node_sellerorders
node_router -->|"routes to"| node_users
node_router -->|"routes to"| node_stats
node_router -->|"routes to"| node_payment
node_home -->|"renders"| node_bookcard
node_catalog -->|"renders"| node_bookcard
node_bookdetails -->|"renders"| node_reviews
node_reader -->|"browses"| node_catalog
node_bookdetails -->|"initiates request"| node_purchase
node_purchase -.->|"submits request"| node_server
node_reader -->|"manages books"| node_wishlist
node_reader -->|"writes review"| node_reviews
node_reviews -->|"posts review"| node_server
node_orderspage -->|"reads and updates"| node_server
node_orderspage -.->|"starts checkout"| node_payment
node_orderspage -->|"creates checkout"| node_server
node_server -.->|"tracks delivery"| node_reader
node_authprovider -->|"observes auth"| node_firebase
node_signin -.->|"authenticates"| node_firebase
node_signup -->|"registers account"| node_firebase
node_authhook -->|"reads context"| node_authprovider
node_rolehook -->|"gets user"| node_authhook
node_rolehook -->|"queries role"| node_securehttp
node_securehttp -->|"sends authenticated requests"| node_server
node_sellerbooks -.->|"manages inventory"| node_server
node_addbook -.->|"adds inventory"| node_server
node_sellerorders -.->|"processes orders"| node_server
node_users -.->|"manages users"| node_server
node_stats -.->|"loads analytics"| node_server

click node_router "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/routes/router.jsx"
click node_home "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/HomePage.jsx"
click node_catalog "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Books.jsx"
click node_bookcard "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/BookCart.jsx"
click node_bookdetails "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/BookDetailsPage.jsx"
click node_reviews "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/ReviewForm.jsx"
click node_wishlist "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Customer/MyWishlist.jsx"
click node_authprovider "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/context/AuthProvider.jsx"
click node_firebase "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/firebase/firebase.config.js"
click node_authhook "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/hooks/useAuth.jsx"
click node_rolehook "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/hooks/useRole.jsx"
click node_securehttp "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/hooks/useAxiosSecure.jsx"
click node_signin "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/SignIn.jsx"
click node_signup "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/SignUp.jsx"
click node_purchase "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/Modal/PurchaseModal.jsx"
click node_orderspage "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Customer/MyOrders.jsx"
click node_payment "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Payment/PaymentSuccess.jsx"
click node_sellerbooks "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Seller/MyBooks.jsx"
click node_addbook "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/Form/AddBookCart.jsx"
click node_sellerorders "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Seller/ManageOrders.jsx"
click node_users "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Admin/ManageUsers.jsx"
click node_stats "https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Common/Statistics.jsx"

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_router,node_home,node_catalog,node_bookcard,node_bookdetails,node_reviews,node_wishlist toneBlue
class node_authprovider,node_firebase,node_authhook,node_rolehook,node_securehttp,node_signin,node_signup toneAmber
class node_purchase,node_orderspage,node_payment,node_server toneMint
class node_sellerbooks,node_addbook,node_sellerorders,node_users,node_stats toneRose
class node_reader toneIndigo
```

## Components

### Reader experience

- [Route dispatch](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/routes/router.jsx): `src/routes/router.jsx`
- [Home discovery](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/HomePage.jsx): `src/pages/HomePage.jsx`
- [Book catalog](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Books.jsx): `src/pages/Books.jsx`
- [Book cards](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/BookCart.jsx): `src/components/BookCart.jsx`
- [Book details](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/BookDetailsPage.jsx): `src/pages/BookDetailsPage.jsx`
- [Book reviews](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/ReviewForm.jsx): `src/components/ReviewForm.jsx`
- [Wishlist](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Customer/MyWishlist.jsx): `src/pages/Dashboard/Customer/MyWishlist.jsx`

### Identity and access

- [Auth provider](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/context/AuthProvider.jsx): `src/context/AuthProvider.jsx`
- [Firebase auth](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/firebase/firebase.config.js): `src/firebase/firebase.config.js`
- [Auth access hook](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/hooks/useAuth.jsx): `src/hooks/useAuth.jsx`
- [Role lookup](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/hooks/useRole.jsx): `src/hooks/useRole.jsx`
- [Secure HTTP client](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/hooks/useAxiosSecure.jsx): `src/hooks/useAxiosSecure.jsx`
- [Sign in](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/SignIn.jsx): `src/pages/SignIn.jsx`
- [Sign up](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/SignUp.jsx): `src/pages/SignUp.jsx`

### Orders and delivery

- [Purchase request](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/Modal/PurchaseModal.jsx): `src/components/Modal/PurchaseModal.jsx`
- [Customer orders](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Customer/MyOrders.jsx): `src/pages/Dashboard/Customer/MyOrders.jsx`
- [Payment return](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Payment/PaymentSuccess.jsx): `src/pages/Payment/PaymentSuccess.jsx`
- **BookCourier API**

### Library operations

- [Inventory management](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Seller/MyBooks.jsx): `src/pages/Dashboard/Seller/MyBooks.jsx`
- [Add book](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/components/Form/AddBookCart.jsx): `src/components/Form/AddBookCart.jsx`
- [Order processing](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Seller/ManageOrders.jsx): `src/pages/Dashboard/Seller/ManageOrders.jsx`
- [User administration](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Admin/ManageUsers.jsx): `src/pages/Dashboard/Admin/ManageUsers.jsx`
- [Role statistics](https://github.com/rifat-2010/programming-hero-assignment-11__client-side-/blob/main/src/pages/Dashboard/Common/Statistics.jsx): `src/pages/Dashboard/Common/Statistics.jsx`

### Other components

- **Reader**

## Connections

- Reader → Route dispatch: opens (evidence: `src/routes/router.jsx`)
- Route dispatch → Home discovery: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Book catalog: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Book details: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Customer orders: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Sign in: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Sign up: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Wishlist: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Inventory management: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Order processing: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → User administration: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Role statistics: routes to (evidence: `src/routes/router.jsx`)
- Route dispatch → Payment return: routes to (evidence: `src/routes/router.jsx`)
- Home discovery → Book cards: renders (evidence: `src/pages/HomePage.jsx`)
- Book catalog → Book cards: renders (evidence: `src/pages/Books.jsx`)
- Book details → Book reviews: renders (evidence: `src/pages/BookDetailsPage.jsx`)
- Reader → Book catalog: browses (evidence: `README.md`)
- Book details → Purchase request: initiates request (evidence: `src/pages/BookDetailsPage.jsx`)
- Purchase request → BookCourier API: submits request (evidence: `README.md`)
- Reader → Wishlist: manages books (evidence: `README.md`)
- Reader → Book reviews: writes review (evidence: `src/components/ReviewForm.jsx`)
- Book reviews → BookCourier API: posts review (evidence: `src/components/ReviewForm.jsx`)
- Customer orders → BookCourier API: reads and updates (evidence: `src/pages/Dashboard/Customer/MyOrders.jsx`)
- Customer orders → Payment return: starts checkout (evidence: `README.md`)
- Customer orders → BookCourier API: creates checkout (evidence: `src/pages/Dashboard/Customer/MyOrders.jsx`)
- BookCourier API → Reader: tracks delivery (evidence: `README.md`)
- Auth provider → Firebase auth: observes auth (evidence: `src/context/AuthProvider.jsx`)
- Sign in → Firebase auth: authenticates (evidence: `README.md`)
- Sign up → Firebase auth: registers account (evidence: `src/pages/SignUp.jsx`)
- Auth access hook → Auth provider: reads context (evidence: `src/hooks/useAuth.jsx`)
- Role lookup → Auth access hook: gets user (evidence: `src/hooks/useRole.jsx`)
- Role lookup → Secure HTTP client: queries role (evidence: `src/hooks/useRole.jsx`)
- Secure HTTP client → BookCourier API: sends authenticated requests (evidence: `src/hooks/useAxiosSecure.jsx`)
- Inventory management → BookCourier API: manages inventory (evidence: `README.md`)
- Add book → BookCourier API: adds inventory (evidence: `README.md`)
- Order processing → BookCourier API: processes orders (evidence: `README.md`)
- User administration → BookCourier API: manages users (evidence: `README.md`)
- Role statistics → BookCourier API: loads analytics (evidence: `README.md`)
