# xcletus3/whatsapp-linux-client architecture

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

- Interactive diagram: https://gitdiagram.com/xcletus3/whatsapp-linux-client
- Repository: https://github.com/xcletus3/whatsapp-linux-client

## Overview

#### Purpose and Entry Points
This repository packages a lightweight Linux desktop wrapper for WhatsApp Web. It uses Python/PyQt6 rather than Electron, embedding the WhatsApp Web site in a native application window. The executable entry point is expected to be defined by packaging metadata in `pyproject.toml`, with application startup and UI orchestration in `src/whatsapp_linux_client/app.py`.

#### Application Shell
`src/whatsapp_linux_client/app.py` is the primary architecture boundary: it should create the Qt application, main window, and embedded web view. The package root, `src/whatsapp_linux_client/__init__.py`, establishes the importable application package. PyQt6 and PyQt6-WebEngine are the material runtime dependencies, declared through `pyproject.toml` and/or `requirements.txt`.

#### Embedded WhatsApp Web Runtime
The application loads WhatsApp Web directly into a Qt WebEngine browser surface rather than implementing messaging APIs itself. Authentication, chat state, message delivery, and media handling fundamentally depend on the external WhatsApp Web service. Persistent login is implemented through locally retained WebEngine/browser profile data rather than credentials managed by this repository.

#### Browser and Navigation Boundary
The embedded view is intended to retain WhatsApp conversations while routing non-WhatsApp/external links to the user’s default system browser. This creates a clear boundary between the in-app WhatsApp Web origin and arbitrary web navigation, likely enforced from web-view navigation or link-handling logic in `src/whatsapp_linux_client/app.py`.

#### Local Integration and Storage
Downloads initiated through WhatsApp Web are directed to `~/Downloads/WhatsApp/`, keeping media local to the user account. Session data is also local, enabling QR authentication to persist between launches. Native desktop notifications bridge web message events into the Linux notification service; their window/application integration belongs to the application layer in `src/whatsapp_linux_client/app.py`.

#### Linux Desktop Packaging
Desktop launcher integration is supplied by `src/whatsapp_linux_client/data/whatsapp-linux-client.desktop`, allowing installation into a Linux application menu and defining how the packaged executable is launched. Application icons are distributed under `src/whatsapp_linux_client/icons`, supporting launcher, window, and notification identity. The project supports wheel/source installation but targets Linux desktop environments, particularly Debian/XFCE-style systems.

#### Operational Boundaries
The client does not operate a backend, proxy, analytics pipeline, or proprietary WhatsApp integration. Its critical external dependencies are the local Linux desktop stack (window manager, notification daemon, default browser, downloads filesystem) and the remotely hosted WhatsApp Web application. WhatsApp Web changes, outages, or unsupported features such as calls directly constrain client behavior.

Main entry points: [`src/whatsapp_linux_client/app.py`](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py) (Application shell), [`pyproject.toml`](https://github.com/xcletus3/whatsapp-linux-client/blob/main/pyproject.toml) (Packaging metadata), [`src/whatsapp_linux_client/data/whatsapp-linux-client.desktop`](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/data/whatsapp-linux-client.desktop) (Desktop launcher), [`requirements.txt`](https://github.com/xcletus3/whatsapp-linux-client/blob/main/requirements.txt) (Runtime requirements)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_package["Package &amp; launch"]
  node_pyproject["Packaging metadata<br/>Python packaging<br/>[pyproject.toml]"]
  node_requirements["Runtime requirements<br/>dependency manifest<br/>[requirements.txt]"]
  node_package_root["Application package<br/>Python package<br/>[__init__.py]"]
  node_desktop_launcher["Desktop launcher<br/>Linux .desktop entry"]
  node_icons["Application icons<br/>icon assets"]
end

subgraph group_client["Native client"]
  node_app["Application shell<br/>PyQt6 application<br/>[app.py]"]
  node_qt_runtime["Qt WebEngine runtime<br/>PyQt6 + WebEngine"]
  node_web_view["Embedded WhatsApp view<br/>WebEngine browser surface<br/>[app.py]"]
  node_navigation_policy["Navigation policy<br/>link routing<br/>[app.py]"]
end

subgraph group_local["Local desktop integration"]
  node_browser_profile[("Persistent browser profile<br/>local session storage")]
  node_downloads["WhatsApp downloads<br/>local filesystem"]
  node_notifications["Linux notifications<br/>desktop notification bridge<br/>[app.py]"]
  node_system_browser["Default system browser<br/>external link handler"]
end

subgraph group_external["External services"]
  node_whatsapp_web{{"WhatsApp Web<br/>hosted web application"}}
  node_linux_desktop["Linux desktop stack<br/>window manager and services"]
end

node_pyproject -->|"declares entry point"| node_app
node_requirements -->|"declares"| node_qt_runtime
node_package_root -->|"contains"| node_app
node_desktop_launcher -->|"launches packaged executable"| node_pyproject
node_icons -->|"supplies icon"| node_desktop_launcher
node_app -->|"initializes"| node_qt_runtime
node_qt_runtime -->|"hosts"| node_web_view
node_app -->|"enforces"| node_navigation_policy
node_web_view -->|"loads"| node_whatsapp_web
node_web_view -->|"persists session"| node_browser_profile
node_web_view -->|"writes media"| node_downloads
node_navigation_policy -->|"opens external links"| node_system_browser
node_app -->|"bridges message events"| node_notifications
node_app -->|"uses native desktop services"| node_linux_desktop
node_notifications -->|"delivers through"| node_linux_desktop
node_system_browser -.->|"provided by"| node_linux_desktop

click node_pyproject "https://github.com/xcletus3/whatsapp-linux-client/blob/main/pyproject.toml"
click node_requirements "https://github.com/xcletus3/whatsapp-linux-client/blob/main/requirements.txt"
click node_package_root "https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/__init__.py"
click node_desktop_launcher "https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/data/whatsapp-linux-client.desktop"
click node_icons "https://github.com/xcletus3/whatsapp-linux-client/tree/main/src/whatsapp_linux_client/icons"
click node_app "https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py"
click node_web_view "https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py"
click node_navigation_policy "https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py"
click node_notifications "https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.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_pyproject,node_requirements,node_package_root,node_desktop_launcher,node_icons toneBlue
class node_app,node_qt_runtime,node_web_view,node_navigation_policy toneAmber
class node_browser_profile,node_downloads,node_notifications,node_system_browser toneMint
class node_whatsapp_web,node_linux_desktop toneRose
```

## Components

### Package & launch

- [Packaging metadata](https://github.com/xcletus3/whatsapp-linux-client/blob/main/pyproject.toml): Python packaging · Defines the executable entry point and runtime dependencies. · `pyproject.toml`
- [Runtime requirements](https://github.com/xcletus3/whatsapp-linux-client/blob/main/requirements.txt): dependency manifest · `requirements.txt`
- [Application package](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/__init__.py): Python package · `src/whatsapp_linux_client/__init__.py`
- [Desktop launcher](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/data/whatsapp-linux-client.desktop): Linux .desktop entry · `src/whatsapp_linux_client/data/whatsapp-linux-client.desktop`
- [Application icons](https://github.com/xcletus3/whatsapp-linux-client/tree/main/src/whatsapp_linux_client/icons): icon assets · Used for launcher, window, and notification identity. · `src/whatsapp_linux_client/icons`

### Native client

- [Application shell](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py): PyQt6 application · Creates the Qt application, main window, and web view. · `src/whatsapp_linux_client/app.py`
- **Qt WebEngine runtime**: PyQt6 + WebEngine · Native windowing and embedded browser runtime.
- [Embedded WhatsApp view](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py): WebEngine browser surface · `src/whatsapp_linux_client/app.py`
- [Navigation policy](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py): link routing · Keeps WhatsApp in-app and delegates external links. · `src/whatsapp_linux_client/app.py`

### Local desktop integration

- **Persistent browser profile**: local session storage · Retains WhatsApp Web login and browser state between launches.
- **WhatsApp downloads**: local filesystem · Media downloads are directed to ~/Downloads/WhatsApp/.
- [Linux notifications](https://github.com/xcletus3/whatsapp-linux-client/blob/main/src/whatsapp_linux_client/app.py): desktop notification bridge · Surfaces web message events through the desktop notification service. · `src/whatsapp_linux_client/app.py`
- **Default system browser**: external link handler

### External services

- **WhatsApp Web**: hosted web application · Provides authentication, chats, messages, and media handling.
- **Linux desktop stack**: window manager and services · Supplies native windows, notifications, browser integration, and filesystem access.

## Connections

- Packaging metadata → Application shell: declares entry point
- Runtime requirements → Qt WebEngine runtime: declares
- Application package → Application shell: contains
- Desktop launcher → Packaging metadata: launches packaged executable
- Application icons → Desktop launcher: supplies icon
- Application shell → Qt WebEngine runtime: initializes
- Qt WebEngine runtime → Embedded WhatsApp view: hosts
- Application shell → Navigation policy: enforces
- Embedded WhatsApp view → WhatsApp Web: loads
- Embedded WhatsApp view → Persistent browser profile: persists session
- Embedded WhatsApp view → WhatsApp downloads: writes media
- Navigation policy → Default system browser: opens external links
- Application shell → Linux notifications: bridges message events
- Application shell → Linux desktop stack: uses native desktop services
- Linux notifications → Linux desktop stack: delivers through
- Default system browser → Linux desktop stack: provided by
