# nikoksr/notify architecture

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

- Interactive diagram: https://gitdiagram.com/nikoksr/notify
- Repository: https://github.com/nikoksr/notify

## Overview

##### Project type and purpose
- This is a Go-based library (no UI or standalone server) whose sole purpose is to provide a dead-simple, extensible framework for sending notifications to a large number of external messaging services (Telegram, Slack, Email, AWS SNS/SES, etc.).
- The README describes it as “A dead simple Go library for sending notifications to various messaging services.”

##### File structure
- Top level:
- core files (notify.go, send.go, use.go, version.go) and their tests.
- go.mod/go.sum for module dependencies.
- assets (logo), CI configs, linters, mocks configuration.
- service/… subdirectory containing one folder per supported service. Each service folder holds:
– implementation (`*.go`)
– tests (`*_test.go`)
– mocks for its external client
– service-specific README or usage doc.
- Pattern: each service implements a common Service interface defined in core. The library uses a plugin/adapter pattern: the core dispatches messages through any number of registered services.
- Build & deployment: Makefile, GitHub Actions, code coverage, static analysis.

##### README for additional insights
- It shows example usage: create a service instance, add receivers, pass it to notify.UseServices, then call notify.Send.
- It lists supported services and their external client libraries, reinforcing the adapter architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    ClientApp["Client Application"]:::external

    %% Core Library
    subgraph "Notify Core"
        direction TB
        SI["Service Interface"]:::core
        SR["Service Registry"]:::core
        US["UseServices API"]:::core
        SND["Send API"]:::core
        V["Version Information"]:::core
    end

    %% Service Adapters
    subgraph "Service Adapters"
        direction TB
        SES["Amazon SES Adapter"]:::adapter
        SNS["Amazon SNS Adapter"]:::adapter
        SLK["Slack Adapter"]:::adapter
        TLG["Telegram Adapter"]:::adapter
        MAIL["Email (SMTP) Adapter"]:::adapter
        HTTP["HTTP Adapter"]:::adapter
        FCM["FCM Adapter"]:::adapter
        GCH["Google Chat Adapter"]:::adapter
        DD["DingTalk Adapter"]:::adapter
        DIS["Discord Adapter"]:::adapter
        LRK["Lark Adapter"]:::adapter
        LNE["Line Notify Adapter"]:::adapter
        MLG["Mailgun Adapter"]:::adapter
        MTX["Matrix Adapter"]:::adapter
        MMT["Mattermost Adapter"]:::adapter
        MTS["MS Teams Adapter"]:::adapter
        PD["PagerDuty Adapter"]:::adapter
        PLV["Plivo Adapter"]:::adapter
        PBL["Pushbullet Adapter"]:::adapter
        PSV["Pushover Adapter"]:::adapter
        RDT["Reddit Adapter"]:::adapter
        RCK["Rocket.Chat Adapter"]:::adapter
        SGD["SendGrid Adapter"]:::adapter
        SY["Syslog Adapter"]:::adapter
        TMG["TextMagic Adapter"]:::adapter
        TWL["Twilio Adapter"]:::adapter
        TWT["Twitter Adapter"]:::adapter
        VBR["Viber Adapter"]:::adapter
        WBP["WebPush Adapter"]:::adapter
        WCT["WeChat Adapter"]:::adapter
        WHT["WhatsApp Adapter"]:::adapter
    end

    %% External Services
    External["External Messaging Services"]:::external

    %% CI & Config
    subgraph "CI & Configuration"
        direction TB
        MOD["go.mod / go.sum"]:::peripheral
        MAKE["Makefile"]:::peripheral
        LINT[".golangci.yaml / .mockery.yaml"]:::peripheral
        CIWF["GitHub Actions Workflows"]:::peripheral
    end

    %% Connections
    ClientApp -->|"calls UseServices"| US
    ClientApp -->|"calls Send"| SND
    US -->|"registers with"| SR
    SND -->|"iterates services"| SR
    SR -->|"provides adapters"| SES
    SR --> SES
    SR --> SNS
    SR --> SLK
    SR --> TLG
    SR --> MAIL
    SR --> HTTP
    SR --> FCM
    SR --> GCH
    SR --> DD
    SR --> DIS
    SR --> LRK
    SR --> LNE
    SR --> MLG
    SR --> MTX
    SR --> MMT
    SR --> MTS
    SR --> PD
    SR --> PLV
    SR --> PBL
    SR --> PSV
    SR --> RDT
    SR --> RCK
    SR --> SGD
    SR --> SY
    SR --> TMG
    SR --> TWL
    SR --> TWT
    SR --> VBR
    SR --> WBP
    SR --> WCT
    SR --> WHT
    SES -->|"Send() via AWS SDK"| External
    SNS -->|"Send() via AWS SDK"| External
    SLK -->|"Send() via Slack SDK"| External
    TLG -->|"Send() via Telegram API"| External
    MAIL -->|"Send() via SMTP"| External
    HTTP -->|"Post() via HTTP"| External
    FCM -->|"Send() via FCM Client"| External
    GCH -->|"CreateMessage() via Google Chat API"| External
    DD -->|"Send() via DingTalk API"| External
    DIS -->|"Send() via Discord API"| External
    LRK -->|"Post() via Lark Webhook"| External
    LNE -->|"Notify() via Line API"| External
    MLG -->|"Send() via Mailgun API"| External
    MTX -->|"Send() via Matrix Client"| External
    MMT -->|"Send() via Mattermost API"| External
    MTS -->|"Send() via MS Teams API"| External
    PD -->|"Trigger() via PagerDuty API"| External
    PLV -->|"Send() via Plivo API"| External
    PBL -->|"Send() via Pushbullet API"| External
    PSV -->|"Send() via Pushover API"| External
    RDT -->|"Send() via Reddit API"| External
    RCK -->|"Send() via Rocket.Chat API"| External
    SGD -->|"Send() via SendGrid API"| External
    SY -->|"Write() via Syslog"| External
    TMG -->|"Send() via TextMagic API"| External
    TWL -->|"Send() via Twilio API"| External
    TWT -->|"Send() via Twitter API"| External
    VBR -->|"Send() via Viber API"| External
    WBP -->|"Send() via WebPush API"| External
    WCT -->|"Send() via WeChat API"| External
    WHT -->|"Send() via WhatsApp API"| External

    %% Click Events
    click SI "https://github.com/nikoksr/notify/blob/main/notify.go"
    click SR "https://github.com/nikoksr/notify/blob/main/notify.go"
    click US "https://github.com/nikoksr/notify/blob/main/use.go"
    click SND "https://github.com/nikoksr/notify/blob/main/send.go"
    click V "https://github.com/nikoksr/notify/blob/main/version.go"
    click SES "https://github.com/nikoksr/notify/blob/main/service/amazonses/amazon_ses.go"
    click SNS "https://github.com/nikoksr/notify/blob/main/service/amazonsns/amazon_sns.go"
    click SLK "https://github.com/nikoksr/notify/blob/main/service/slack/slack.go"
    click TLG "https://github.com/nikoksr/notify/blob/main/service/telegram/telegram.go"
    click MAIL "https://github.com/nikoksr/notify/blob/main/service/mail/mail.go"
    click HTTP "https://github.com/nikoksr/notify/blob/main/service/http/http.go"
    click FCM "https://github.com/nikoksr/notify/blob/main/service/fcm/fcm.go"
    click GCH "https://github.com/nikoksr/notify/blob/main/service/googlechat/googlechat.go"
    click DD "https://github.com/nikoksr/notify/blob/main/service/dingding/dingding.go"
    click DIS "https://github.com/nikoksr/notify/blob/main/service/discord/discord.go"
    click LRK "https://github.com/nikoksr/notify/blob/main/service/lark/webhook.go"
    click LNE "https://github.com/nikoksr/notify/blob/main/service/line/line_notify.go"
    click MLG "https://github.com/nikoksr/notify/blob/main/service/mailgun/mailgun.go"
    click MTX "https://github.com/nikoksr/notify/blob/main/service/matrix/matrix.go"
    click MMT "https://github.com/nikoksr/notify/blob/main/service/mattermost/mattermost.go"
    click MTS "https://github.com/nikoksr/notify/blob/main/service/msteams/ms_teams.go"
    click PD "https://github.com/nikoksr/notify/blob/main/service/pagerduty/pager_duty.go"
    click PLV "https://github.com/nikoksr/notify/blob/main/service/plivo/plivo.go"
    click PBL "https://github.com/nikoksr/notify/blob/main/service/pushbullet/pushbullet.go"
    click PSV "https://github.com/nikoksr/notify/blob/main/service/pushover/pushover.go"
    click RDT "https://github.com/nikoksr/notify/blob/main/service/reddit/reddit.go"
    click RCK "https://github.com/nikoksr/notify/blob/main/service/rocketchat/rocketchat.go"
    click SGD "https://github.com/nikoksr/notify/blob/main/service/sendgrid/sendgrid.go"
    click SY "https://github.com/nikoksr/notify/blob/main/service/syslog/syslog.go"
    click TMG "https://github.com/nikoksr/notify/blob/main/service/textmagic/textmagic.go"
    click TWL "https://github.com/nikoksr/notify/blob/main/service/twilio/twilio.go"
    click TWT "https://github.com/nikoksr/notify/blob/main/service/twitter/twitter.go"
    click VBR "https://github.com/nikoksr/notify/blob/main/service/viber/viber.go"
    click WBP "https://github.com/nikoksr/notify/blob/main/service/webpush/webpush.go"
    click WCT "https://github.com/nikoksr/notify/blob/main/service/wechat/wechat.go"
    click WHT "https://github.com/nikoksr/notify/blob/main/service/whatsapp/whatsapp.go"

    %% Styles
    classDef core fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef adapter fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef external fill:#ffe5b4,stroke:#333,stroke-width:1px;
    classDef peripheral fill:#e2e3e5,stroke:#333,stroke-width:1px;
```
