# sahniaditya007/shopify-integration architecture

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

- Interactive diagram: https://gitdiagram.com/sahniaditya007/shopify-integration
- Repository: https://github.com/sahniaditya007/shopify-integration

## Overview

This repository implements a Shopify data-ingestion service and a customer/revenue dashboard. An operator requests ingestion; the backend fetches products, customers, and orders from Shopify and upserts them with store data into the database. The dashboard fetches aggregate metrics from the backend and displays revenue, order and customer counts, and top customers. The sampled server source supports these flows; the README documents no additional capabilities.

Main entry points: [`backend/server.js`](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js) (Ingestion Endpoint), [`frontend/src/App.js`](https://github.com/sahniaditya007/shopify-integration/blob/main/frontend/src/App.js) (Dashboard UI), [`backend/prisma/schema.prisma`](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma) (Customer Records), [`frontend/src/index.js`](https://github.com/sahniaditya007/shopify-integration/blob/main/frontend/src/index.js) (React Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Dashboard"]
  node_dashboard["Dashboard UI<br/>[App.js]"]
  node_frontend_entry["React Entry<br/>[index.js]"]
end

subgraph group_backend["Backend API"]
  node_ingest_route["Ingestion Endpoint<br/>[server.js]"]
  node_shopify_client["Shopify REST Client<br/>[server.js]"]
  node_metrics_route["Metrics Endpoint<br/>[server.js]"]
end

subgraph group_data["Persisted Data"]
  node_store_record[("Store Record<br/>[schema.prisma]")]
  node_product_records[("Product Records<br/>[schema.prisma]")]
  node_customer_records[("Customer Records<br/>[schema.prisma]")]
  node_order_records[("Order Records<br/>[schema.prisma]")]
end

node_operator(("Operator"))
node_shopify["Shopify Store"]

node_frontend_entry -->|"renders"| node_dashboard
node_operator -->|"views"| node_dashboard
node_dashboard -->|"requests metrics"| node_metrics_route
node_metrics_route -->|"counts and ranks"| node_customer_records
node_metrics_route -->|"counts and totals"| node_order_records
node_metrics_route -->|"returns metrics"| node_dashboard
node_operator -->|"requests ingestion"| node_ingest_route
node_ingest_route -->|"upserts store"| node_store_record
node_ingest_route -->|"creates client"| node_shopify_client
node_shopify_client -->|"fetches records"| node_shopify
node_ingest_route -->|"upserts products"| node_product_records
node_ingest_route -->|"upserts customers"| node_customer_records
node_ingest_route -->|"upserts orders"| node_order_records

click node_dashboard "https://github.com/sahniaditya007/shopify-integration/blob/main/frontend/src/App.js"
click node_frontend_entry "https://github.com/sahniaditya007/shopify-integration/blob/main/frontend/src/index.js"
click node_ingest_route "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js"
click node_shopify_client "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js"
click node_metrics_route "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js"
click node_store_record "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma"
click node_product_records "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma"
click node_customer_records "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma"
click node_order_records "https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma"

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_dashboard,node_frontend_entry toneBlue
class node_ingest_route,node_shopify_client,node_metrics_route toneAmber
class node_store_record,node_product_records,node_customer_records,node_order_records toneMint
class node_operator,node_shopify toneIndigo
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/sahniaditya007/shopify-integration/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [React Entry](https://github.com/sahniaditya007/shopify-integration/blob/main/frontend/src/index.js): `frontend/src/index.js`

### Backend API

- [Ingestion Endpoint](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js): `backend/server.js`
- [Shopify REST Client](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js): `backend/server.js`
- [Metrics Endpoint](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/server.js): `backend/server.js`

### Persisted Data

- [Store Record](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`
- [Product Records](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`
- [Customer Records](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`
- [Order Records](https://github.com/sahniaditya007/shopify-integration/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`

### Other components

- **Operator**
- **Shopify Store**

## Connections

- React Entry → Dashboard UI: renders
- Operator → Dashboard UI: views
- Dashboard UI → Metrics Endpoint: requests metrics
- Metrics Endpoint → Customer Records: counts and ranks
- Metrics Endpoint → Order Records: counts and totals
- Metrics Endpoint → Dashboard UI: returns metrics
- Operator → Ingestion Endpoint: requests ingestion
- Ingestion Endpoint → Store Record: upserts store
- Ingestion Endpoint → Shopify REST Client: creates client
- Shopify REST Client → Shopify Store: fetches records
- Ingestion Endpoint → Product Records: upserts products
- Ingestion Endpoint → Customer Records: upserts customers
- Ingestion Endpoint → Order Records: upserts orders
