# zhiwei-3/whatsapp-automation architecture

> Architecture diagram of the GitHub repository zhiwei-3/whatsapp-automation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhiwei-3/whatsapp-automation
- Repository: https://github.com/zhiwei-3/whatsapp-automation

## Overview

This is a desktop WhatsApp Web messaging tool. A user configures message variants and delays, loads contact data, and runs or retries contact processing; Selenium opens WhatsApp Web to establish a session and send messages, while the app tracks outcomes and presents/export results. The single-file implementation combines UI, processing, and browser automation. The README is empty and the excerpts omit several connections, so the graph includes only relationships directly visible in the supplied source.

Main entry points: [`main.py`](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py) (Automation GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_gui["Automation GUI<br/>[main.py]"]
  node_message_editor["Message variants<br/>[main.py]"]
  node_data_preview["Contact preview<br/>[main.py]"]
  node_template_store["Template file<br/>[main.py]"]
end

subgraph group_messaging["Message processing"]
  node_contact_loader["Contact loading<br/>[main.py]"]
  node_processor["Contact processor<br/>[main.py]"]
end

subgraph group_browser["Browser integration"]
  node_browser_session["Browser session<br/>[main.py]"]
  node_message_sender["Message sender<br/>[main.py]"]
end

subgraph group_outcomes["Run outcomes"]
  node_result_tracker["Result tracker<br/>[main.py]"]
  node_result_report["Results report<br/>[main.py]"]
end

node_user(("User"))
node_whatsapp["WhatsApp Web"]

node_user -->|"operates"| node_gui
node_gui -->|"creates"| node_message_editor
node_gui -->|"creates"| node_data_preview
node_gui -->|"saves templates"| node_template_store
node_processor -->|"loads contacts"| node_contact_loader
node_browser_session -->|"opens session"| node_whatsapp
node_message_sender -->|"opens chat"| node_whatsapp

click node_gui "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_message_editor "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_data_preview "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_template_store "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_contact_loader "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_processor "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_browser_session "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_message_sender "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_result_tracker "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py"
click node_result_report "https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.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_gui,node_message_editor,node_data_preview,node_template_store,node_user toneBlue
class node_contact_loader,node_processor toneAmber
class node_browser_session,node_message_sender toneMint
class node_result_tracker,node_result_report toneRose
class node_whatsapp toneIndigo
```

## Components

### Desktop interface

- [Automation GUI](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`
- [Message variants](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`
- [Contact preview](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`
- [Template file](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`

### Message processing

- [Contact loading](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`
- [Contact processor](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`

### Browser integration

- [Browser session](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`
- [Message sender](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`

### Run outcomes

- [Result tracker](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`
- [Results report](https://github.com/zhiwei-3/whatsapp-automation/blob/main/main.py): `main.py`

### Other components

- **User**
- **WhatsApp Web**

## Connections

- User → Automation GUI: operates (evidence: `main.py`)
- Automation GUI → Message variants: creates (evidence: `main.py`)
- Automation GUI → Contact preview: creates (evidence: `main.py`)
- Automation GUI → Template file: saves templates (evidence: `main.py`)
- Contact processor → Contact loading: loads contacts (evidence: `main.py`)
- Browser session → WhatsApp Web: opens session (evidence: `main.py`)
- Message sender → WhatsApp Web: opens chat (evidence: `main.py`)
