# cvatricks/evamariaa architecture

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

- Interactive diagram: https://gitdiagram.com/cvatricks/evamariaa
- Repository: https://github.com/cvatricks/evamariaa

## Overview

Eva Maria is a Telegram media-search and file-sharing bot. Users search in chats or inline and receive matching indexed media; admins and contributors can add or manage indexed files. Other documented capabilities include manual filters, IMDb lookup, moderation, broadcasts, and file links. The graph reflects the sampled search, indexing, and database paths plus README-documented feature branches; unsampled plugin internals limit the detail of those branches.

Main entry points: [`database/ia_filterdb.py`](https://github.com/cvatricks/evamariaa/blob/master/database/ia_filterdb.py) (Indexed media), [`bot.py`](https://github.com/cvatricks/evamariaa/blob/master/bot.py) (Bot startup), [`plugins/pm_filter.py`](https://github.com/cvatricks/evamariaa/blob/master/plugins/pm_filter.py) (Auto and IMDb search), [`database/users_chats_db.py`](https://github.com/cvatricks/evamariaa/blob/master/database/users_chats_db.py) (Users and chats)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_bot["Bot startup<br/>[bot.py]"]
end

subgraph group_media["Media discovery"]
  node_search["Auto and IMDb search<br/>[pm_filter.py]"]
  node_inline["Inline search<br/>[inline.py]"]
  node_manual["Manual filters<br/>[filters.py]"]
  node_filelinks["File links<br/>[genlink.py]"]
  node_indexing["Channel indexing<br/>[index.py]"]
end

subgraph group_admin["Administration"]
  node_admincmd["Admin commands<br/>[commands.py]"]
  node_moderation["Moderation and stats<br/>[p_ttishow.py]"]
  node_broadcast["Broadcast<br/>[broadcast.py]"]
  node_channel["Channel management<br/>[channel.py]"]
end

subgraph group_storage["MongoDB storage"]
  node_media_db[("Indexed media<br/>[ia_filterdb.py]")]
  node_filter_db[("Chat filters<br/>[filters_mdb.py]")]
  node_user_db[("Users and chats<br/>[users_chats_db.py]")]
  node_connection_db[("Chat connections<br/>[connections_mdb.py]")]
end

subgraph group_support["Shared support"]
  node_config["Bot configuration<br/>[info.py]"]
  node_helpers["Search and bot helpers<br/>[utils.py]"]
  node_templates["Bot messages<br/>[Script.py]"]
end

node_users(("Telegram users"))
node_admins(("Bot admins"))
node_telegram["Telegram API"]
node_mongodb[("MongoDB")]
node_imdb["IMDb data"]

node_users -->|"send requests"| node_bot
node_admins -->|"send commands"| node_bot
node_bot -->|"connects through"| node_telegram
node_bot -->|"uses"| node_user_db
node_bot -->|"loads"| node_config
node_bot -->|"uses"| node_helpers
node_search -->|"searches"| node_media_db
node_search -->|"checks filters"| node_filter_db
node_search -->|"uses"| node_helpers
node_search -->|"fetches movie data"| node_imdb
node_inline -->|"searches"| node_media_db
node_manual -->|"manages filters"| node_filter_db
node_manual -->|"manages connections"| node_connection_db
node_filelinks -->|"looks up files"| node_media_db
node_indexing -->|"saves indexed files"| node_media_db
node_indexing -->|"reads channel messages"| node_telegram
node_admincmd -->|"manages file index"| node_media_db
node_admincmd -->|"reads user and chat data"| node_user_db
node_admincmd -->|"manages connections"| node_connection_db
node_moderation -->|"manages users and chats"| node_user_db
node_moderation -->|"counts indexed files"| node_media_db
node_broadcast -->|"reads recipients"| node_user_db
node_channel -->|"uses media records"| node_media_db
node_media_db -->|"stores media"| node_mongodb
node_filter_db -->|"stores filters"| node_mongodb
node_user_db -->|"stores users and chats"| node_mongodb
node_connection_db -->|"stores connections"| node_mongodb
node_search -->|"uses message text"| node_templates

click node_bot "https://github.com/cvatricks/evamariaa/blob/master/bot.py"
click node_search "https://github.com/cvatricks/evamariaa/blob/master/plugins/pm_filter.py"
click node_inline "https://github.com/cvatricks/evamariaa/blob/master/plugins/inline.py"
click node_manual "https://github.com/cvatricks/evamariaa/blob/master/plugins/filters.py"
click node_filelinks "https://github.com/cvatricks/evamariaa/blob/master/plugins/genlink.py"
click node_indexing "https://github.com/cvatricks/evamariaa/blob/master/plugins/index.py"
click node_admincmd "https://github.com/cvatricks/evamariaa/blob/master/plugins/commands.py"
click node_moderation "https://github.com/cvatricks/evamariaa/blob/master/plugins/p_ttishow.py"
click node_broadcast "https://github.com/cvatricks/evamariaa/blob/master/plugins/broadcast.py"
click node_channel "https://github.com/cvatricks/evamariaa/blob/master/plugins/channel.py"
click node_media_db "https://github.com/cvatricks/evamariaa/blob/master/database/ia_filterdb.py"
click node_filter_db "https://github.com/cvatricks/evamariaa/blob/master/database/filters_mdb.py"
click node_user_db "https://github.com/cvatricks/evamariaa/blob/master/database/users_chats_db.py"
click node_connection_db "https://github.com/cvatricks/evamariaa/blob/master/database/connections_mdb.py"
click node_config "https://github.com/cvatricks/evamariaa/blob/master/info.py"
click node_helpers "https://github.com/cvatricks/evamariaa/blob/master/utils.py"
click node_templates "https://github.com/cvatricks/evamariaa/blob/master/Script.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_bot,node_users toneBlue
class node_search,node_inline,node_manual,node_filelinks,node_indexing,node_mongodb toneAmber
class node_admincmd,node_moderation,node_broadcast,node_channel,node_telegram toneMint
class node_media_db,node_filter_db,node_user_db,node_connection_db toneRose
class node_config,node_helpers,node_templates,node_admins,node_imdb toneIndigo
```

## Components

### Bot runtime

- [Bot startup](https://github.com/cvatricks/evamariaa/blob/master/bot.py): `bot.py`

### Media discovery

- [Auto and IMDb search](https://github.com/cvatricks/evamariaa/blob/master/plugins/pm_filter.py): `plugins/pm_filter.py`
- [Inline search](https://github.com/cvatricks/evamariaa/blob/master/plugins/inline.py): `plugins/inline.py`
- [Manual filters](https://github.com/cvatricks/evamariaa/blob/master/plugins/filters.py): `plugins/filters.py`
- [File links](https://github.com/cvatricks/evamariaa/blob/master/plugins/genlink.py): `plugins/genlink.py`
- [Channel indexing](https://github.com/cvatricks/evamariaa/blob/master/plugins/index.py): `plugins/index.py`

### Administration

- [Admin commands](https://github.com/cvatricks/evamariaa/blob/master/plugins/commands.py): `plugins/commands.py`
- [Moderation and stats](https://github.com/cvatricks/evamariaa/blob/master/plugins/p_ttishow.py): `plugins/p_ttishow.py`
- [Broadcast](https://github.com/cvatricks/evamariaa/blob/master/plugins/broadcast.py): `plugins/broadcast.py`
- [Channel management](https://github.com/cvatricks/evamariaa/blob/master/plugins/channel.py): `plugins/channel.py`

### MongoDB storage

- [Indexed media](https://github.com/cvatricks/evamariaa/blob/master/database/ia_filterdb.py): `database/ia_filterdb.py`
- [Chat filters](https://github.com/cvatricks/evamariaa/blob/master/database/filters_mdb.py): `database/filters_mdb.py`
- [Users and chats](https://github.com/cvatricks/evamariaa/blob/master/database/users_chats_db.py): `database/users_chats_db.py`
- [Chat connections](https://github.com/cvatricks/evamariaa/blob/master/database/connections_mdb.py): `database/connections_mdb.py`

### Shared support

- [Bot configuration](https://github.com/cvatricks/evamariaa/blob/master/info.py): `info.py`
- [Search and bot helpers](https://github.com/cvatricks/evamariaa/blob/master/utils.py): `utils.py`
- [Bot messages](https://github.com/cvatricks/evamariaa/blob/master/Script.py): `Script.py`

### Other components

- **Telegram users**
- **Bot admins**
- **Telegram API**
- **MongoDB**
- **IMDb data**

## Connections

- Telegram users → Bot startup: send requests (evidence: `README.md`)
- Bot admins → Bot startup: send commands (evidence: `README.md`)
- Bot startup → Telegram API: connects through
- Bot startup → Users and chats: uses (evidence: `bot.py`)
- Bot startup → Bot configuration: loads (evidence: `bot.py`)
- Bot startup → Search and bot helpers: uses (evidence: `bot.py`)
- Auto and IMDb search → Indexed media: searches (evidence: `plugins/pm_filter.py`)
- Auto and IMDb search → Chat filters: checks filters (evidence: `plugins/pm_filter.py`)
- Auto and IMDb search → Search and bot helpers: uses (evidence: `plugins/pm_filter.py`)
- Auto and IMDb search → IMDb data: fetches movie data
- Inline search → Indexed media: searches (evidence: `plugins/inline.py`)
- Manual filters → Chat filters: manages filters (evidence: `plugins/filters.py`)
- Manual filters → Chat connections: manages connections (evidence: `plugins/filters.py`)
- File links → Indexed media: looks up files (evidence: `plugins/genlink.py`)
- Channel indexing → Indexed media: saves indexed files (evidence: `plugins/index.py`)
- Channel indexing → Telegram API: reads channel messages (evidence: `plugins/index.py`)
- Admin commands → Indexed media: manages file index (evidence: `plugins/commands.py`)
- Admin commands → Users and chats: reads user and chat data (evidence: `plugins/commands.py`)
- Admin commands → Chat connections: manages connections (evidence: `plugins/commands.py`)
- Moderation and stats → Users and chats: manages users and chats (evidence: `plugins/p_ttishow.py`)
- Moderation and stats → Indexed media: counts indexed files (evidence: `plugins/p_ttishow.py`)
- Broadcast → Users and chats: reads recipients (evidence: `plugins/broadcast.py`)
- Channel management → Indexed media: uses media records (evidence: `plugins/channel.py`)
- Indexed media → MongoDB: stores media (evidence: `database/ia_filterdb.py`)
- Chat filters → MongoDB: stores filters (evidence: `database/filters_mdb.py`)
- Users and chats → MongoDB: stores users and chats (evidence: `database/users_chats_db.py`)
- Chat connections → MongoDB: stores connections (evidence: `database/connections_mdb.py`)
- Auto and IMDb search → Bot messages: uses message text (evidence: `plugins/pm_filter.py`)
