Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

RelaySMS Publisher

Publishes to online platforms, such as Gmail, from content people send by SMS, so they can post without an internet connection.

How it works

---
config:
  flowchart:
    curve: linear
---
flowchart TB
    app["RelaySMS app"]
    gateway["Gateway client"]
    mailbox["Mailbox"]
    platform["Online platforms"]

    subgraph publisher["Publisher"]
        grpc["gRPC API"]
        rest["REST API"]
        smtp["Email listener"]
        db[("Database")]
        worker["Celery worker"]
        adapter["Platform adapter"]
        %% Keeps the title clear of the arrows entering the box.
        spacer[" "]:::hidden
        spacer ~~~ worker
    end

    app -- "link an account, online" --> grpc
    app -- "encrypted SMS" --> gateway
    gateway -- "HTTPS" --> rest
    gateway -- "email" --> mailbox
    mailbox -- "IMAP" --> smtp
    grpc -- "token, keys" --> db
    db --> worker
    rest --> worker
    smtp --> worker
    grpc --> adapter
    worker --> adapter
    adapter --> platform

    classDef hidden fill:none,stroke:none
  1. While online, a user links an account through the gRPC API. The Publisher stores its token encrypted.
  2. Offline, the app encrypts the content and sends it by SMS to a gateway client, a phone number that relays SMS.
  3. The gateway client posts the payload to the REST API, or emails it to a mailbox the Publisher reads.
  4. A Celery worker decrypts the payload and publishes it through the platform’s adapter.

Key terms

  • Gateway client: a phone number that relays SMS to the Publisher, such as an Android phone running Deku SMS. See Connecting a relay.
  • Adapter (platform adapter): the plugin that publishes to one platform, such as Gmail, installed from its own repository. See Managing adapters.
  • Linked account: a user’s account on a platform, authorized once while online. The Publisher stores its token encrypted.
  • OAuth2 and PNBA: how accounts link. OAuth2 goes through the platform’s consent page, as for Gmail. Phone number-based authentication (PNBA) uses a code sent to the user’s phone, as for Telegram. The provider guides give each platform’s protocol.
  • Offline payload: content sent without a linked account, published through RelaySMS Mail. See Offline publishing.

The glossary defines the rest, and Architecture shows every component.

Where to start

ToRead
Try the Publisher on your machineQuick start
Run it in productionRequirements, then Install on a server
Offer a platformManaging adapters
Relay SMS to the PublisherManaging gateway clients
Build a clientgRPC API and REST API
Understand the protocolSecurity model and the RelaySMS whitepaper

Getting help