# mhnuc/nguyenminhquoc-24ct1 architecture

> Architecture diagram of the GitHub repository mhnuc/nguyenminhquoc-24ct1, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mhnuc/nguyenminhquoc-24ct1
- Repository: https://github.com/mhnuc/nguyenminhquoc-24ct1

## Overview

BookVerse is an online bookstore. Shoppers browse and filter the catalog, add books to a persistent cart, and submit orders; signed-in customers can review order history. Separate administration supports book and order management. Authentication, catalog, and order operations use Supabase when configured and local browser storage for fallback behavior. The README provides no capability details, so the map follows sampled imports and calls; unsampled modal behavior is represented only where the app’s wiring establishes it.

Main entry points: [`src/App.jsx`](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/App.jsx) (Storefront App), [`src/services/bookService.js`](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/bookService.js) (Book Catalog), [`src/context/AuthContext.jsx`](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/context/AuthContext.jsx) (Authentication), [`src/services/orderService.js`](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/orderService.js) (Order Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["Storefront App<br/>[App.jsx]"]
  node_navigation["Navigation<br/>[Navbar.jsx]"]
  node_catalog["Book Catalog<br/>[bookService.js]"]
  node_book_ui["Book Views"]
  node_cart_ui["Cart Drawer<br/>[CartDrawer.jsx]"]
  node_about["About Modal<br/>[AboutModal.jsx]"]
  node_policy["Policy Modal<br/>[PolicyModal.jsx]"]
  node_contact["Contact Modal<br/>[ContactModal.jsx]"]
end

subgraph group_identity["Identity and State"]
  node_cart_state["Cart State<br/>[CartContext.jsx]"]
  node_auth_ui["Sign-in and Registration<br/>[AuthModal.jsx]"]
  node_auth_state["Authentication<br/>[AuthContext.jsx]"]
end

subgraph group_commerce["Orders"]
  node_checkout["Checkout<br/>[CheckoutModal.jsx]"]
  node_order_service["Order Operations<br/>[orderService.js]"]
  node_history["Order History"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin Panel<br/>[AdminPanel.jsx]"]
end

subgraph group_backend["Data Services"]
  node_supabase_config["Supabase Config<br/>[supabase.js]"]
  node_supabase[("Supabase")]
  node_mock_books["Mock Book Data<br/>[mockData.js]"]
  node_local_storage[("Browser Storage")]
  node_config_ui["Connection Settings"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses"| node_app
node_app -->|"fetches books"| node_catalog
node_app -->|"renders"| node_navigation
node_app -->|"renders"| node_book_ui
node_app -->|"renders"| node_cart_ui
node_app -->|"renders"| node_checkout
node_app -->|"renders"| node_auth_ui
node_app -->|"renders"| node_history
node_app -->|"renders"| node_admin_ui
node_app -->|"renders"| node_about
node_app -->|"renders"| node_policy
node_app -->|"renders"| node_contact
node_navigation -->|"reads session"| node_auth_state
node_navigation -->|"reads count"| node_cart_state
node_book_ui -->|"adds books"| node_cart_state
node_cart_ui -->|"updates cart"| node_cart_state
node_auth_ui -->|"delegates login"| node_auth_state
node_checkout -->|"reads and clears"| node_cart_state
node_checkout -->|"reads user"| node_auth_state
node_checkout -->|"creates order"| node_order_service
node_history -->|"fetches orders"| node_order_service
node_admin_ui -->|"manages books"| node_catalog
node_admin_ui -->|"manages orders"| node_order_service
node_auth_state -->|"checks connection"| node_supabase_config
node_catalog -->|"checks connection"| node_supabase_config
node_order_service -->|"checks connection"| node_supabase_config
node_auth_state -->|"auth and profiles"| node_supabase
node_catalog -->|"queries books"| node_supabase
node_order_service -->|"reads and writes orders"| node_supabase
node_catalog -->|"uses fallback data"| node_mock_books
node_catalog -->|"stores fallback catalog"| node_local_storage
node_order_service -->|"stores fallback orders"| node_local_storage
node_cart_state -->|"persists cart"| node_local_storage
node_auth_state -->|"persists mock user"| node_local_storage
node_config_ui -->|"updates credentials"| node_supabase_config

click node_app "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/App.jsx"
click node_navigation "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/Navbar.jsx"
click node_catalog "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/bookService.js"
click node_book_ui "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/BookDetailModal.jsx"
click node_cart_ui "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/CartDrawer.jsx"
click node_cart_state "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/context/CartContext.jsx"
click node_auth_ui "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/AuthModal.jsx"
click node_auth_state "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/context/AuthContext.jsx"
click node_checkout "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/CheckoutModal.jsx"
click node_order_service "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/orderService.js"
click node_history "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/OrderHistoryModal.jsx"
click node_admin_ui "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/AdminPanel.jsx"
click node_supabase_config "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/lib/supabase.js"
click node_mock_books "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/mockData.js"
click node_about "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/AboutModal.jsx"
click node_policy "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/PolicyModal.jsx"
click node_contact "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/ContactModal.jsx"
click node_config_ui "https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/SupabaseConfigModal.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_app,node_navigation,node_catalog,node_book_ui,node_cart_ui,node_about,node_policy,node_contact toneBlue
class node_cart_state,node_auth_ui,node_auth_state toneAmber
class node_checkout,node_order_service,node_history toneMint
class node_admin_ui toneRose
class node_supabase_config,node_supabase,node_mock_books,node_local_storage,node_config_ui,node_shopper toneIndigo
```

## Components

### Storefront

- [Storefront App](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/App.jsx): `src/App.jsx`
- [Navigation](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/Navbar.jsx): `src/components/Navbar.jsx`
- [Book Catalog](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/bookService.js): `src/services/bookService.js`
- [Book Views](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/BookDetailModal.jsx): `src/components/BookDetailModal.jsx`
- [Cart Drawer](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/CartDrawer.jsx): `src/components/CartDrawer.jsx`
- [About Modal](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/AboutModal.jsx): `src/components/AboutModal.jsx`
- [Policy Modal](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/PolicyModal.jsx): `src/components/PolicyModal.jsx`
- [Contact Modal](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/ContactModal.jsx): `src/components/ContactModal.jsx`

### Identity and State

- [Cart State](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/context/CartContext.jsx): `src/context/CartContext.jsx`
- [Sign-in and Registration](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/AuthModal.jsx): `src/components/AuthModal.jsx`
- [Authentication](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`

### Orders

- [Checkout](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/CheckoutModal.jsx): `src/components/CheckoutModal.jsx`
- [Order Operations](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/orderService.js): `src/services/orderService.js`
- [Order History](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/OrderHistoryModal.jsx): `src/components/OrderHistoryModal.jsx`

### Administration

- [Admin Panel](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/AdminPanel.jsx): `src/components/AdminPanel.jsx`

### Data Services

- [Supabase Config](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/lib/supabase.js): `src/lib/supabase.js`
- **Supabase**
- [Mock Book Data](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/services/mockData.js): `src/services/mockData.js`
- **Browser Storage**
- [Connection Settings](https://github.com/mhnuc/nguyenminhquoc-24ct1/blob/main/src/components/SupabaseConfigModal.jsx): `src/components/SupabaseConfigModal.jsx`

### Other components

- **Shopper**

## Connections

- Shopper → Storefront App: uses
- Storefront App → Book Catalog: fetches books (evidence: `src/App.jsx`)
- Storefront App → Navigation: renders (evidence: `src/App.jsx`)
- Storefront App → Book Views: renders (evidence: `src/App.jsx`)
- Storefront App → Cart Drawer: renders (evidence: `src/App.jsx`)
- Storefront App → Checkout: renders (evidence: `src/App.jsx`)
- Storefront App → Sign-in and Registration: renders (evidence: `src/App.jsx`)
- Storefront App → Order History: renders (evidence: `src/App.jsx`)
- Storefront App → Admin Panel: renders (evidence: `src/App.jsx`)
- Storefront App → About Modal: renders (evidence: `src/App.jsx`)
- Storefront App → Policy Modal: renders (evidence: `src/App.jsx`)
- Storefront App → Contact Modal: renders (evidence: `src/App.jsx`)
- Navigation → Authentication: reads session (evidence: `src/components/Navbar.jsx`)
- Navigation → Cart State: reads count (evidence: `src/components/Navbar.jsx`)
- Book Views → Cart State: adds books (evidence: `src/components/BookDetailModal.jsx`)
- Cart Drawer → Cart State: updates cart (evidence: `src/components/CartDrawer.jsx`)
- Sign-in and Registration → Authentication: delegates login (evidence: `src/components/AuthModal.jsx`)
- Checkout → Cart State: reads and clears (evidence: `src/components/CheckoutModal.jsx`)
- Checkout → Authentication: reads user (evidence: `src/components/CheckoutModal.jsx`)
- Checkout → Order Operations: creates order (evidence: `src/components/CheckoutModal.jsx`)
- Order History → Order Operations: fetches orders (evidence: `src/components/OrderHistoryModal.jsx`)
- Admin Panel → Book Catalog: manages books (evidence: `src/components/AdminPanel.jsx`)
- Admin Panel → Order Operations: manages orders (evidence: `src/components/AdminPanel.jsx`)
- Authentication → Supabase Config: checks connection (evidence: `src/context/AuthContext.jsx`)
- Book Catalog → Supabase Config: checks connection (evidence: `src/services/bookService.js`)
- Order Operations → Supabase Config: checks connection (evidence: `src/services/orderService.js`)
- Authentication → Supabase: auth and profiles (evidence: `src/context/AuthContext.jsx`)
- Book Catalog → Supabase: queries books (evidence: `src/services/bookService.js`)
- Order Operations → Supabase: reads and writes orders (evidence: `src/services/orderService.js`)
- Book Catalog → Mock Book Data: uses fallback data (evidence: `src/services/bookService.js`)
- Book Catalog → Browser Storage: stores fallback catalog (evidence: `src/services/bookService.js`)
- Order Operations → Browser Storage: stores fallback orders (evidence: `src/services/orderService.js`)
- Cart State → Browser Storage: persists cart (evidence: `src/context/CartContext.jsx`)
- Authentication → Browser Storage: persists mock user (evidence: `src/context/AuthContext.jsx`)
- Connection Settings → Supabase Config: updates credentials (evidence: `src/components/SupabaseConfigModal.jsx`)
