# basir/node-react-ecommerce architecture

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

- Interactive diagram: https://gitdiagram.com/basir/node-react-ecommerce
- Repository: https://github.com/basir/node-react-ecommerce

## Overview

Amazona is a React/Redux and Express/MongoDB ecommerce application. Customers browse and review products, authenticate, build a cart, enter shipping and payment details, place orders, pay, and view order history; administrators manage products and orders. The diagram preserves these domain stages and the API/model layer. Edges reflect the sampled source and README; some route/API details are supported by the index or README rather than opened route excerpts.

Main entry points: [`frontend/src/App.js`](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/App.js) (App routing), [`backend/server.js`](https://github.com/basir/node-react-ecommerce/blob/master/backend/server.js) (Express server and routing), [`frontend/src/actions/orderActions.js`](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/orderActions.js) (Order actions), [`backend/routes/userRoute.js`](https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/userRoute.js) (User API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App routing<br/>[App.js]"]
  node_catalog["Browse and filter<br/>[ProductsScreen.js]"]
  node_product["Product details and reviews<br/>[ProductScreen.js]"]
  node_rating["Rating display<br/>[Rating.js]"]
  node_product_actions["Product actions<br/>[productActions.js]"]
end

subgraph group_checkout["Checkout and Orders"]
  node_cart["Shopping cart<br/>[CartScreen.js]"]
  node_shipping["Shipping details<br/>[ShippingScreen.js]"]
  node_payment["Payment method<br/>[PaymentScreen.js]"]
  node_place_order["Place order"]
  node_order_actions["Order actions<br/>[orderActions.js]"]
  node_order_detail["Order details and payment<br/>[OrderScreen.js]"]
  node_order_lists["Order history and admin list<br/>[OrdersScreen.js]"]
  node_paypal["PayPal checkout<br/>[PaypalButton.js]"]
end

subgraph group_identity["Accounts"]
  node_signin_register["Sign in and register<br/>[SigninScreen.js]"]
  node_register_screen["Registration form<br/>[RegisterScreen.js]"]
  node_profile["Profile and order history<br/>[ProfileScreen.js]"]
  node_user_actions["User actions<br/>[userActions.js]"]
end

subgraph group_api["Backend API"]
  node_server["Express server and routing<br/>[server.js]"]
  node_user_api["User API<br/>[userRoute.js]"]
  node_product_api["Product API<br/>[productRoute.js]"]
  node_order_api["Order API<br/>[orderRoute.js]"]
  node_upload_api["Image upload API<br/>[uploadRoute.js]"]
  node_auth_util["JWT authorization<br/>[util.js]"]
  node_config["Runtime configuration<br/>[config.js]"]
end

subgraph group_persistence["Persistence"]
  node_user_model[("User model<br/>[userModel.js]")]
  node_product_model[("Product model<br/>[productModel.js]")]
  node_order_model[("Order model<br/>[orderModel.js]")]
end

node_shopper(("Shopper or admin"))
node_paypal_service(("PayPal"))
node_mongo[("MongoDB")]

node_shopper -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_product
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_signin_register
node_app -->|"routes to"| node_register_screen
node_app -->|"routes to"| node_shipping
node_app -->|"routes to"| node_payment
node_app -->|"routes to"| node_place_order
node_app -->|"routes to"| node_order_detail
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_order_lists
node_catalog -->|"dispatches"| node_product_actions
node_product -->|"dispatches"| node_product_actions
node_product -->|"renders"| node_rating
node_cart -.->|"continues checkout"| node_shipping
node_shipping -.->|"continues checkout"| node_payment
node_payment -.->|"continues checkout"| node_place_order
node_place_order -->|"dispatches"| node_order_actions
node_order_detail -->|"dispatches"| node_order_actions
node_order_lists -->|"dispatches"| node_order_actions
node_order_detail -->|"renders"| node_paypal
node_paypal -.->|"initiates payment"| node_paypal_service
node_signin_register -->|"dispatches"| node_user_actions
node_register_screen -->|"dispatches"| node_user_actions
node_profile -->|"dispatches"| node_user_actions
node_profile -->|"dispatches"| node_order_actions
node_server -->|"mounts"| node_user_api
node_server -->|"mounts"| node_product_api
node_server -->|"mounts"| node_order_api
node_server -->|"mounts"| node_upload_api
node_server -->|"reads settings"| node_config
node_product_actions -->|"requests products"| node_product_api
node_user_actions -->|"requests accounts"| node_user_api
node_order_actions -->|"requests orders"| node_order_api
node_catalog -->|"uploads image"| node_upload_api
node_user_api -->|"reads and writes"| node_user_model
node_user_api -->|"creates tokens"| node_auth_util
node_product_api -->|"reads and writes"| node_product_model
node_product_api -->|"checks access"| node_auth_util
node_order_api -->|"reads and writes"| node_order_model
node_order_api -->|"checks access"| node_auth_util
node_upload_api -->|"uses credentials"| node_config
node_server -->|"connects"| node_mongo
node_user_model -.->|"persists"| node_mongo
node_product_model -.->|"persists"| node_mongo
node_order_model -.->|"persists"| node_mongo

click node_app "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/App.js"
click node_catalog "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ProductsScreen.js"
click node_product "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ProductScreen.js"
click node_rating "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/components/Rating.js"
click node_product_actions "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/productActions.js"
click node_cart "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/CartScreen.js"
click node_shipping "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ShippingScreen.js"
click node_payment "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/PaymentScreen.js"
click node_place_order "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/PlaceOrderScreen.js"
click node_order_actions "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/orderActions.js"
click node_order_detail "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/OrderScreen.js"
click node_order_lists "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/OrdersScreen.js"
click node_paypal "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/components/PaypalButton.js"
click node_signin_register "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/SigninScreen.js"
click node_register_screen "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/RegisterScreen.js"
click node_profile "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ProfileScreen.js"
click node_user_actions "https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/userActions.js"
click node_server "https://github.com/basir/node-react-ecommerce/blob/master/backend/server.js"
click node_user_api "https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/userRoute.js"
click node_product_api "https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/productRoute.js"
click node_order_api "https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/orderRoute.js"
click node_upload_api "https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/uploadRoute.js"
click node_auth_util "https://github.com/basir/node-react-ecommerce/blob/master/backend/util.js"
click node_user_model "https://github.com/basir/node-react-ecommerce/blob/master/backend/models/userModel.js"
click node_product_model "https://github.com/basir/node-react-ecommerce/blob/master/backend/models/productModel.js"
click node_order_model "https://github.com/basir/node-react-ecommerce/blob/master/backend/models/orderModel.js"
click node_config "https://github.com/basir/node-react-ecommerce/blob/master/backend/config.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_catalog,node_product,node_rating,node_product_actions toneBlue
class node_cart,node_shipping,node_payment,node_place_order,node_order_actions,node_order_detail,node_order_lists,node_paypal,node_mongo toneAmber
class node_signin_register,node_register_screen,node_profile,node_user_actions toneMint
class node_server,node_user_api,node_product_api,node_order_api,node_upload_api,node_auth_util,node_config toneRose
class node_user_model,node_product_model,node_order_model,node_shopper,node_paypal_service toneIndigo
```

## Components

### Storefront

- [App routing](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/App.js): `frontend/src/App.js`
- [Browse and filter](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ProductsScreen.js): `frontend/src/screens/ProductsScreen.js`
- [Product details and reviews](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ProductScreen.js): `frontend/src/screens/ProductScreen.js`
- [Rating display](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/components/Rating.js): `frontend/src/components/Rating.js`
- [Product actions](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/productActions.js): `frontend/src/actions/productActions.js`

### Checkout and Orders

- [Shopping cart](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/CartScreen.js): `frontend/src/screens/CartScreen.js`
- [Shipping details](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ShippingScreen.js): `frontend/src/screens/ShippingScreen.js`
- [Payment method](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/PaymentScreen.js): `frontend/src/screens/PaymentScreen.js`
- [Place order](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/PlaceOrderScreen.js): `frontend/src/screens/PlaceOrderScreen.js`
- [Order actions](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/orderActions.js): `frontend/src/actions/orderActions.js`
- [Order details and payment](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/OrderScreen.js): `frontend/src/screens/OrderScreen.js`
- [Order history and admin list](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/OrdersScreen.js): `frontend/src/screens/OrdersScreen.js`
- [PayPal checkout](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/components/PaypalButton.js): `frontend/src/components/PaypalButton.js`

### Accounts

- [Sign in and register](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/SigninScreen.js): `frontend/src/screens/SigninScreen.js`
- [Registration form](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/RegisterScreen.js): `frontend/src/screens/RegisterScreen.js`
- [Profile and order history](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/screens/ProfileScreen.js): `frontend/src/screens/ProfileScreen.js`
- [User actions](https://github.com/basir/node-react-ecommerce/blob/master/frontend/src/actions/userActions.js): `frontend/src/actions/userActions.js`

### Backend API

- [Express server and routing](https://github.com/basir/node-react-ecommerce/blob/master/backend/server.js): `backend/server.js`
- [User API](https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/userRoute.js): `backend/routes/userRoute.js`
- [Product API](https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/productRoute.js): `backend/routes/productRoute.js`
- [Order API](https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/orderRoute.js): `backend/routes/orderRoute.js`
- [Image upload API](https://github.com/basir/node-react-ecommerce/blob/master/backend/routes/uploadRoute.js): `backend/routes/uploadRoute.js`
- [JWT authorization](https://github.com/basir/node-react-ecommerce/blob/master/backend/util.js): `backend/util.js`
- [Runtime configuration](https://github.com/basir/node-react-ecommerce/blob/master/backend/config.js): `backend/config.js`

### Persistence

- [User model](https://github.com/basir/node-react-ecommerce/blob/master/backend/models/userModel.js): `backend/models/userModel.js`
- [Product model](https://github.com/basir/node-react-ecommerce/blob/master/backend/models/productModel.js): `backend/models/productModel.js`
- [Order model](https://github.com/basir/node-react-ecommerce/blob/master/backend/models/orderModel.js): `backend/models/orderModel.js`

### Other components

- **Shopper or admin**
- **PayPal**
- **MongoDB**

## Connections

- Shopper or admin → App routing: uses (evidence: `frontend/src/App.js`)
- App routing → Browse and filter: routes to (evidence: `frontend/src/App.js`)
- App routing → Product details and reviews: routes to (evidence: `frontend/src/App.js`)
- App routing → Shopping cart: routes to (evidence: `frontend/src/App.js`)
- App routing → Sign in and register: routes to (evidence: `frontend/src/App.js`)
- App routing → Registration form: routes to (evidence: `frontend/src/App.js`)
- App routing → Shipping details: routes to (evidence: `frontend/src/App.js`)
- App routing → Payment method: routes to (evidence: `frontend/src/App.js`)
- App routing → Place order: routes to (evidence: `frontend/src/App.js`)
- App routing → Order details and payment: routes to (evidence: `frontend/src/App.js`)
- App routing → Profile and order history: routes to (evidence: `frontend/src/App.js`)
- App routing → Order history and admin list: routes to (evidence: `frontend/src/App.js`)
- Browse and filter → Product actions: dispatches (evidence: `frontend/src/screens/ProductsScreen.js`)
- Product details and reviews → Product actions: dispatches (evidence: `frontend/src/screens/ProductScreen.js`)
- Product details and reviews → Rating display: renders (evidence: `frontend/src/screens/ProductScreen.js`)
- Shopping cart → Shipping details: continues checkout
- Shipping details → Payment method: continues checkout
- Payment method → Place order: continues checkout
- Place order → Order actions: dispatches (evidence: `frontend/src/screens/PlaceOrderScreen.js`)
- Order details and payment → Order actions: dispatches (evidence: `frontend/src/screens/OrderScreen.js`)
- Order history and admin list → Order actions: dispatches (evidence: `frontend/src/screens/OrdersScreen.js`)
- Order details and payment → PayPal checkout: renders (evidence: `frontend/src/screens/OrderScreen.js`)
- PayPal checkout → PayPal: initiates payment
- Sign in and register → User actions: dispatches (evidence: `frontend/src/screens/SigninScreen.js`)
- Registration form → User actions: dispatches (evidence: `frontend/src/screens/RegisterScreen.js`)
- Profile and order history → User actions: dispatches (evidence: `frontend/src/screens/ProfileScreen.js`)
- Profile and order history → Order actions: dispatches (evidence: `frontend/src/screens/ProfileScreen.js`)
- Express server and routing → User API: mounts (evidence: `backend/server.js`)
- Express server and routing → Product API: mounts (evidence: `backend/server.js`)
- Express server and routing → Order API: mounts (evidence: `backend/server.js`)
- Express server and routing → Image upload API: mounts (evidence: `backend/server.js`)
- Express server and routing → Runtime configuration: reads settings (evidence: `backend/server.js`)
- Product actions → Product API: requests products (evidence: `frontend/src/actions/productActions.js`)
- User actions → User API: requests accounts (evidence: `frontend/src/actions/userActions.js`)
- Order actions → Order API: requests orders (evidence: `frontend/src/actions/orderActions.js`)
- Browse and filter → Image upload API: uploads image (evidence: `frontend/src/screens/ProductsScreen.js`)
- User API → User model: reads and writes (evidence: `backend/routes/userRoute.js`)
- User API → JWT authorization: creates tokens (evidence: `backend/routes/userRoute.js`)
- Product API → Product model: reads and writes (evidence: `backend/routes/productRoute.js`)
- Product API → JWT authorization: checks access (evidence: `backend/routes/productRoute.js`)
- Order API → Order model: reads and writes (evidence: `backend/routes/orderRoute.js`)
- Order API → JWT authorization: checks access (evidence: `backend/routes/orderRoute.js`)
- Image upload API → Runtime configuration: uses credentials (evidence: `backend/routes/uploadRoute.js`)
- Express server and routing → MongoDB: connects (evidence: `backend/server.js`)
- User model → MongoDB: persists
- Product model → MongoDB: persists
- Order model → MongoDB: persists
