# simorgh1/shopify_tutorials architecture

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

- Interactive diagram: https://gitdiagram.com/simorgh1/shopify_tutorials
- Repository: https://github.com/simorgh1/shopify_tutorials

## Overview

This tutorial demonstrates fetching Shopify products through either direct GraphQL calls or a Shopify MCP server. Users first configure credentials and generate an access token, then run one of the fetchers to retrieve and display product data. The direct Python implementation and MCP client are excerpted; shell-script behavior and environment setup are represented only as described in the README, so their internal steps are not inferred.

Main entry points: [`get_products.sh`](https://github.com/simorgh1/shopify_tutorials/blob/main/get_products.sh) (Shell fetcher), [`direct_fetch.py`](https://github.com/simorgh1/shopify_tutorials/blob/main/direct_fetch.py) (Python fetcher), [`mcp_fetch_products.py`](https://github.com/simorgh1/shopify_tutorials/blob/main/mcp_fetch_products.py) (MCP client), [`create_token.sh`](https://github.com/simorgh1/shopify_tutorials/blob/main/create_token.sh) (Token generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Credentials setup"]
  node_token["Token generator<br/>[create_token.sh]"]
  node_env["Environment helper<br/>[init_env.sh]"]
end

subgraph group_direct["Direct API"]
  node_shell_fetch["Shell fetcher<br/>[get_products.sh]"]
  node_python_fetch["Python fetcher<br/>[direct_fetch.py]"]
end

subgraph group_mcp["MCP approach"]
  node_mcp_client["MCP client"]
end

node_user(("Developer"))
node_shopify_api{{"Shopify Admin API"}}
node_mcp_server["Shopify MCP server"]

node_user -->|"generates token"| node_token
node_user -->|"sets environment"| node_env
node_user -->|"runs fetch"| node_shell_fetch
node_user -->|"runs fetch"| node_python_fetch
node_user -->|"runs fetch"| node_mcp_client
node_shell_fetch -->|"queries products"| node_shopify_api
node_python_fetch -->|"posts GraphQL"| node_shopify_api
node_mcp_client -->|"calls tool"| node_mcp_server
node_mcp_server -.->|"fetches products"| node_shopify_api

click node_token "https://github.com/simorgh1/shopify_tutorials/blob/main/create_token.sh"
click node_env "https://github.com/simorgh1/shopify_tutorials/blob/main/init_env.sh"
click node_shell_fetch "https://github.com/simorgh1/shopify_tutorials/blob/main/get_products.sh"
click node_python_fetch "https://github.com/simorgh1/shopify_tutorials/blob/main/direct_fetch.py"
click node_mcp_client "https://github.com/simorgh1/shopify_tutorials/blob/main/mcp_fetch_products.py"

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_token,node_env toneBlue
class node_shell_fetch,node_python_fetch toneAmber
class node_mcp_client,node_shopify_api,node_mcp_server toneMint
class node_user toneIndigo
```

## Components

### Credentials setup

- [Token generator](https://github.com/simorgh1/shopify_tutorials/blob/main/create_token.sh): `create_token.sh`
- [Environment helper](https://github.com/simorgh1/shopify_tutorials/blob/main/init_env.sh): `init_env.sh`

### Direct API

- [Shell fetcher](https://github.com/simorgh1/shopify_tutorials/blob/main/get_products.sh): `get_products.sh`
- [Python fetcher](https://github.com/simorgh1/shopify_tutorials/blob/main/direct_fetch.py): `direct_fetch.py`

### MCP approach

- [MCP client](https://github.com/simorgh1/shopify_tutorials/blob/main/mcp_fetch_products.py): `mcp_fetch_products.py`

### Other components

- **Developer**
- **Shopify Admin API**
- **Shopify MCP server**

## Connections

- Developer → Token generator: generates token (evidence: `Readme.md`)
- Developer → Environment helper: sets environment (evidence: `Readme.md`)
- Developer → Shell fetcher: runs fetch (evidence: `Readme.md`)
- Developer → Python fetcher: runs fetch (evidence: `Readme.md`)
- Developer → MCP client: runs fetch (evidence: `Readme.md`)
- Shell fetcher → Shopify Admin API: queries products (evidence: `Readme.md`)
- Python fetcher → Shopify Admin API: posts GraphQL (evidence: `direct_fetch.py`)
- MCP client → Shopify MCP server: calls tool (evidence: `mcp_fetch_products.py`)
- Shopify MCP server → Shopify Admin API: fetches products (evidence: `Readme.md`)
