# teodf/shopify-key-webhook architecture

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

- Interactive diagram: https://gitdiagram.com/teodf/shopify-key-webhook
- Repository: https://github.com/teodf/shopify-key-webhook

## Overview

This repository is a Flask service combining commerce operations with customer-review feeds. The visible order workflow accepts a webhook in `main.py`, builds an invoice using the English template, and can render it as HTML or PDF. The service also contains marketplace-order and Amazon-related processing, plus separate review endpoints for Google Business, Judge.me, Decathlon, and app stores. The README is empty, and excerpts do not show all route registrations or callers, so uncertain links between the main app and review modules are omitted.

Main entry points: [`main.py`](https://github.com/teodf/shopify-key-webhook/blob/main/main.py) (Flask service), [`google_business_reviews.py`](https://github.com/teodf/shopify-key-webhook/blob/main/google_business_reviews.py) (Google Business reviews), [`store_reviews.py`](https://github.com/teodf/shopify-key-webhook/blob/main/store_reviews.py) (App store reviews), [`judgeme_reviews.py`](https://github.com/teodf/shopify-key-webhook/blob/main/judgeme_reviews.py) (Judge.me reviews)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_commerce["Commerce operations"]
  node_main_service["Flask service<br/>[main.py]"]
  node_mirakl_orders["Mirakl orders<br/>[main.py]"]
  node_amazon_orders["Amazon orders<br/>[main.py]"]
end

subgraph group_invoices["Invoice generation"]
  node_invoice_builder["Invoice builder"]
  node_chrome["Chrome renderer"]
end

subgraph group_reviews["Review services"]
  node_google_reviews["Google Business reviews"]
  node_judgeme_reviews["Judge.me reviews<br/>[judgeme_reviews.py]"]
  node_decathlon_reviews["Decathlon reviews"]
  node_store_reviews["App store reviews<br/>[store_reviews.py]"]
  node_review_files[("Review JSON files")]
end

subgraph group_integrations["External platforms"]
  node_mirakl_api["Mirakl API"]
  node_google_business_api["Google Business API"]
  node_judgeme_api["Judge.me API"]
  node_app_store_apis["App store APIs"]
end

node_webhook_client(("Webhook client"))

node_webhook_client -->|"submits webhook"| node_main_service
node_main_service -->|"builds invoice"| node_invoice_builder
node_main_service -->|"fetches orders"| node_mirakl_orders
node_mirakl_orders -->|"requests orders"| node_mirakl_api
node_main_service -->|"renders PDF"| node_chrome
node_google_reviews -->|"fetches reviews"| node_google_business_api
node_judgeme_reviews -->|"fetches pages"| node_judgeme_api
node_store_reviews -->|"fetches reviews"| node_app_store_apis
node_decathlon_reviews -->|"reads and writes"| node_review_files
node_google_reviews -.->|"persists payload"| node_review_files
node_store_reviews -->|"persists payload"| node_review_files

click node_main_service "https://github.com/teodf/shopify-key-webhook/blob/main/main.py"
click node_mirakl_orders "https://github.com/teodf/shopify-key-webhook/blob/main/main.py"
click node_amazon_orders "https://github.com/teodf/shopify-key-webhook/blob/main/main.py"
click node_invoice_builder "https://github.com/teodf/shopify-key-webhook/blob/main/invoice_template_en.py"
click node_google_reviews "https://github.com/teodf/shopify-key-webhook/blob/main/google_business_reviews.py"
click node_judgeme_reviews "https://github.com/teodf/shopify-key-webhook/blob/main/judgeme_reviews.py"
click node_decathlon_reviews "https://github.com/teodf/shopify-key-webhook/blob/main/decathlon_reviews.py"
click node_store_reviews "https://github.com/teodf/shopify-key-webhook/blob/main/store_reviews.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_main_service,node_mirakl_orders,node_amazon_orders,node_webhook_client toneBlue
class node_invoice_builder,node_chrome toneAmber
class node_google_reviews,node_judgeme_reviews,node_decathlon_reviews,node_store_reviews,node_review_files toneMint
class node_mirakl_api,node_google_business_api,node_judgeme_api,node_app_store_apis toneRose
```

## Components

### Commerce operations

- [Flask service](https://github.com/teodf/shopify-key-webhook/blob/main/main.py): `main.py`
- [Mirakl orders](https://github.com/teodf/shopify-key-webhook/blob/main/main.py): `main.py`
- [Amazon orders](https://github.com/teodf/shopify-key-webhook/blob/main/main.py): `main.py`

### Invoice generation

- [Invoice builder](https://github.com/teodf/shopify-key-webhook/blob/main/invoice_template_en.py): `invoice_template_en.py`
- **Chrome renderer**

### Review services

- [Google Business reviews](https://github.com/teodf/shopify-key-webhook/blob/main/google_business_reviews.py): `google_business_reviews.py`
- [Judge.me reviews](https://github.com/teodf/shopify-key-webhook/blob/main/judgeme_reviews.py): `judgeme_reviews.py`
- [Decathlon reviews](https://github.com/teodf/shopify-key-webhook/blob/main/decathlon_reviews.py): `decathlon_reviews.py`
- [App store reviews](https://github.com/teodf/shopify-key-webhook/blob/main/store_reviews.py): `store_reviews.py`
- **Review JSON files**

### External platforms

- **Mirakl API**
- **Google Business API**
- **Judge.me API**
- **App store APIs**

### Other components

- **Webhook client**

## Connections

- Webhook client → Flask service: submits webhook (evidence: `main.py`)
- Flask service → Invoice builder: builds invoice (evidence: `main.py`)
- Flask service → Mirakl orders: fetches orders (evidence: `main.py`)
- Mirakl orders → Mirakl API: requests orders (evidence: `main.py`)
- Flask service → Chrome renderer: renders PDF (evidence: `main.py`)
- Google Business reviews → Google Business API: fetches reviews (evidence: `google_business_reviews.py`)
- Judge.me reviews → Judge.me API: fetches pages (evidence: `judgeme_reviews.py`)
- App store reviews → App store APIs: fetches reviews (evidence: `store_reviews.py`)
- Decathlon reviews → Review JSON files: reads and writes (evidence: `decathlon_reviews.py`)
- Google Business reviews → Review JSON files: persists payload
- App store reviews → Review JSON files: persists payload (evidence: `store_reviews.py`)
