# saiteja74/shopkart architecture

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

- Interactive diagram: https://gitdiagram.com/saiteja74/shopkart
- Repository: https://github.com/saiteja74/shopkart

## Overview

Shopkart is a MERN shopping-cart application. Shoppers browse and search products, add items to a cart, provide shipping and payment details, place orders, and view order status; accounts support registration and profile management. Admin screens cover product, user, and order management, while product reviews and image uploads provide supporting capabilities. The frontend uses Redux action/reducer modules and calls an Express API backed by MongoDB. Source excerpts confirm the server routing and controller-to-model relationships; several frontend screen-to-action connections and payment-provider details are inferred only from the file tree and are not drawn.

Main entry points: [`frontend/src/App.js`](https://github.com/saiteja74/shopkart/blob/master/frontend/src/App.js) (App routes), [`backend/server.js`](https://github.com/saiteja74/shopkart/blob/master/backend/server.js) (Express server), [`backend/routes/productRoutes.js`](https://github.com/saiteja74/shopkart/blob/master/backend/routes/productRoutes.js) (Product routes), [`backend/routes/userRoutes.js`](https://github.com/saiteja74/shopkart/blob/master/backend/routes/userRoutes.js) (User routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Shopping frontend"]
  node_app["App routes<br/>[App.js]"]
  node_catalog_screens["Catalog screens<br/>[HomeScreen.js]"]
  node_product_screen["Product detail<br/>[ProductScreen.js]"]
  node_cart_checkout["Cart and checkout<br/>[CartScreen.js]"]
  node_account_screens["Account screens<br/>[ProfileScreen.js]"]
  node_admin_screens["Admin screens"]
  node_redux_store["Redux state<br/>[store.js]"]
  node_product_actions["Product actions<br/>[productActions.js]"]
  node_cart_actions["Cart actions<br/>[cartActions.js]"]
  node_order_actions["Order actions<br/>[orderActions.js]"]
  node_user_actions["User actions<br/>[userActions.js]"]
end

subgraph group_api["API and access"]
  node_server["Express server<br/>[server.js]"]
  node_product_routes["Product routes<br/>[productRoutes.js]"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_order_routes["Order routes<br/>[orderRoutes.js]"]
  node_auth["Access control<br/>[authMiddleware.js]"]
end

subgraph group_catalog["Catalog and media"]
  node_products["Product service"]
  node_upload["Image upload<br/>[uploadRoutes.js]"]
end

subgraph group_commerce["Orders and users"]
  node_users["User service<br/>[userController.js]"]
  node_orders["Order service<br/>[orderController.js]"]
  node_payment_config["PayPal config<br/>[server.js]"]
end

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

node_shopper(("Shopper"))
node_admin_actor(("Administrator"))
node_paypal["PayPal"]

node_shopper -->|"uses"| node_app
node_admin_actor -->|"uses"| node_app
node_app -->|"routes to"| node_catalog_screens
node_app -->|"routes to"| node_product_screen
node_app -->|"routes to"| node_cart_checkout
node_app -->|"routes to"| node_account_screens
node_app -->|"routes to"| node_admin_screens
node_server -->|"mounts"| node_product_routes
node_server -->|"mounts"| node_user_routes
node_server -->|"mounts"| node_order_routes
node_product_routes -->|"dispatches"| node_products
node_user_routes -->|"dispatches"| node_users
node_order_routes -->|"dispatches"| node_orders
node_product_routes -->|"guards"| node_auth
node_user_routes -->|"guards"| node_auth
node_order_routes -->|"guards"| node_auth
node_products -->|"queries"| node_product_model
node_users -->|"queries"| node_user_model
node_orders -->|"queries"| node_order_model
node_server -->|"connects via"| node_mongo
node_product_model -->|"persists"| node_mongo
node_user_model -->|"persists"| node_mongo
node_order_model -->|"persists"| node_mongo
node_server -->|"mounts"| node_upload
node_server -->|"serves"| node_payment_config
node_paypal -.->|"provides ID"| node_payment_config

click node_app "https://github.com/saiteja74/shopkart/blob/master/frontend/src/App.js"
click node_catalog_screens "https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/HomeScreen.js"
click node_product_screen "https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/ProductScreen.js"
click node_cart_checkout "https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/CartScreen.js"
click node_account_screens "https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/ProfileScreen.js"
click node_admin_screens "https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/ProductListScreen.js"
click node_redux_store "https://github.com/saiteja74/shopkart/blob/master/frontend/src/store.js"
click node_product_actions "https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/productActions.js"
click node_cart_actions "https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/cartActions.js"
click node_order_actions "https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/orderActions.js"
click node_user_actions "https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/userActions.js"
click node_server "https://github.com/saiteja74/shopkart/blob/master/backend/server.js"
click node_product_routes "https://github.com/saiteja74/shopkart/blob/master/backend/routes/productRoutes.js"
click node_user_routes "https://github.com/saiteja74/shopkart/blob/master/backend/routes/userRoutes.js"
click node_order_routes "https://github.com/saiteja74/shopkart/blob/master/backend/routes/orderRoutes.js"
click node_auth "https://github.com/saiteja74/shopkart/blob/master/backend/middleware/authMiddleware.js"
click node_products "https://github.com/saiteja74/shopkart/blob/master/backend/controllers/productController.js"
click node_upload "https://github.com/saiteja74/shopkart/blob/master/backend/routes/uploadRoutes.js"
click node_users "https://github.com/saiteja74/shopkart/blob/master/backend/controllers/userController.js"
click node_orders "https://github.com/saiteja74/shopkart/blob/master/backend/controllers/orderController.js"
click node_payment_config "https://github.com/saiteja74/shopkart/blob/master/backend/server.js"
click node_product_model "https://github.com/saiteja74/shopkart/blob/master/backend/models/productModel.js"
click node_user_model "https://github.com/saiteja74/shopkart/blob/master/backend/models/userModel.js"
click node_order_model "https://github.com/saiteja74/shopkart/blob/master/backend/models/orderModel.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_screens,node_product_screen,node_cart_checkout,node_account_screens,node_admin_screens,node_redux_store,node_product_actions,node_cart_actions,node_order_actions,node_user_actions toneBlue
class node_server,node_product_routes,node_user_routes,node_order_routes,node_auth toneAmber
class node_products,node_upload toneMint
class node_users,node_orders,node_payment_config toneRose
class node_product_model,node_user_model,node_order_model,node_mongo,node_shopper,node_admin_actor,node_paypal toneIndigo
```

## Components

### Shopping frontend

- [App routes](https://github.com/saiteja74/shopkart/blob/master/frontend/src/App.js): `frontend/src/App.js`
- [Catalog screens](https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/HomeScreen.js): `frontend/src/screens/HomeScreen.js`
- [Product detail](https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/ProductScreen.js): `frontend/src/screens/ProductScreen.js`
- [Cart and checkout](https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/CartScreen.js): `frontend/src/screens/CartScreen.js`
- [Account screens](https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/ProfileScreen.js): `frontend/src/screens/ProfileScreen.js`
- [Admin screens](https://github.com/saiteja74/shopkart/blob/master/frontend/src/screens/ProductListScreen.js): `frontend/src/screens/ProductListScreen.js`
- [Redux state](https://github.com/saiteja74/shopkart/blob/master/frontend/src/store.js): `frontend/src/store.js`
- [Product actions](https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/productActions.js): `frontend/src/actions/productActions.js`
- [Cart actions](https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/cartActions.js): `frontend/src/actions/cartActions.js`
- [Order actions](https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/orderActions.js): `frontend/src/actions/orderActions.js`
- [User actions](https://github.com/saiteja74/shopkart/blob/master/frontend/src/actions/userActions.js): `frontend/src/actions/userActions.js`

### API and access

- [Express server](https://github.com/saiteja74/shopkart/blob/master/backend/server.js): `backend/server.js`
- [Product routes](https://github.com/saiteja74/shopkart/blob/master/backend/routes/productRoutes.js): `backend/routes/productRoutes.js`
- [User routes](https://github.com/saiteja74/shopkart/blob/master/backend/routes/userRoutes.js): `backend/routes/userRoutes.js`
- [Order routes](https://github.com/saiteja74/shopkart/blob/master/backend/routes/orderRoutes.js): `backend/routes/orderRoutes.js`
- [Access control](https://github.com/saiteja74/shopkart/blob/master/backend/middleware/authMiddleware.js): `backend/middleware/authMiddleware.js`

### Catalog and media

- [Product service](https://github.com/saiteja74/shopkart/blob/master/backend/controllers/productController.js): `backend/controllers/productController.js`
- [Image upload](https://github.com/saiteja74/shopkart/blob/master/backend/routes/uploadRoutes.js): `backend/routes/uploadRoutes.js`

### Orders and users

- [User service](https://github.com/saiteja74/shopkart/blob/master/backend/controllers/userController.js): `backend/controllers/userController.js`
- [Order service](https://github.com/saiteja74/shopkart/blob/master/backend/controllers/orderController.js): `backend/controllers/orderController.js`
- [PayPal config](https://github.com/saiteja74/shopkart/blob/master/backend/server.js): `backend/server.js`

### Persistence

- [Product model](https://github.com/saiteja74/shopkart/blob/master/backend/models/productModel.js): `backend/models/productModel.js`
- [User model](https://github.com/saiteja74/shopkart/blob/master/backend/models/userModel.js): `backend/models/userModel.js`
- [Order model](https://github.com/saiteja74/shopkart/blob/master/backend/models/orderModel.js): `backend/models/orderModel.js`
- **MongoDB**

### Other components

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

## Connections

- Shopper → App routes: uses
- Administrator → App routes: uses
- App routes → Catalog screens: routes to
- App routes → Product detail: routes to
- App routes → Cart and checkout: routes to
- App routes → Account screens: routes to
- App routes → Admin screens: routes to
- Express server → Product routes: mounts
- Express server → User routes: mounts
- Express server → Order routes: mounts
- Product routes → Product service: dispatches
- User routes → User service: dispatches
- Order routes → Order service: dispatches
- Product routes → Access control: guards
- User routes → Access control: guards
- Order routes → Access control: guards
- Product service → Product model: queries
- User service → User model: queries
- Order service → Order model: queries
- Express server → MongoDB: connects via
- Product model → MongoDB: persists
- User model → MongoDB: persists
- Order model → MongoDB: persists
- Express server → Image upload: mounts
- Express server → PayPal config: serves
- PayPal → PayPal config: provides ID
