# blessingajiboye/comp229sec001f26new architecture

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

- Interactive diagram: https://gitdiagram.com/blessingajiboye/comp229sec001f26new
- Repository: https://github.com/blessingajiboye/comp229sec001f26new

## Overview

This is a React storefront and seller-management application backed by an Express API. The user journey covers account access, browsing shops and products, cart review, and checkout; sellers manage shops and their product listings, while users manage profiles. The server routes requests through authorization and controller logic to MongoDB models. The README is empty, and several client API modules and checkout internals were not excerpted, so their server-side connections and detailed behavior are not asserted.

Main entry points: [`client/MainRouter.jsx`](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/MainRouter.jsx) (Page routing), [`server/controllers/auth.controller.js`](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/auth.controller.js) (Authentication controller), [`client/shop/ShopProduct.jsx`](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/ShopProduct.jsx) (Shop products), [`server/routes/shop.routes.js`](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/shop.routes.js) (Shop routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Storefront client"]
  node_app["React application<br/>[App.jsx]"]
  node_router["Page routing<br/>[MainRouter.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_shop_browse["Shop browsing<br/>[Shops.jsx]"]
  node_shop_products["Shop products<br/>[ShopProduct.jsx]"]
  node_cart["Cart review<br/>[CartItems.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_cart_state["Cart helpers<br/>[cart-helper.js]"]
end

subgraph group_identity["Identity and profiles"]
  node_signin["Sign-in<br/>[Signin.jsx]"]
  node_auth_state["Authentication state<br/>[auth-helper.js]"]
  node_auth_api["Auth API client<br/>[api-auth.js]"]
  node_profile["Profile management<br/>[Profile.jsx]"]
  node_user_api["User API client<br/>[api-user.js]"]
end

subgraph group_seller["Seller management"]
  node_seller_shops["Seller shops<br/>[MyShops.jsx]"]
  node_shop_edit["Shop editing<br/>[EditShop.jsx]"]
  node_shop_api["Shop API client<br/>[api-shop.js]"]
  node_product_edit["Product editing<br/>[EditProduct.jsx]"]
  node_product_api["Product API client<br/>[api-product.js]"]
end

subgraph group_backend["API and persistence"]
  node_server_app["Express application<br/>[express.js]"]
  node_shop_routes["Shop routes<br/>[shop.routes.js]"]
  node_product_routes["Product routes<br/>[product.routes.js]"]
  node_user_routes["User routes<br/>[user.routes.js]"]
  node_auth_controller["Authentication controller<br/>[auth.controller.js]"]
  node_shop_controller["Shop controller<br/>[shop.controller.js]"]
  node_product_controller["Product controller"]
  node_user_controller["User controller<br/>[user.controller.js]"]
  node_shop_model[("Shop records<br/>[shop.model.js]")]
  node_product_model[("Product records<br/>[product.model.js]")]
  node_user_model[("User records<br/>[user.model.js]")]
end

node_visitor(("Shopper or seller"))

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_router
node_router -->|"routes to"| node_home
node_router -->|"routes to"| node_shop_browse
node_router -->|"routes to"| node_shop_products
node_router -->|"routes to"| node_cart
node_router -->|"routes to"| node_checkout
node_router -->|"routes to"| node_signin
node_router -->|"routes to"| node_profile
node_shop_products -->|"uses"| node_product_api
node_shop_products -->|"uses"| node_shop_api
node_shop_products -->|"offers add-to-cart"| node_cart
node_cart -->|"uses"| node_cart_state
node_checkout -->|"uses"| node_cart_state
node_signin -->|"uses"| node_auth_api
node_signin -->|"updates"| node_auth_state
node_auth_state -->|"signs out through"| node_auth_api
node_profile -->|"uses"| node_user_api
node_seller_shops -.->|"manages"| node_shop_edit
node_shop_edit -->|"uses"| node_shop_api
node_shop_edit -->|"shows products through"| node_product_edit
node_product_edit -->|"uses"| node_product_api
node_server_app -->|"mounts routes"| node_shop_routes
node_server_app -->|"mounts routes"| node_product_routes
node_server_app -->|"mounts routes"| node_user_routes
node_shop_routes -->|"dispatches"| node_shop_controller
node_shop_routes -->|"checks access"| node_auth_controller
node_shop_routes -->|"checks seller"| node_user_controller
node_product_routes -->|"dispatches"| node_product_controller
node_product_routes -->|"checks ownership"| node_shop_controller
node_product_routes -->|"checks sign-in"| node_auth_controller
node_user_routes -->|"dispatches"| node_user_controller
node_user_routes -->|"checks access"| node_auth_controller
node_auth_controller -->|"reads account"| node_user_model
node_auth_controller -->|"uses JWT configuration"| node_server_app
node_shop_controller -->|"queries and saves"| node_shop_model
node_product_controller -->|"queries and saves"| node_product_model
node_user_controller -->|"queries and saves"| node_user_model

click node_app "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/src/App.jsx"
click node_router "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/MainRouter.jsx"
click node_home "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/core/Home.jsx"
click node_shop_browse "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/Shops.jsx"
click node_shop_products "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/ShopProduct.jsx"
click node_cart "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/cart/CartItems.jsx"
click node_checkout "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/cart/Checkout.jsx"
click node_cart_state "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/cart/cart-helper.js"
click node_signin "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/lib/Signin.jsx"
click node_auth_state "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/lib/auth-helper.js"
click node_auth_api "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/lib/api-auth.js"
click node_profile "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/user/Profile.jsx"
click node_user_api "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/user/api-user.js"
click node_seller_shops "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/MyShops.jsx"
click node_shop_edit "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/EditShop.jsx"
click node_shop_api "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/api-shop.js"
click node_product_edit "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/product/EditProduct.jsx"
click node_product_api "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/product/api-product.js"
click node_server_app "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/express.js"
click node_shop_routes "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/shop.routes.js"
click node_product_routes "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/product.routes.js"
click node_user_routes "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/user.routes.js"
click node_auth_controller "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/auth.controller.js"
click node_shop_controller "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/shop.controller.js"
click node_product_controller "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/product.controller.js"
click node_user_controller "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/user.controller.js"
click node_shop_model "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/models/shop.model.js"
click node_product_model "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/models/product.model.js"
click node_user_model "https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/models/user.model.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_app,node_router,node_home,node_shop_browse,node_shop_products,node_cart,node_checkout,node_cart_state toneBlue
class node_signin,node_auth_state,node_auth_api,node_profile,node_user_api toneAmber
class node_seller_shops,node_shop_edit,node_shop_api,node_product_edit,node_product_api toneMint
class node_server_app,node_shop_routes,node_product_routes,node_user_routes,node_auth_controller,node_shop_controller,node_product_controller,node_user_controller,node_shop_model,node_product_model,node_user_model toneRose
class node_visitor toneIndigo
```

## Components

### Storefront client

- [React application](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Page routing](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/MainRouter.jsx): `client/MainRouter.jsx`
- [Home page](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/core/Home.jsx): `client/core/Home.jsx`
- [Shop browsing](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/Shops.jsx): `client/shop/Shops.jsx`
- [Shop products](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/ShopProduct.jsx): `client/shop/ShopProduct.jsx`
- [Cart review](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/cart/CartItems.jsx): `client/cart/CartItems.jsx`
- [Checkout](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/cart/Checkout.jsx): `client/cart/Checkout.jsx`
- [Cart helpers](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/cart/cart-helper.js): `client/cart/cart-helper.js`

### Identity and profiles

- [Sign-in](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/lib/Signin.jsx): `client/lib/Signin.jsx`
- [Authentication state](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/lib/auth-helper.js): `client/lib/auth-helper.js`
- [Auth API client](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/lib/api-auth.js): `client/lib/api-auth.js`
- [Profile management](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/user/Profile.jsx): `client/user/Profile.jsx`
- [User API client](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/user/api-user.js): `client/user/api-user.js`

### Seller management

- [Seller shops](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/MyShops.jsx): `client/shop/MyShops.jsx`
- [Shop editing](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/EditShop.jsx): `client/shop/EditShop.jsx`
- [Shop API client](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/shop/api-shop.js): `client/shop/api-shop.js`
- [Product editing](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/product/EditProduct.jsx): `client/product/EditProduct.jsx`
- [Product API client](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/client/product/api-product.js): `client/product/api-product.js`

### API and persistence

- [Express application](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/express.js): `server/express.js`
- [Shop routes](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/shop.routes.js): `server/routes/shop.routes.js`
- [Product routes](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/product.routes.js): `server/routes/product.routes.js`
- [User routes](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/routes/user.routes.js): `server/routes/user.routes.js`
- [Authentication controller](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Shop controller](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/shop.controller.js): `server/controllers/shop.controller.js`
- [Product controller](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/product.controller.js): `server/controllers/product.controller.js`
- [User controller](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/controllers/user.controller.js): `server/controllers/user.controller.js`
- [Shop records](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/models/shop.model.js): `server/models/shop.model.js`
- [Product records](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/models/product.model.js): `server/models/product.model.js`
- [User records](https://github.com/blessingajiboye/comp229sec001f26new/blob/main/server/models/user.model.js): `server/models/user.model.js`

### Other components

- **Shopper or seller**

## Connections

- Shopper or seller → React application: uses (evidence: `client/src/App.jsx`)
- React application → Page routing: renders (evidence: `client/src/App.jsx`)
- Page routing → Home page: routes to (evidence: `client/MainRouter.jsx`)
- Page routing → Shop browsing: routes to (evidence: `client/MainRouter.jsx`)
- Page routing → Shop products: routes to (evidence: `client/MainRouter.jsx`)
- Page routing → Cart review: routes to (evidence: `client/MainRouter.jsx`)
- Page routing → Checkout: routes to (evidence: `client/MainRouter.jsx`)
- Page routing → Sign-in: routes to (evidence: `client/MainRouter.jsx`)
- Page routing → Profile management: routes to (evidence: `client/MainRouter.jsx`)
- Shop products → Product API client: uses (evidence: `client/shop/ShopProduct.jsx`)
- Shop products → Shop API client: uses (evidence: `client/shop/ShopProduct.jsx`)
- Shop products → Cart review: offers add-to-cart (evidence: `client/shop/ShopProduct.jsx`)
- Cart review → Cart helpers: uses (evidence: `client/cart/CartItems.jsx`)
- Checkout → Cart helpers: uses (evidence: `client/cart/Checkout.jsx`)
- Sign-in → Auth API client: uses (evidence: `client/lib/Signin.jsx`)
- Sign-in → Authentication state: updates (evidence: `client/lib/Signin.jsx`)
- Authentication state → Auth API client: signs out through (evidence: `client/lib/auth-helper.js`)
- Profile management → User API client: uses (evidence: `client/user/Profile.jsx`)
- Seller shops → Shop editing: manages
- Shop editing → Shop API client: uses (evidence: `client/shop/EditShop.jsx`)
- Shop editing → Product editing: shows products through (evidence: `client/shop/EditShop.jsx`)
- Product editing → Product API client: uses (evidence: `client/product/EditProduct.jsx`)
- Express application → Shop routes: mounts routes (evidence: `server/express.js`)
- Express application → Product routes: mounts routes (evidence: `server/express.js`)
- Express application → User routes: mounts routes (evidence: `server/express.js`)
- Shop routes → Shop controller: dispatches (evidence: `server/routes/shop.routes.js`)
- Shop routes → Authentication controller: checks access (evidence: `server/routes/shop.routes.js`)
- Shop routes → User controller: checks seller (evidence: `server/routes/shop.routes.js`)
- Product routes → Product controller: dispatches (evidence: `server/routes/product.routes.js`)
- Product routes → Shop controller: checks ownership (evidence: `server/routes/product.routes.js`)
- Product routes → Authentication controller: checks sign-in (evidence: `server/routes/product.routes.js`)
- User routes → User controller: dispatches (evidence: `server/routes/user.routes.js`)
- User routes → Authentication controller: checks access (evidence: `server/routes/user.routes.js`)
- Authentication controller → User records: reads account (evidence: `server/controllers/auth.controller.js`)
- Authentication controller → Express application: uses JWT configuration (evidence: `server/controllers/auth.controller.js`)
- Shop controller → Shop records: queries and saves (evidence: `server/controllers/shop.controller.js`)
- Product controller → Product records: queries and saves (evidence: `server/controllers/product.controller.js`)
- User controller → User records: queries and saves (evidence: `server/controllers/user.controller.js`)
