# niluj/tech_store architecture

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

- Interactive diagram: https://gitdiagram.com/niluj/tech_store
- Repository: https://github.com/niluj/tech_store

## Overview

Fusion Electronics is a MERN e-commerce application. Shoppers browse and search the catalog, inspect products, manage a cart, check out, and track orders; authentication and vector-based product recommendations are additional capabilities. The frontend calls the Express API through a shared Axios client, while MongoDB stores catalog, user, and order data. Product changes can trigger Pinecone synchronization. Edges reflect README statements and shown or indexed references; unsampled subsystem details and optional Weaviate wiring are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/niluj/tech_store/blob/dev/src/App.jsx) (App and routes), [`backend/index.js`](https://github.com/niluj/tech_store/blob/dev/backend/index.js) (Express API), [`backend/models/product.js`](https://github.com/niluj/tech_store/blob/dev/backend/models/product.js) (Product model), [`src/services/apiClient.js`](https://github.com/niluj/tech_store/blob/dev/src/services/apiClient.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_app["App and routes<br/>[App.jsx]"]
  node_navigation["Navigation<br/>[NavigationBar.jsx]"]
  node_home["Home page<br/>[Home.jsx]"]
  node_shop["Shop page<br/>[Shop.jsx]"]
  node_productdetails["Product details<br/>[ProductDetails.jsx]"]
  node_searchresults["Search results<br/>[SearchResults.jsx]"]
  node_notification["Notifications"]
end

subgraph group_commerce["Commerce"]
  node_cart["Cart<br/>[Cart.jsx]"]
  node_checkout["Checkout<br/>[Checkout.jsx]"]
  node_checkoutform["Checkout form<br/>[CheckoutForm.jsx]"]
  node_orderconfirmation["Order confirmation<br/>[OrderSuccess.jsx]"]
  node_tracking["Order tracking<br/>[OrderTracking.jsx]"]
end

subgraph group_api["API"]
  node_apiclient["API client<br/>[apiClient.js]"]
  node_server["Express API<br/>[index.js]"]
  node_catalogroutes["Catalog routes<br/>[products.js]"]
  node_searchroutes["Search route<br/>[search.js]"]
  node_checkoutroute["Checkout route<br/>[checkout.js]"]
  node_ordersroute["Order routes<br/>[orders.js]"]
end

subgraph group_data["Data and search"]
  node_productmodel["Product model<br/>[product.js]"]
  node_ordermodel["Order model<br/>[order.js]"]
  node_mongodb[("MongoDB")]
  node_pinecone[("Pinecone index")]
  node_embeddings["Embedding sync<br/>[pineconeSync.js]"]
  node_pineconeclient["Pinecone client<br/>[pineconeClient.js]"]
  node_weaviate["Weaviate client<br/>[weaviateClient.js]"]
end

subgraph group_identity["Identity"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_usermodel["User model<br/>[user.js]"]
end

node_shopper(("Shopper"))

node_shopper -->|"uses storefront"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_shop
node_app -->|"routes to"| node_productdetails
node_app -->|"routes to"| node_cart
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_orderconfirmation
node_app -->|"routes to"| node_tracking
node_app -->|"renders"| node_navigation
node_navigation -->|"renders"| node_searchresults
node_shopper -->|"searches catalog"| node_navigation
node_home -->|"requests products"| node_apiclient
node_checkout -->|"renders"| node_checkoutform
node_checkout -->|"submits order"| node_apiclient
node_tracking -->|"loads order"| node_apiclient
node_productdetails -->|"loads product"| node_apiclient
node_apiclient -->|"HTTP requests"| node_server
node_server -->|"mounts route"| node_catalogroutes
node_server -->|"mounts route"| node_checkoutroute
node_server -->|"mounts route"| node_ordersroute
node_server -->|"mounts route"| node_authroutes
node_server -->|"mounts route"| node_searchroutes
node_catalogroutes -->|"queries products"| node_productmodel
node_searchroutes -->|"queries products"| node_productmodel
node_checkoutroute -->|"reads products"| node_productmodel
node_checkoutroute -->|"creates order"| node_ordermodel
node_ordersroute -->|"queries orders"| node_ordermodel
node_authroutes -->|"queries users"| node_usermodel
node_server -->|"connects"| node_mongodb
node_productmodel -->|"stores products"| node_mongodb
node_ordermodel -->|"stores orders"| node_mongodb
node_usermodel -->|"stores users"| node_mongodb
node_productmodel -->|"syncs changes"| node_embeddings
node_embeddings -->|"upserts vectors"| node_pineconeclient
node_pineconeclient -->|"queries index"| node_pinecone
node_catalogroutes -->|"uses vector search"| node_pineconeclient
node_shopper -->|"authenticates"| node_authroutes
node_shopper -->|"places order"| node_checkout
node_shopper -->|"tracks order"| node_tracking
node_weaviate -.-> node_pinecone

click node_app "https://github.com/niluj/tech_store/blob/dev/src/App.jsx"
click node_navigation "https://github.com/niluj/tech_store/blob/dev/src/components/NavigationBar.jsx"
click node_home "https://github.com/niluj/tech_store/blob/dev/src/pages/Home.jsx"
click node_shop "https://github.com/niluj/tech_store/blob/dev/src/pages/Shop.jsx"
click node_productdetails "https://github.com/niluj/tech_store/blob/dev/src/pages/ProductDetails.jsx"
click node_searchresults "https://github.com/niluj/tech_store/blob/dev/src/components/SearchResults.jsx"
click node_cart "https://github.com/niluj/tech_store/blob/dev/src/pages/Cart.jsx"
click node_checkout "https://github.com/niluj/tech_store/blob/dev/src/pages/Checkout.jsx"
click node_checkoutform "https://github.com/niluj/tech_store/blob/dev/src/components/CheckoutForm.jsx"
click node_orderconfirmation "https://github.com/niluj/tech_store/blob/dev/src/pages/OrderSuccess.jsx"
click node_tracking "https://github.com/niluj/tech_store/blob/dev/src/pages/OrderTracking.jsx"
click node_apiclient "https://github.com/niluj/tech_store/blob/dev/src/services/apiClient.js"
click node_server "https://github.com/niluj/tech_store/blob/dev/backend/index.js"
click node_catalogroutes "https://github.com/niluj/tech_store/blob/dev/backend/routes/products.js"
click node_searchroutes "https://github.com/niluj/tech_store/blob/dev/backend/routes/search.js"
click node_checkoutroute "https://github.com/niluj/tech_store/blob/dev/backend/routes/checkout.js"
click node_ordersroute "https://github.com/niluj/tech_store/blob/dev/backend/routes/orders.js"
click node_authroutes "https://github.com/niluj/tech_store/blob/dev/backend/routes/auth.js"
click node_productmodel "https://github.com/niluj/tech_store/blob/dev/backend/models/product.js"
click node_ordermodel "https://github.com/niluj/tech_store/blob/dev/backend/models/order.js"
click node_usermodel "https://github.com/niluj/tech_store/blob/dev/backend/models/user.js"
click node_embeddings "https://github.com/niluj/tech_store/blob/dev/backend/services/pineconeSync.js"
click node_pineconeclient "https://github.com/niluj/tech_store/blob/dev/backend/pineconeClient.js"
click node_weaviate "https://github.com/niluj/tech_store/blob/dev/backend/weaviateClient.js"
click node_notification "https://github.com/niluj/tech_store/blob/dev/src/context/NotificationProvider.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_home,node_shop,node_productdetails,node_searchresults,node_notification toneBlue
class node_cart,node_checkout,node_checkoutform,node_orderconfirmation,node_tracking toneAmber
class node_apiclient,node_server,node_catalogroutes,node_searchroutes,node_checkoutroute,node_ordersroute toneMint
class node_productmodel,node_ordermodel,node_mongodb,node_pinecone,node_embeddings,node_pineconeclient,node_weaviate toneRose
class node_authroutes,node_usermodel,node_shopper toneIndigo
```

## Components

### Storefront

- [App and routes](https://github.com/niluj/tech_store/blob/dev/src/App.jsx): `src/App.jsx`
- [Navigation](https://github.com/niluj/tech_store/blob/dev/src/components/NavigationBar.jsx): `src/components/NavigationBar.jsx`
- [Home page](https://github.com/niluj/tech_store/blob/dev/src/pages/Home.jsx): `src/pages/Home.jsx`
- [Shop page](https://github.com/niluj/tech_store/blob/dev/src/pages/Shop.jsx): `src/pages/Shop.jsx`
- [Product details](https://github.com/niluj/tech_store/blob/dev/src/pages/ProductDetails.jsx): `src/pages/ProductDetails.jsx`
- [Search results](https://github.com/niluj/tech_store/blob/dev/src/components/SearchResults.jsx): `src/components/SearchResults.jsx`
- [Notifications](https://github.com/niluj/tech_store/blob/dev/src/context/NotificationProvider.jsx): `src/context/NotificationProvider.jsx`

### Commerce

- [Cart](https://github.com/niluj/tech_store/blob/dev/src/pages/Cart.jsx): `src/pages/Cart.jsx`
- [Checkout](https://github.com/niluj/tech_store/blob/dev/src/pages/Checkout.jsx): `src/pages/Checkout.jsx`
- [Checkout form](https://github.com/niluj/tech_store/blob/dev/src/components/CheckoutForm.jsx): `src/components/CheckoutForm.jsx`
- [Order confirmation](https://github.com/niluj/tech_store/blob/dev/src/pages/OrderSuccess.jsx): `src/pages/OrderSuccess.jsx`
- [Order tracking](https://github.com/niluj/tech_store/blob/dev/src/pages/OrderTracking.jsx): `src/pages/OrderTracking.jsx`

### API

- [API client](https://github.com/niluj/tech_store/blob/dev/src/services/apiClient.js): `src/services/apiClient.js`
- [Express API](https://github.com/niluj/tech_store/blob/dev/backend/index.js): `backend/index.js`
- [Catalog routes](https://github.com/niluj/tech_store/blob/dev/backend/routes/products.js): `backend/routes/products.js`
- [Search route](https://github.com/niluj/tech_store/blob/dev/backend/routes/search.js): `backend/routes/search.js`
- [Checkout route](https://github.com/niluj/tech_store/blob/dev/backend/routes/checkout.js): `backend/routes/checkout.js`
- [Order routes](https://github.com/niluj/tech_store/blob/dev/backend/routes/orders.js): `backend/routes/orders.js`

### Data and search

- [Product model](https://github.com/niluj/tech_store/blob/dev/backend/models/product.js): `backend/models/product.js`
- [Order model](https://github.com/niluj/tech_store/blob/dev/backend/models/order.js): `backend/models/order.js`
- **MongoDB**
- **Pinecone index**
- [Embedding sync](https://github.com/niluj/tech_store/blob/dev/backend/services/pineconeSync.js): `backend/services/pineconeSync.js`
- [Pinecone client](https://github.com/niluj/tech_store/blob/dev/backend/pineconeClient.js): `backend/pineconeClient.js`
- [Weaviate client](https://github.com/niluj/tech_store/blob/dev/backend/weaviateClient.js): `backend/weaviateClient.js`

### Identity

- [Auth routes](https://github.com/niluj/tech_store/blob/dev/backend/routes/auth.js): `backend/routes/auth.js`
- [User model](https://github.com/niluj/tech_store/blob/dev/backend/models/user.js): `backend/models/user.js`

### Other components

- **Shopper**

## Connections

- Shopper → App and routes: uses storefront (evidence: `README.md`)
- App and routes → Home page: routes to (evidence: `src/App.jsx`)
- App and routes → Shop page: routes to (evidence: `src/App.jsx`)
- App and routes → Product details: routes to (evidence: `src/App.jsx`)
- App and routes → Cart: routes to (evidence: `src/App.jsx`)
- App and routes → Checkout: routes to (evidence: `src/App.jsx`)
- App and routes → Order confirmation: routes to (evidence: `src/App.jsx`)
- App and routes → Order tracking: routes to (evidence: `src/App.jsx`)
- App and routes → Navigation: renders (evidence: `src/App.jsx`)
- Navigation → Search results: renders (evidence: `src/components/NavigationBar.jsx`)
- Shopper → Navigation: searches catalog (evidence: `README.md`)
- Home page → API client: requests products (evidence: `src/pages/Home.jsx`)
- Checkout → Checkout form: renders (evidence: `src/pages/Checkout.jsx`)
- Checkout → API client: submits order (evidence: `src/pages/Checkout.jsx`)
- Order tracking → API client: loads order (evidence: `src/pages/OrderTracking.jsx`)
- Product details → API client: loads product (evidence: `src/pages/ProductDetails.jsx`)
- API client → Express API: HTTP requests (evidence: `README.md`)
- Express API → Catalog routes: mounts route (evidence: `backend/index.js`)
- Express API → Checkout route: mounts route (evidence: `backend/index.js`)
- Express API → Order routes: mounts route (evidence: `backend/index.js`)
- Express API → Auth routes: mounts route (evidence: `backend/index.js`)
- Express API → Search route: mounts route (evidence: `backend/index.js`)
- Catalog routes → Product model: queries products (evidence: `backend/routes/products.js`)
- Search route → Product model: queries products (evidence: `backend/routes/search.js`)
- Checkout route → Product model: reads products (evidence: `backend/routes/checkout.js`)
- Checkout route → Order model: creates order (evidence: `backend/routes/checkout.js`)
- Order routes → Order model: queries orders (evidence: `backend/routes/orders.js`)
- Auth routes → User model: queries users (evidence: `backend/routes/auth.js`)
- Express API → MongoDB: connects (evidence: `backend/index.js`)
- Product model → MongoDB: stores products (evidence: `backend/models/product.js`)
- Order model → MongoDB: stores orders (evidence: `backend/models/order.js`)
- User model → MongoDB: stores users
- Product model → Embedding sync: syncs changes (evidence: `backend/models/product.js`)
- Embedding sync → Pinecone client: upserts vectors (evidence: `backend/services/pineconeSync.js`)
- Pinecone client → Pinecone index: queries index (evidence: `backend/pineconeClient.js`)
- Catalog routes → Pinecone client: uses vector search (evidence: `backend/routes/products.js`)
- Shopper → Auth routes: authenticates (evidence: `README.md`)
- Shopper → Checkout: places order (evidence: `README.md`)
- Shopper → Order tracking: tracks order (evidence: `README.md`)
- Weaviate client → Pinecone index
