# minho-26/mern-project architecture

> Architecture diagram of the GitHub repository minho-26/mern-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/minho-26/mern-project
- Repository: https://github.com/minho-26/mern-project

## Overview

Cyber Tech is a MERN electronics storefront with a separate inventory-admin interface. Shoppers browse category and product pages, add items to a cart, and can sign in or sign up; administrators upload, add, list, and remove products. The backend serves catalog, authentication, cart, and image-upload endpoints, with product and user data persisted in MongoDB. The graph includes documented capabilities even where implementation details were not sampled; those links are omitted when their callers are not evidenced.

Main entry points: [`frontend/src/App.js`](https://github.com/minho-26/mern-project/blob/main/frontend/src/App.js) (Storefront app), [`backend/app.js`](https://github.com/minho-26/mern-project/blob/main/backend/app.js) (Express API), [`frontend/src/Pages/Product.jsx`](https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Product.jsx) (Product page), [`admin/src/Pages/Admin/Admin.jsx`](https://github.com/minho-26/mern-project/blob/main/admin/src/Pages/Admin/Admin.jsx) (Admin routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_web_app["Storefront app<br/>[App.js]"]
  node_shop_home["Home page<br/>[Shop.jsx]"]
  node_category_page["Category pages<br/>[ShopCategory.jsx]"]
  node_product_page["Product page<br/>[Product.jsx]"]
  node_item_card["Product cards<br/>[Item.jsx]"]
  node_product_display["Product display<br/>[ProductDisplay.jsx]"]
  node_related_products["Related products"]
  node_cart_page["Cart page<br/>[Cart.jsx]"]
  node_cart_view["Cart view<br/>[CartItems.jsx]"]
  node_shop_context["Shop context<br/>[ShopContext.jsx]"]
  node_login_page["Login and signup<br/>[LoginSignup.jsx]"]
end

subgraph group_admin["Inventory admin"]
  node_admin_app["Admin app<br/>[App.jsx]"]
  node_admin_routes["Admin routes<br/>[Admin.jsx]"]
  node_add_product["Add product<br/>[AddProduct.jsx]"]
  node_product_list["Product list<br/>[ProductList.jsx]"]
end

subgraph group_backend["Backend services"]
  node_api["Express API<br/>[app.js]"]
end

subgraph group_storage["Persistence"]
  node_image_files["Uploaded images"]
  node_mongodb[("MongoDB")]
end

node_shopper(("Shopper"))
node_admin_user(("Administrator"))

node_shopper -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_shop_home
node_web_app -->|"routes to"| node_category_page
node_web_app -->|"routes to"| node_product_page
node_web_app -->|"routes to"| node_cart_page
node_web_app -->|"routes to"| node_login_page
node_shop_home -->|"renders"| node_item_card
node_category_page -->|"renders"| node_item_card
node_product_page -->|"renders"| node_product_display
node_product_page -->|"renders"| node_related_products
node_item_card -->|"links to"| node_product_page
node_product_display -->|"adds cart item"| node_shop_context
node_cart_page -->|"renders"| node_cart_view
node_cart_view -->|"reads cart"| node_shop_context
node_login_page -->|"sends login/signup"| node_api
node_shop_context -->|"requests catalog/cart"| node_api
node_admin_user -->|"uses"| node_admin_app
node_admin_app -->|"renders"| node_admin_routes
node_admin_routes -->|"routes to"| node_add_product
node_admin_routes -->|"routes to"| node_product_list
node_add_product -->|"uploads and adds"| node_api
node_product_list -->|"lists and removes"| node_api
node_api -->|"stores uploads"| node_image_files
node_api -->|"reads and writes"| node_mongodb

click node_web_app "https://github.com/minho-26/mern-project/blob/main/frontend/src/App.js"
click node_shop_home "https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Shop.jsx"
click node_category_page "https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/ShopCategory.jsx"
click node_product_page "https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Product.jsx"
click node_item_card "https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/Item/Item.jsx"
click node_product_display "https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/ProductDisplay/ProductDisplay.jsx"
click node_related_products "https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/RelatedProducts/RelatedProducts.jsx"
click node_cart_page "https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Cart.jsx"
click node_cart_view "https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/CartItems/CartItems.jsx"
click node_shop_context "https://github.com/minho-26/mern-project/blob/main/frontend/src/Context/ShopContext.jsx"
click node_login_page "https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/LoginSignup.jsx"
click node_admin_app "https://github.com/minho-26/mern-project/blob/main/admin/src/App.jsx"
click node_admin_routes "https://github.com/minho-26/mern-project/blob/main/admin/src/Pages/Admin/Admin.jsx"
click node_add_product "https://github.com/minho-26/mern-project/blob/main/admin/src/Components/AddProduct/AddProduct.jsx"
click node_product_list "https://github.com/minho-26/mern-project/blob/main/admin/src/Components/ProductList/ProductList.jsx"
click node_api "https://github.com/minho-26/mern-project/blob/main/backend/app.js"
click node_image_files "https://github.com/minho-26/mern-project/tree/main/backend/upload/images"

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_web_app,node_shop_home,node_category_page,node_product_page,node_item_card,node_product_display,node_related_products,node_cart_page,node_cart_view,node_shop_context,node_login_page toneBlue
class node_admin_app,node_admin_routes,node_add_product,node_product_list toneAmber
class node_api toneMint
class node_image_files,node_mongodb toneRose
class node_shopper,node_admin_user toneIndigo
```

## Components

### Storefront

- [Storefront app](https://github.com/minho-26/mern-project/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Home page](https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Shop.jsx): `frontend/src/Pages/Shop.jsx`
- [Category pages](https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/ShopCategory.jsx): `frontend/src/Pages/ShopCategory.jsx`
- [Product page](https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Product.jsx): `frontend/src/Pages/Product.jsx`
- [Product cards](https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/Item/Item.jsx): `frontend/src/Components/Item/Item.jsx`
- [Product display](https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/ProductDisplay/ProductDisplay.jsx): `frontend/src/Components/ProductDisplay/ProductDisplay.jsx`
- [Related products](https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/RelatedProducts/RelatedProducts.jsx): `frontend/src/Components/RelatedProducts/RelatedProducts.jsx`
- [Cart page](https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/Cart.jsx): `frontend/src/Pages/Cart.jsx`
- [Cart view](https://github.com/minho-26/mern-project/blob/main/frontend/src/Components/CartItems/CartItems.jsx): `frontend/src/Components/CartItems/CartItems.jsx`
- [Shop context](https://github.com/minho-26/mern-project/blob/main/frontend/src/Context/ShopContext.jsx): `frontend/src/Context/ShopContext.jsx`
- [Login and signup](https://github.com/minho-26/mern-project/blob/main/frontend/src/Pages/LoginSignup.jsx): `frontend/src/Pages/LoginSignup.jsx`

### Inventory admin

- [Admin app](https://github.com/minho-26/mern-project/blob/main/admin/src/App.jsx): `admin/src/App.jsx`
- [Admin routes](https://github.com/minho-26/mern-project/blob/main/admin/src/Pages/Admin/Admin.jsx): `admin/src/Pages/Admin/Admin.jsx`
- [Add product](https://github.com/minho-26/mern-project/blob/main/admin/src/Components/AddProduct/AddProduct.jsx): `admin/src/Components/AddProduct/AddProduct.jsx`
- [Product list](https://github.com/minho-26/mern-project/blob/main/admin/src/Components/ProductList/ProductList.jsx): `admin/src/Components/ProductList/ProductList.jsx`

### Backend services

- [Express API](https://github.com/minho-26/mern-project/blob/main/backend/app.js): `backend/app.js`

### Persistence

- [Uploaded images](https://github.com/minho-26/mern-project/tree/main/backend/upload/images): `backend/upload/images`
- **MongoDB**

### Other components

- **Shopper**
- **Administrator**

## Connections

- Shopper → Storefront app: uses (evidence: `README.md`)
- Storefront app → Home page: routes to (evidence: `frontend/src/App.js`)
- Storefront app → Category pages: routes to (evidence: `frontend/src/App.js`)
- Storefront app → Product page: routes to (evidence: `frontend/src/App.js`)
- Storefront app → Cart page: routes to (evidence: `frontend/src/App.js`)
- Storefront app → Login and signup: routes to (evidence: `frontend/src/App.js`)
- Home page → Product cards: renders (evidence: `frontend/src/Pages/Shop.jsx`)
- Category pages → Product cards: renders (evidence: `frontend/src/Pages/ShopCategory.jsx`)
- Product page → Product display: renders (evidence: `frontend/src/Pages/Product.jsx`)
- Product page → Related products: renders (evidence: `frontend/src/Pages/Product.jsx`)
- Product cards → Product page: links to (evidence: `frontend/src/Components/Item/Item.jsx`)
- Product display → Shop context: adds cart item (evidence: `frontend/src/Components/ProductDisplay/ProductDisplay.jsx`)
- Cart page → Cart view: renders (evidence: `frontend/src/Pages/Cart.jsx`)
- Cart view → Shop context: reads cart (evidence: `frontend/src/Components/CartItems/CartItems.jsx`)
- Login and signup → Express API: sends login/signup (evidence: `frontend/src/Pages/LoginSignup.jsx`)
- Shop context → Express API: requests catalog/cart (evidence: `frontend/src/Context/ShopContext.jsx`)
- Administrator → Admin app: uses (evidence: `README.md`)
- Admin app → Admin routes: renders (evidence: `admin/src/App.jsx`)
- Admin routes → Add product: routes to (evidence: `admin/src/Pages/Admin/Admin.jsx`)
- Admin routes → Product list: routes to (evidence: `admin/src/Pages/Admin/Admin.jsx`)
- Add product → Express API: uploads and adds (evidence: `admin/src/Components/AddProduct/AddProduct.jsx`)
- Product list → Express API: lists and removes (evidence: `admin/src/Components/ProductList/ProductList.jsx`)
- Express API → Uploaded images: stores uploads (evidence: `backend/app.js`)
- Express API → MongoDB: reads and writes (evidence: `backend/app.js`)
