# thomascantuti/checkout-bot-card-collection architecture

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

- Interactive diagram: https://gitdiagram.com/thomascantuti/checkout-bot-card-collection
- Repository: https://github.com/thomascantuti/checkout-bot-card-collection

## Overview

Checkout Bot Card Collection is an async browser-driven purchasing bot. CSV rows become validated tasks; the orchestrator runs bounded, retrying attempts that monitor stock, add items to the cart, complete address and shipping steps, and submit payment. Page objects implement the retailer workflow, with shared cookie/CAPTCHA handling and supporting configuration, lookup, logging, and browser utilities. The README documents major capabilities not fully visible in excerpts; edges to those integrations cite that documentation.

Main entry points: [`checkout_bot/core/orchestrator.py`](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/orchestrator.py) (Checkout orchestrator), [`checkout_bot/pages/base_page.py`](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/base_page.py) (Page helpers), [`checkout_bot/pages/checkout_form_page.py`](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/checkout_form_page.py) (Address form), [`checkout_bot/pages/payment_page.py`](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/payment_page.py) (Card payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Task runtime"]
  node_task_loader["Task validation<br/>[task.py]"]
  node_settings["App settings<br/>[settings.py]"]
  node_orchestrator["Checkout orchestrator<br/>[orchestrator.py]"]
  node_browser["Browser launcher<br/>[browser.py]"]
  node_sleep["Sleep prevention"]
  node_exceptions["Checkout errors<br/>[exceptions.py]"]
end

subgraph group_checkout["Checkout pages"]
  node_product["Product monitoring<br/>[product_page.py]"]
  node_cart["Cart navigation<br/>[cart_page.py]"]
  node_shipping["Shipping selection"]
  node_address["Address form"]
  node_payment["Card payment<br/>[payment_page.py]"]
end

subgraph group_support["Shared services"]
  node_base_page["Page helpers<br/>[base_page.py]"]
  node_captcha["CAPTCHA client<br/>[captcha_solver.py]"]
  node_province["Province lookup<br/>[province_lookup.py]"]
  node_random_data["Random form data<br/>[random_data.py]"]
  node_logging["Structured logging<br/>[logging.py]"]
end

subgraph group_integrations["External systems"]
  node_retailer["ToysCenter site"]
  node_capsolver["CapSolver API"]
  node_adyen["Adyen payment"]
end

node_task_operator(("Task operator"))
node_task_csv["Checkout task CSV<br/>[toyscenter.csv]"]

node_task_operator -->|"supplies rows"| node_task_csv
node_task_csv -->|"loads rows"| node_task_loader
node_orchestrator -->|"loads config"| node_settings
node_orchestrator -->|"loads tasks"| node_task_loader
node_orchestrator -->|"launches browser"| node_browser
node_orchestrator -->|"prevents sleep"| node_sleep
node_orchestrator -->|"configures logs"| node_logging
node_orchestrator -->|"monitors stock"| node_product
node_orchestrator -->|"opens cart"| node_cart
node_orchestrator -->|"selects shipping"| node_shipping
node_orchestrator -->|"submits address"| node_address
node_orchestrator -->|"submits payment"| node_payment
node_orchestrator -->|"creates client"| node_captcha
node_orchestrator -->|"retries failures"| node_exceptions
node_product -->|"inherits helpers"| node_base_page
node_cart -->|"inherits helpers"| node_base_page
node_shipping -->|"inherits helpers"| node_base_page
node_address -->|"inherits helpers"| node_base_page
node_payment -->|"inherits helpers"| node_base_page
node_base_page -->|"solves challenges"| node_captcha
node_address -->|"looks up province"| node_province
node_address -->|"generates fields"| node_random_data
node_product -->|"checks stock"| node_retailer
node_cart -.->|"advances checkout"| node_retailer
node_shipping -.->|"selects method"| node_retailer
node_address -.->|"fills form"| node_retailer
node_payment -.->|"submits order"| node_retailer
node_payment -.->|"uses card fields"| node_adyen
node_captcha -->|"requests solutions"| node_capsolver

click node_task_csv "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/tasks/toyscenter.csv"
click node_task_loader "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/config/task.py"
click node_settings "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/config/settings.py"
click node_orchestrator "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/orchestrator.py"
click node_browser "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/browser.py"
click node_sleep "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/sleep_prevention.py"
click node_exceptions "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/exceptions.py"
click node_product "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/product_page.py"
click node_cart "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/cart_page.py"
click node_shipping "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/shipping_step_page.py"
click node_address "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/checkout_form_page.py"
click node_payment "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/payment_page.py"
click node_base_page "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/base_page.py"
click node_captcha "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/services/captcha_solver.py"
click node_province "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/services/province_lookup.py"
click node_random_data "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/utils/random_data.py"
click node_logging "https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/utils/logging.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_task_loader,node_settings,node_orchestrator,node_browser,node_sleep,node_exceptions toneBlue
class node_product,node_cart,node_shipping,node_address,node_payment toneAmber
class node_base_page,node_captcha,node_province,node_random_data,node_logging toneMint
class node_retailer,node_capsolver,node_adyen,node_task_operator,node_task_csv toneRose
```

## Components

### Task runtime

- [Task validation](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/config/task.py): `checkout_bot/config/task.py`
- [App settings](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/config/settings.py): `checkout_bot/config/settings.py`
- [Checkout orchestrator](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/orchestrator.py): `checkout_bot/core/orchestrator.py`
- [Browser launcher](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/browser.py): `checkout_bot/core/browser.py`
- [Sleep prevention](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/sleep_prevention.py): `checkout_bot/core/sleep_prevention.py`
- [Checkout errors](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/core/exceptions.py): `checkout_bot/core/exceptions.py`

### Checkout pages

- [Product monitoring](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/product_page.py): `checkout_bot/pages/product_page.py`
- [Cart navigation](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/cart_page.py): `checkout_bot/pages/cart_page.py`
- [Shipping selection](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/shipping_step_page.py): `checkout_bot/pages/shipping_step_page.py`
- [Address form](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/checkout_form_page.py): `checkout_bot/pages/checkout_form_page.py`
- [Card payment](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/payment_page.py): `checkout_bot/pages/payment_page.py`

### Shared services

- [Page helpers](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/pages/base_page.py): `checkout_bot/pages/base_page.py`
- [CAPTCHA client](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/services/captcha_solver.py): `checkout_bot/services/captcha_solver.py`
- [Province lookup](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/services/province_lookup.py): `checkout_bot/services/province_lookup.py`
- [Random form data](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/utils/random_data.py): `checkout_bot/utils/random_data.py`
- [Structured logging](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/checkout_bot/utils/logging.py): `checkout_bot/utils/logging.py`

### External systems

- **ToysCenter site**
- **CapSolver API**
- **Adyen payment**

### Other components

- **Task operator**
- [Checkout task CSV](https://github.com/thomascantuti/checkout-bot-card-collection/blob/main/tasks/toyscenter.csv): `tasks/toyscenter.csv`

## Connections

- Task operator → Checkout task CSV: supplies rows (evidence: `README.md`)
- Checkout task CSV → Task validation: loads rows (evidence: `README.md`)
- Checkout orchestrator → App settings: loads config (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Task validation: loads tasks (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Browser launcher: launches browser (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Sleep prevention: prevents sleep (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Structured logging: configures logs (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Product monitoring: monitors stock (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Cart navigation: opens cart (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Shipping selection: selects shipping (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Address form: submits address (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Card payment: submits payment (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → CAPTCHA client: creates client (evidence: `checkout_bot/core/orchestrator.py`)
- Checkout orchestrator → Checkout errors: retries failures (evidence: `checkout_bot/core/orchestrator.py`)
- Product monitoring → Page helpers: inherits helpers (evidence: `checkout_bot/pages/product_page.py`)
- Cart navigation → Page helpers: inherits helpers (evidence: `checkout_bot/pages/cart_page.py`)
- Shipping selection → Page helpers: inherits helpers (evidence: `checkout_bot/pages/shipping_step_page.py`)
- Address form → Page helpers: inherits helpers (evidence: `checkout_bot/pages/checkout_form_page.py`)
- Card payment → Page helpers: inherits helpers (evidence: `checkout_bot/pages/payment_page.py`)
- Page helpers → CAPTCHA client: solves challenges (evidence: `checkout_bot/pages/base_page.py`)
- Address form → Province lookup: looks up province (evidence: `checkout_bot/pages/checkout_form_page.py`)
- Address form → Random form data: generates fields (evidence: `checkout_bot/pages/checkout_form_page.py`)
- Product monitoring → ToysCenter site: checks stock (evidence: `checkout_bot/pages/product_page.py`)
- Cart navigation → ToysCenter site: advances checkout (evidence: `README.md`)
- Shipping selection → ToysCenter site: selects method (evidence: `README.md`)
- Address form → ToysCenter site: fills form (evidence: `README.md`)
- Card payment → ToysCenter site: submits order (evidence: `README.md`)
- Card payment → Adyen payment: uses card fields (evidence: `README.md`)
- CAPTCHA client → CapSolver API: requests solutions (evidence: `checkout_bot/services/captcha_solver.py`)
