# mmdoctor/google-pro-helper architecture

> Architecture diagram of the GitHub repository mmdoctor/google-pro-helper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mmdoctor/google-pro-helper
- Repository: https://github.com/mmdoctor/google-pro-helper

## Overview

Google Pro Helper contains two independent products: a Chrome extension that configures offer injection and displays checkout-price warnings, and a local batch console that imports account settings and runs browser automation. The batch workflow proceeds through login/verification, payment setup, offer stages, and renewal cancellation with screenshots. The README documents this sequence; unsampled implementation details are represented only where documented, while source-level edges are limited to relationships visible in the excerpts.

Main entry points: [`batch/automation_engine.py`](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py) (Automation runner), [`batch/app.py`](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/app.py) (Console API), [`batch/templates/index.html`](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/templates/index.html) (Console interface), [`extension/popup.js`](https://github.com/mmdoctor/google-pro-helper/blob/main/extension/popup.js) (Layer controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extension["Browser extension"]
  node_popup["Layer controls<br/>[popup.js]"]
  node_content["Content bridge<br/>[content.js]"]
  node_inject["Offer injector<br/>[inject.js]"]
  node_guard["Price guard<br/>[play_guard.js]"]
end

subgraph group_console["Batch console"]
  node_console_ui["Console interface<br/>[index.html]"]
  node_api["Console API<br/>[app.py]"]
  node_settings[("Account settings<br/>[app.py]")]
end

subgraph group_automation["Account automation"]
  node_runner["Automation runner"]
  node_login["Login verification"]
  node_payment["Payment setup"]
  node_offers["Offer stages"]
  node_cancel["Cancel and verify"]
end

node_user(("User"))
node_chrome["Chrome browser"]
node_google["Google services"]

node_user -->|"selects layer"| node_popup
node_popup -->|"messages state"| node_content
node_content -->|"posts configuration"| node_inject
node_inject -->|"rewrites checkout requests"| node_google
node_google -.->|"loads checkout iframe"| node_guard
node_user -->|"manages tasks"| node_console_ui
node_console_ui -.->|"uses console"| node_api
node_api -->|"serves page"| node_console_ui
node_api -->|"loads and saves"| node_settings
node_api -->|"starts pipeline"| node_runner
node_runner -.->|"performs"| node_login
node_runner -.->|"performs"| node_payment
node_runner -.->|"performs"| node_offers
node_runner -.->|"performs"| node_cancel
node_login -.->|"authenticates with"| node_google
node_payment -.->|"sets up payment"| node_google
node_offers -.->|"applies subscriptions"| node_google
node_cancel -.->|"cancels renewal"| node_google

click node_popup "https://github.com/mmdoctor/google-pro-helper/blob/main/extension/popup.js"
click node_content "https://github.com/mmdoctor/google-pro-helper/blob/main/extension/content.js"
click node_inject "https://github.com/mmdoctor/google-pro-helper/blob/main/extension/inject.js"
click node_guard "https://github.com/mmdoctor/google-pro-helper/blob/main/extension/play_guard.js"
click node_console_ui "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/templates/index.html"
click node_api "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/app.py"
click node_settings "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/app.py"
click node_runner "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py"
click node_login "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py"
click node_payment "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py"
click node_offers "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py"
click node_cancel "https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.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_popup,node_content,node_inject,node_guard,node_user,node_chrome toneBlue
class node_console_ui,node_api,node_settings toneAmber
class node_runner,node_login,node_payment,node_offers,node_cancel toneMint
class node_google toneIndigo
```

## Components

### Browser extension

- [Layer controls](https://github.com/mmdoctor/google-pro-helper/blob/main/extension/popup.js): `extension/popup.js`
- [Content bridge](https://github.com/mmdoctor/google-pro-helper/blob/main/extension/content.js): `extension/content.js`
- [Offer injector](https://github.com/mmdoctor/google-pro-helper/blob/main/extension/inject.js): `extension/inject.js`
- [Price guard](https://github.com/mmdoctor/google-pro-helper/blob/main/extension/play_guard.js): `extension/play_guard.js`

### Batch console

- [Console interface](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/templates/index.html): `batch/templates/index.html`
- [Console API](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/app.py): `batch/app.py`
- [Account settings](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/app.py): `batch/app.py`

### Account automation

- [Automation runner](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py): `batch/automation_engine.py`
- [Login verification](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py): `batch/automation_engine.py`
- [Payment setup](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py): `batch/automation_engine.py`
- [Offer stages](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py): `batch/automation_engine.py`
- [Cancel and verify](https://github.com/mmdoctor/google-pro-helper/blob/main/batch/automation_engine.py): `batch/automation_engine.py`

### Other components

- **User**
- **Chrome browser**
- **Google services**

## Connections

- User → Layer controls: selects layer (evidence: `extension/popup.js`)
- Layer controls → Content bridge: messages state (evidence: `extension/popup.js`)
- Content bridge → Offer injector: posts configuration (evidence: `extension/content.js`)
- Offer injector → Google services: rewrites checkout requests (evidence: `extension/inject.js`)
- Google services → Price guard: loads checkout iframe
- User → Console interface: manages tasks (evidence: `README.md`)
- Console interface → Console API: uses console
- Console API → Console interface: serves page (evidence: `batch/app.py`)
- Console API → Account settings: loads and saves (evidence: `batch/app.py`)
- Console API → Automation runner: starts pipeline (evidence: `batch/app.py`)
- Automation runner → Login verification: performs (evidence: `README.md`)
- Automation runner → Payment setup: performs (evidence: `README.md`)
- Automation runner → Offer stages: performs (evidence: `README.md`)
- Automation runner → Cancel and verify: performs (evidence: `README.md`)
- Login verification → Google services: authenticates with (evidence: `README.md`)
- Payment setup → Google services: sets up payment (evidence: `README.md`)
- Offer stages → Google services: applies subscriptions (evidence: `README.md`)
- Cancel and verify → Google services: cancels renewal (evidence: `README.md`)
