# kalebu/alright architecture

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

- Interactive diagram: https://gitdiagram.com/kalebu/alright
- Repository: https://github.com/kalebu/alright

## Overview

alright is a Python Selenium wrapper for WhatsApp Web. A user creates a WhatsApp client, locates a saved or unsaved contact (or uses direct-message sending), then sends text or media; the wrapper also supports chat lookup, unread/last-message inspection, and logout. The runtime is concentrated in one module, so its distinct responsibilities share that source path. The README documents several capabilities whose implementation details are not shown in the excerpts; those links are limited to documented API use.

Main entry points: [`alright/__init__.py`](https://github.com/kalebu/alright/blob/main/alright/__init__.py) (WhatsApp client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Browser session"]
  node_client["WhatsApp client<br/>[__init__.py]"]
  node_driver["WebDriver setup<br/>[__init__.py]"]
  node_login["Login and logout<br/>[__init__.py]"]
end

subgraph group_chats["Chat interaction"]
  node_contact["Contact targeting<br/>[__init__.py]"]
  node_chat_search["Chat search<br/>[__init__.py]"]
  node_chat_read["Chat inspection<br/>[__init__.py]"]
end

subgraph group_messaging["Messaging"]
  node_text["Text messaging<br/>[__init__.py]"]
  node_direct["Direct messaging<br/>[__init__.py]"]
  node_media["Media sending<br/>[__init__.py]"]
end

node_user(("Python caller"))
node_selenium["Selenium browser"]
node_web["WhatsApp Web"]

node_user -->|"creates"| node_client
node_client -->|"initializes"| node_driver
node_driver -->|"controls"| node_selenium
node_client -->|"exposes"| node_login
node_login -->|"navigates"| node_web
node_user -->|"locates contact"| node_contact
node_contact -->|"opens chat"| node_web
node_user -->|"searches chats"| node_chat_search
node_user -->|"inspects chats"| node_chat_read
node_user -->|"sends text"| node_text
node_user -->|"sends directly"| node_direct
node_user -->|"sends media"| node_media

click node_client "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_driver "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_login "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_contact "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_chat_search "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_chat_read "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_text "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_direct "https://github.com/kalebu/alright/blob/main/alright/__init__.py"
click node_media "https://github.com/kalebu/alright/blob/main/alright/__init__.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_client,node_driver,node_login,node_selenium toneBlue
class node_contact,node_chat_search,node_chat_read toneAmber
class node_text,node_direct,node_media toneMint
class node_user,node_web toneIndigo
```

## Components

### Browser session

- [WhatsApp client](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`
- [WebDriver setup](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`
- [Login and logout](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`

### Chat interaction

- [Contact targeting](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`
- [Chat search](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`
- [Chat inspection](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`

### Messaging

- [Text messaging](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`
- [Direct messaging](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`
- [Media sending](https://github.com/kalebu/alright/blob/main/alright/__init__.py): `alright/__init__.py`

### Other components

- **Python caller**
- **Selenium browser**
- **WhatsApp Web**

## Connections

- Python caller → WhatsApp client: creates (evidence: `README.md`)
- WhatsApp client → WebDriver setup: initializes (evidence: `alright/__init__.py`)
- WebDriver setup → Selenium browser: controls (evidence: `alright/__init__.py`)
- WhatsApp client → Login and logout: exposes (evidence: `alright/__init__.py`)
- Login and logout → WhatsApp Web: navigates (evidence: `alright/__init__.py`)
- Python caller → Contact targeting: locates contact (evidence: `README.md`)
- Contact targeting → WhatsApp Web: opens chat (evidence: `alright/__init__.py`)
- Python caller → Chat search: searches chats (evidence: `README.md`)
- Python caller → Chat inspection: inspects chats (evidence: `README.md`)
- Python caller → Text messaging: sends text (evidence: `README.md`)
- Python caller → Direct messaging: sends directly (evidence: `README.md`)
- Python caller → Media sending: sends media (evidence: `README.md`)
