# polymorfa/hypermeow architecture

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

- Interactive diagram: https://gitdiagram.com/polymorfa/hypermeow
- Repository: https://github.com/polymorfa/hypermeow

## Overview

HyperMeow is a Go client library for WhatsApp’s multi-device API, extending the WhatsMeow protocol foundation with business features, LID-first identity, and deployment-oriented reliability. A typical session connects and authenticates through Client, exchanges framed and encoded protocol data, then sends requests or processes inbound updates into application events; persistent device and Signal state is supplied by a store. The graph also preserves documented business, newsletter, media, app-state, and guest-registration capabilities. Some subsystem links are documented in the README rather than shown in sampled implementation excerpts.

Main entry points: [`client.go`](https://github.com/polymorfa/hypermeow/blob/main/client.go) (WhatsApp client), [`guest/register.go`](https://github.com/polymorfa/hypermeow/blob/main/guest/register.go) (Guest registration), [`socket/framesocket.go`](https://github.com/polymorfa/hypermeow/blob/main/socket/framesocket.go) (WebSocket frames), [`binary/decoder.go`](https://github.com/polymorfa/hypermeow/blob/main/binary/decoder.go) (Binary node codec)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Session and transport"]
  node_client["WhatsApp client<br/>[client.go]"]
  node_guest["Guest registration<br/>[register.go]"]
  node_socket["WebSocket frames<br/>[framesocket.go]"]
end

subgraph group_protocol["Protocol and events"]
  node_binary["Binary node codec<br/>[decoder.go]"]
  node_legacyproto["Protocol compatibility<br/>[legacy.go]"]
  node_events["Event types<br/>[events.go]"]
end

subgraph group_state["Identity and state"]
  node_appstate["App-state sync<br/>[decode.go]"]
  node_storeapi["Device and Signal store<br/>[store.go]"]
  node_sqlstore[("SQL persistence<br/>[store.go]")]
  node_identity["LID identity<br/>[lidmap.go]"]
  node_pairing["Pairing and login<br/>[pair.go]"]
  node_remote["Remote Signal<br/>[remote_signal.go]"]
end

subgraph group_features["Messaging and product features"]
  node_messaging["Messages and receipts<br/>[send.go]"]
  node_media["Media transfer<br/>[upload.go]"]
  node_groups["Groups and invites<br/>[group.go]"]
  node_business["Business operations<br/>[business.go]"]
  node_newsletter["Newsletters<br/>[newsletter.go]"]
  node_stickerpack["Sticker-pack archives<br/>[archive.go]"]
end

node_application(("Application"))
node_whatsapp(("WhatsApp service"))

node_application -->|"creates session"| node_client
node_application -->|"registers guest"| node_guest
node_client -->|"opens connection"| node_socket
node_socket -->|"exchanges frames"| node_whatsapp
node_client -->|"encodes nodes"| node_binary
node_client -->|"uses device store"| node_storeapi
node_client -->|"processes sync"| node_appstate
node_client -->|"emits updates"| node_events
node_binary -->|"decodes protocol data"| node_legacyproto
node_storeapi -->|"implemented by"| node_sqlstore
node_sqlstore -->|"persists aliases"| node_identity
node_client -->|"pairs devices"| node_pairing
node_client -->|"sends and receives"| node_messaging
node_client -->|"transfers media"| node_media
node_client -->|"manages groups"| node_groups
node_client -->|"offers business API"| node_business
node_client -->|"handles channels"| node_newsletter
node_client -.->|"uses external Signal store"| node_remote
node_messaging -->|"packages sticker media"| node_stickerpack
node_guest -->|"registers identity"| node_whatsapp

click node_client "https://github.com/polymorfa/hypermeow/blob/main/client.go"
click node_guest "https://github.com/polymorfa/hypermeow/blob/main/guest/register.go"
click node_socket "https://github.com/polymorfa/hypermeow/blob/main/socket/framesocket.go"
click node_binary "https://github.com/polymorfa/hypermeow/blob/main/binary/decoder.go"
click node_legacyproto "https://github.com/polymorfa/hypermeow/blob/main/binary/proto/legacy.go"
click node_events "https://github.com/polymorfa/hypermeow/blob/main/types/events/events.go"
click node_appstate "https://github.com/polymorfa/hypermeow/blob/main/appstate/decode.go"
click node_storeapi "https://github.com/polymorfa/hypermeow/blob/main/store/store.go"
click node_sqlstore "https://github.com/polymorfa/hypermeow/blob/main/store/sqlstore/store.go"
click node_identity "https://github.com/polymorfa/hypermeow/blob/main/store/sqlstore/lidmap.go"
click node_pairing "https://github.com/polymorfa/hypermeow/blob/main/pair.go"
click node_messaging "https://github.com/polymorfa/hypermeow/blob/main/send.go"
click node_media "https://github.com/polymorfa/hypermeow/blob/main/upload.go"
click node_groups "https://github.com/polymorfa/hypermeow/blob/main/group.go"
click node_business "https://github.com/polymorfa/hypermeow/blob/main/business.go"
click node_newsletter "https://github.com/polymorfa/hypermeow/blob/main/newsletter.go"
click node_remote "https://github.com/polymorfa/hypermeow/blob/main/remote_signal.go"
click node_stickerpack "https://github.com/polymorfa/hypermeow/blob/main/stickerpack/archive.go"

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_guest,node_socket toneBlue
class node_binary,node_legacyproto,node_events toneAmber
class node_appstate,node_storeapi,node_sqlstore,node_identity,node_pairing,node_remote toneMint
class node_messaging,node_media,node_groups,node_business,node_newsletter,node_stickerpack toneRose
class node_application,node_whatsapp toneIndigo
```

## Components

### Session and transport

- [WhatsApp client](https://github.com/polymorfa/hypermeow/blob/main/client.go): `client.go`
- [Guest registration](https://github.com/polymorfa/hypermeow/blob/main/guest/register.go): `guest/register.go`
- [WebSocket frames](https://github.com/polymorfa/hypermeow/blob/main/socket/framesocket.go): `socket/framesocket.go`

### Protocol and events

- [Binary node codec](https://github.com/polymorfa/hypermeow/blob/main/binary/decoder.go): `binary/decoder.go`
- [Protocol compatibility](https://github.com/polymorfa/hypermeow/blob/main/binary/proto/legacy.go): `binary/proto/legacy.go`
- [Event types](https://github.com/polymorfa/hypermeow/blob/main/types/events/events.go): `types/events/events.go`

### Identity and state

- [App-state sync](https://github.com/polymorfa/hypermeow/blob/main/appstate/decode.go): `appstate/decode.go`
- [Device and Signal store](https://github.com/polymorfa/hypermeow/blob/main/store/store.go): `store/store.go`
- [SQL persistence](https://github.com/polymorfa/hypermeow/blob/main/store/sqlstore/store.go): `store/sqlstore/store.go`
- [LID identity](https://github.com/polymorfa/hypermeow/blob/main/store/sqlstore/lidmap.go): `store/sqlstore/lidmap.go`
- [Pairing and login](https://github.com/polymorfa/hypermeow/blob/main/pair.go): `pair.go`
- [Remote Signal](https://github.com/polymorfa/hypermeow/blob/main/remote_signal.go): `remote_signal.go`

### Messaging and product features

- [Messages and receipts](https://github.com/polymorfa/hypermeow/blob/main/send.go): `send.go`
- [Media transfer](https://github.com/polymorfa/hypermeow/blob/main/upload.go): `upload.go`
- [Groups and invites](https://github.com/polymorfa/hypermeow/blob/main/group.go): `group.go`
- [Business operations](https://github.com/polymorfa/hypermeow/blob/main/business.go): `business.go`
- [Newsletters](https://github.com/polymorfa/hypermeow/blob/main/newsletter.go): `newsletter.go`
- [Sticker-pack archives](https://github.com/polymorfa/hypermeow/blob/main/stickerpack/archive.go): `stickerpack/archive.go`

### Other components

- **Application**
- **WhatsApp service**

## Connections

- Application → WhatsApp client: creates session (evidence: `client.go`)
- Application → Guest registration: registers guest (evidence: `guest/register.go`)
- WhatsApp client → WebSocket frames: opens connection (evidence: `client.go`)
- WebSocket frames → WhatsApp service: exchanges frames (evidence: `socket/framesocket.go`)
- WhatsApp client → Binary node codec: encodes nodes (evidence: `client.go`)
- WhatsApp client → Device and Signal store: uses device store (evidence: `client.go`)
- WhatsApp client → App-state sync: processes sync (evidence: `client.go`)
- WhatsApp client → Event types: emits updates (evidence: `README.md`)
- Binary node codec → Protocol compatibility: decodes protocol data (evidence: `binary/decoder.go`)
- Device and Signal store → SQL persistence: implemented by (evidence: `store/sqlstore/store.go`)
- SQL persistence → LID identity: persists aliases (evidence: `README.md`)
- WhatsApp client → Pairing and login: pairs devices (evidence: `README.md`)
- WhatsApp client → Messages and receipts: sends and receives (evidence: `README.md`)
- WhatsApp client → Media transfer: transfers media (evidence: `README.md`)
- WhatsApp client → Groups and invites: manages groups (evidence: `README.md`)
- WhatsApp client → Business operations: offers business API (evidence: `README.md`)
- WhatsApp client → Newsletters: handles channels (evidence: `README.md`)
- WhatsApp client → Remote Signal: uses external Signal store (evidence: `README.md`)
- Messages and receipts → Sticker-pack archives: packages sticker media (evidence: `stickerpack/archive.go`)
- Guest registration → WhatsApp service: registers identity (evidence: `guest/register.go`)
