# westviewz/ottupdates architecture

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

- Interactive diagram: https://gitdiagram.com/westviewz/ottupdates
- Repository: https://github.com/westviewz/ottupdates

## Overview

OTT Update Bot runs a daily release-update workflow: it discovers Indian streaming releases through TMDB, applies confidence and duplicate filters, formats new items, and posts them to a Telegram channel while recording successful posts in MongoDB. The graph preserves the documented scheduling, provider normalization, artwork, and empty-update capabilities. The release-processing implementation was not sampled, so its internal links are omitted or marked unverified rather than inferred.

Main entry points: [`app/main.py`](https://github.com/westviewz/ottupdates/blob/main/app/main.py) (Run orchestrator), [`app/mongodb.py`](https://github.com/westviewz/ottupdates/blob/main/app/mongodb.py) (MongoDB client), [`app/releases.py`](https://github.com/westviewz/ottupdates/blob/main/app/releases.py) (Release processing), [`app/tmdb.py`](https://github.com/westviewz/ottupdates/blob/main/app/tmdb.py) (TMDB client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_run["Run Control"]
  node_entry["Run orchestrator<br/>[main.py]"]
  node_configuration["Configuration<br/>[config.py]"]
end

subgraph group_discovery["Release Discovery"]
  node_release_pipeline["Release processing<br/>[releases.py]"]
  node_tmdb_client["TMDB client<br/>[tmdb.py]"]
  node_provider_mapping["Provider normalization<br/>[providers.py]"]
end

subgraph group_publishing["Post Publishing"]
  node_message_formatter["Message formatting<br/>[formatter.py]"]
  node_poster_resolver["Poster URL resolver<br/>[poster.py]"]
  node_telegram_client["Telegram client<br/>[telegram_bot.py]"]
end

subgraph group_state["Duplicate State"]
  node_database_client["MongoDB client<br/>[mongodb.py]"]
  node_mongodb[("MongoDB store")]
end

node_cron(("Daily trigger"))
node_tmdb_service["TMDB API"]
node_telegram_channel(("Telegram channel"))

node_cron -->|"starts"| node_entry
node_entry -->|"loads"| node_configuration
node_entry -->|"initializes"| node_database_client
node_entry -->|"fetches releases"| node_release_pipeline
node_release_pipeline -.->|"uses"| node_tmdb_client
node_tmdb_client -->|"queries"| node_tmdb_service
node_entry -->|"checks duplicates"| node_database_client
node_database_client -->|"reads and writes"| node_mongodb
node_entry -->|"formats posts"| node_message_formatter
node_message_formatter -->|"gets emoji"| node_provider_mapping
node_entry -.->|"resolves artwork"| node_poster_resolver
node_entry -->|"sends posts"| node_telegram_client
node_telegram_client -->|"posts message"| node_telegram_channel
node_entry -->|"records success"| node_database_client

click node_entry "https://github.com/westviewz/ottupdates/blob/main/app/main.py"
click node_configuration "https://github.com/westviewz/ottupdates/blob/main/app/config.py"
click node_release_pipeline "https://github.com/westviewz/ottupdates/blob/main/app/releases.py"
click node_tmdb_client "https://github.com/westviewz/ottupdates/blob/main/app/tmdb.py"
click node_provider_mapping "https://github.com/westviewz/ottupdates/blob/main/app/providers.py"
click node_database_client "https://github.com/westviewz/ottupdates/blob/main/app/mongodb.py"
click node_message_formatter "https://github.com/westviewz/ottupdates/blob/main/app/formatter.py"
click node_poster_resolver "https://github.com/westviewz/ottupdates/blob/main/app/poster.py"
click node_telegram_client "https://github.com/westviewz/ottupdates/blob/main/app/telegram_bot.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_entry,node_configuration toneBlue
class node_release_pipeline,node_tmdb_client,node_provider_mapping toneAmber
class node_message_formatter,node_poster_resolver,node_telegram_client,node_tmdb_service toneMint
class node_database_client,node_mongodb toneRose
class node_cron,node_telegram_channel toneIndigo
```

## Components

### Run Control

- [Run orchestrator](https://github.com/westviewz/ottupdates/blob/main/app/main.py): `app/main.py`
- [Configuration](https://github.com/westviewz/ottupdates/blob/main/app/config.py): `app/config.py`

### Release Discovery

- [Release processing](https://github.com/westviewz/ottupdates/blob/main/app/releases.py): `app/releases.py`
- [TMDB client](https://github.com/westviewz/ottupdates/blob/main/app/tmdb.py): `app/tmdb.py`
- [Provider normalization](https://github.com/westviewz/ottupdates/blob/main/app/providers.py): `app/providers.py`

### Post Publishing

- [Message formatting](https://github.com/westviewz/ottupdates/blob/main/app/formatter.py): `app/formatter.py`
- [Poster URL resolver](https://github.com/westviewz/ottupdates/blob/main/app/poster.py): `app/poster.py`
- [Telegram client](https://github.com/westviewz/ottupdates/blob/main/app/telegram_bot.py): `app/telegram_bot.py`

### Duplicate State

- [MongoDB client](https://github.com/westviewz/ottupdates/blob/main/app/mongodb.py): `app/mongodb.py`
- **MongoDB store**

### Other components

- **Daily trigger**
- **TMDB API**
- **Telegram channel**

## Connections

- Daily trigger → Run orchestrator: starts (evidence: `README.md`)
- Run orchestrator → Configuration: loads (evidence: `app/main.py`)
- Run orchestrator → MongoDB client: initializes (evidence: `app/main.py`)
- Run orchestrator → Release processing: fetches releases (evidence: `app/main.py`)
- Release processing → TMDB client: uses
- TMDB client → TMDB API: queries (evidence: `app/tmdb.py`)
- Run orchestrator → MongoDB client: checks duplicates (evidence: `README.md`)
- MongoDB client → MongoDB store: reads and writes (evidence: `app/mongodb.py`)
- Run orchestrator → Message formatting: formats posts (evidence: `app/main.py`)
- Message formatting → Provider normalization: gets emoji (evidence: `app/formatter.py`)
- Run orchestrator → Poster URL resolver: resolves artwork (evidence: `app/main.py`)
- Run orchestrator → Telegram client: sends posts (evidence: `app/main.py`)
- Telegram client → Telegram channel: posts message (evidence: `app/telegram_bot.py`)
- Run orchestrator → MongoDB client: records success (evidence: `README.md`)
