# murihat/automated-posting architecture

> Architecture diagram of the GitHub repository murihat/automated-posting, 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/murihat/automated-posting
- Repository: https://github.com/murihat/automated-posting

## Overview

This is a FastAPI service for validating a short promotional message and broadcasting it concurrently to five publishing platforms. The request enters through the posting endpoint, is validated as a message with one public CTA URL, and is passed to an orchestrator that isolates per-platform failures and returns structured results. Platform adapters own their respective external API calls and use a shared result-building contract. The README documents all five integrations; the sampled adapter excerpts support their request and response behavior. Connections below are limited to relationships shown in source or documented in the README.

Main entry points: [`app/services/posting_service.py`](https://github.com/murihat/automated-posting/blob/main/app/services/posting_service.py) (Posting service), [`app/platforms/base.py`](https://github.com/murihat/automated-posting/blob/main/app/platforms/base.py) (Platform contract), [`app/main.py`](https://github.com/murihat/automated-posting/blob/main/app/main.py) (Posting endpoint), [`app/platforms/github_gist.py`](https://github.com/murihat/automated-posting/blob/main/app/platforms/github_gist.py) (GitHub Gist adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and validation"]
  node_endpoint["Posting endpoint<br/>[main.py]"]
  node_schemas["Request and response models<br/>[schemas.py]"]
end

subgraph group_core["Posting orchestration"]
  node_service["Posting service<br/>[posting_service.py]"]
end

subgraph group_adapters["Platform adapters"]
  node_gist["GitHub Gist adapter<br/>[github_gist.py]"]
  node_devto["Dev.to adapter<br/>[devto.py]"]
  node_telegram["Telegram adapter<br/>[telegram.py]"]
  node_discord["Discord adapter<br/>[discord.py]"]
  node_mastodon["Mastodon adapter<br/>[mastodon.py]"]
end

subgraph group_contracts["Configuration and contracts"]
  node_settings["Environment settings<br/>[config.py]"]
  node_base["Platform contract<br/>[base.py]"]
end

node_publisher(("API caller"))
node_github_api["GitHub API"]
node_devto_api["Dev.to API"]
node_telegram_api["Telegram Bot API"]
node_discord_api["Discord webhook"]
node_mastodon_api["Mastodon API"]

node_publisher -->|"submits post"| node_endpoint
node_endpoint -->|"validates and models"| node_schemas
node_endpoint -->|"loads settings"| node_settings
node_endpoint -->|"invokes publishing"| node_service
node_service -->|"extracts CTA URL"| node_schemas
node_service -->|"dispatches publish"| node_gist
node_service -->|"dispatches publish"| node_devto
node_service -->|"dispatches publish"| node_telegram
node_service -->|"dispatches publish"| node_discord
node_service -->|"dispatches publish"| node_mastodon
node_gist -->|"creates gist"| node_github_api
node_devto -->|"publishes article"| node_devto_api
node_telegram -->|"sends message"| node_telegram_api
node_discord -->|"posts webhook"| node_discord_api
node_mastodon -->|"publishes status"| node_mastodon_api
node_gist -->|"builds results"| node_base
node_devto -->|"builds results"| node_base
node_telegram -->|"builds results"| node_base
node_discord -->|"builds results"| node_base
node_mastodon -->|"builds results"| node_base

click node_endpoint "https://github.com/murihat/automated-posting/blob/main/app/main.py"
click node_schemas "https://github.com/murihat/automated-posting/blob/main/app/schemas.py"
click node_settings "https://github.com/murihat/automated-posting/blob/main/app/config.py"
click node_service "https://github.com/murihat/automated-posting/blob/main/app/services/posting_service.py"
click node_base "https://github.com/murihat/automated-posting/blob/main/app/platforms/base.py"
click node_gist "https://github.com/murihat/automated-posting/blob/main/app/platforms/github_gist.py"
click node_devto "https://github.com/murihat/automated-posting/blob/main/app/platforms/devto.py"
click node_telegram "https://github.com/murihat/automated-posting/blob/main/app/platforms/telegram.py"
click node_discord "https://github.com/murihat/automated-posting/blob/main/app/platforms/discord.py"
click node_mastodon "https://github.com/murihat/automated-posting/blob/main/app/platforms/mastodon.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_endpoint,node_schemas toneBlue
class node_service toneAmber
class node_gist,node_devto,node_telegram,node_discord,node_mastodon,node_publisher,node_github_api,node_devto_api,node_telegram_api,node_discord_api,node_mastodon_api toneMint
class node_settings,node_base toneRose
```

## Components

### API and validation

- [Posting endpoint](https://github.com/murihat/automated-posting/blob/main/app/main.py): `app/main.py`
- [Request and response models](https://github.com/murihat/automated-posting/blob/main/app/schemas.py): `app/schemas.py`

### Posting orchestration

- [Posting service](https://github.com/murihat/automated-posting/blob/main/app/services/posting_service.py): `app/services/posting_service.py`

### Platform adapters

- [GitHub Gist adapter](https://github.com/murihat/automated-posting/blob/main/app/platforms/github_gist.py): `app/platforms/github_gist.py`
- [Dev.to adapter](https://github.com/murihat/automated-posting/blob/main/app/platforms/devto.py): `app/platforms/devto.py`
- [Telegram adapter](https://github.com/murihat/automated-posting/blob/main/app/platforms/telegram.py): `app/platforms/telegram.py`
- [Discord adapter](https://github.com/murihat/automated-posting/blob/main/app/platforms/discord.py): `app/platforms/discord.py`
- [Mastodon adapter](https://github.com/murihat/automated-posting/blob/main/app/platforms/mastodon.py): `app/platforms/mastodon.py`

### Configuration and contracts

- [Environment settings](https://github.com/murihat/automated-posting/blob/main/app/config.py): `app/config.py`
- [Platform contract](https://github.com/murihat/automated-posting/blob/main/app/platforms/base.py): `app/platforms/base.py`

### Other components

- **API caller**
- **GitHub API**
- **Dev.to API**
- **Telegram Bot API**
- **Discord webhook**
- **Mastodon API**

## Connections

- API caller → Posting endpoint: submits post (evidence: `README.md`)
- Posting endpoint → Request and response models: validates and models (evidence: `app/main.py`)
- Posting endpoint → Environment settings: loads settings (evidence: `app/main.py`)
- Posting endpoint → Posting service: invokes publishing (evidence: `app/main.py`)
- Posting service → Request and response models: extracts CTA URL (evidence: `app/services/posting_service.py`)
- Posting service → GitHub Gist adapter: dispatches publish (evidence: `app/services/posting_service.py`)
- Posting service → Dev.to adapter: dispatches publish (evidence: `app/services/posting_service.py`)
- Posting service → Telegram adapter: dispatches publish (evidence: `app/services/posting_service.py`)
- Posting service → Discord adapter: dispatches publish (evidence: `app/services/posting_service.py`)
- Posting service → Mastodon adapter: dispatches publish (evidence: `app/services/posting_service.py`)
- GitHub Gist adapter → GitHub API: creates gist (evidence: `app/platforms/github_gist.py`)
- Dev.to adapter → Dev.to API: publishes article (evidence: `app/platforms/devto.py`)
- Telegram adapter → Telegram Bot API: sends message (evidence: `app/platforms/telegram.py`)
- Discord adapter → Discord webhook: posts webhook (evidence: `app/platforms/discord.py`)
- Mastodon adapter → Mastodon API: publishes status (evidence: `app/platforms/mastodon.py`)
- GitHub Gist adapter → Platform contract: builds results (evidence: `app/platforms/github_gist.py`)
- Dev.to adapter → Platform contract: builds results (evidence: `app/platforms/devto.py`)
- Telegram adapter → Platform contract: builds results (evidence: `app/platforms/telegram.py`)
- Discord adapter → Platform contract: builds results (evidence: `app/platforms/discord.py`)
- Mastodon adapter → Platform contract: builds results (evidence: `app/platforms/mastodon.py`)
