# nkvv69/businka-feed-bot architecture

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

- Interactive diagram: https://gitdiagram.com/nkvv69/businka-feed-bot
- Repository: https://github.com/nkvv69/businka-feed-bot

## Overview

Businka Feed Bot is a small Telegram pet-care bot. The user interacts through Telegram messages and callback buttons: the dispatcher routes inputs to handlers, which provide feeding prompts, record weights, show weight history, and update pet name or feeding times. Pet settings and weight records are persisted in a local JSON file. The README advertises feeding reminders, but the sampled implementation responds only when the user requests feeding; no scheduled reminder loop is shown.

Main entry points: [`businka_feed_bot_full.py`](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py) (Message dispatcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_telegram["Telegram interaction"]
  node_dispatch["Message dispatcher"]
end

subgraph group_features["Pet features"]
  node_start["Start menu"]
  node_feeding["Feeding prompt"]
  node_weight_entry["Weight entry"]
  node_weight_history["Weight history"]
  node_settings["Settings menu"]
  node_rename["Rename pet"]
  node_schedule["Feeding times"]
end

subgraph group_state["Bot state"]
  node_fsm["Conversation state"]
  node_pet_data[("Pet data")]
  node_json_file["Local JSON file"]
end

node_owner(("Pet owner"))
node_telegram(("Telegram"))

node_owner -->|"sends input"| node_telegram
node_telegram -->|"delivers updates"| node_dispatch
node_dispatch -->|"routes command"| node_start
node_dispatch -->|"routes request"| node_feeding
node_dispatch -->|"routes input"| node_weight_entry
node_dispatch -->|"routes request"| node_weight_history
node_dispatch -->|"routes request"| node_settings
node_dispatch -->|"routes input"| node_rename
node_dispatch -->|"routes input"| node_schedule
node_weight_entry -->|"sets state"| node_fsm
node_rename -->|"sets state"| node_fsm
node_schedule -->|"sets state"| node_fsm
node_weight_entry -->|"appends record"| node_pet_data
node_rename -->|"updates name"| node_pet_data
node_schedule -->|"updates times"| node_pet_data
node_weight_history -->|"reads records"| node_pet_data
node_feeding -->|"reads pet name"| node_pet_data
node_pet_data -->|"loads and saves"| node_json_file
node_dispatch -->|"polls and replies"| node_telegram

click node_dispatch "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_start "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_feeding "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_weight_entry "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_weight_history "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_settings "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_rename "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_schedule "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_fsm "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_pet_data "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py"
click node_json_file "https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.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_dispatch toneBlue
class node_start,node_feeding,node_weight_entry,node_weight_history,node_settings,node_rename,node_schedule toneAmber
class node_fsm,node_pet_data,node_json_file toneMint
class node_owner,node_telegram toneIndigo
```

## Components

### Telegram interaction

- [Message dispatcher](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`

### Pet features

- [Start menu](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Feeding prompt](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Weight entry](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Weight history](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Settings menu](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Rename pet](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Feeding times](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`

### Bot state

- [Conversation state](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Pet data](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`
- [Local JSON file](https://github.com/nkvv69/businka-feed-bot/blob/main/businka_feed_bot_full.py): `businka_feed_bot_full.py`

### Other components

- **Pet owner**
- **Telegram**

## Connections

- Pet owner → Telegram: sends input (evidence: `README.md`)
- Telegram → Message dispatcher: delivers updates (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Start menu: routes command (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Feeding prompt: routes request (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Weight entry: routes input (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Weight history: routes request (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Settings menu: routes request (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Rename pet: routes input (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Feeding times: routes input (evidence: `businka_feed_bot_full.py`)
- Weight entry → Conversation state: sets state (evidence: `businka_feed_bot_full.py`)
- Rename pet → Conversation state: sets state (evidence: `businka_feed_bot_full.py`)
- Feeding times → Conversation state: sets state (evidence: `businka_feed_bot_full.py`)
- Weight entry → Pet data: appends record (evidence: `businka_feed_bot_full.py`)
- Rename pet → Pet data: updates name (evidence: `businka_feed_bot_full.py`)
- Feeding times → Pet data: updates times (evidence: `businka_feed_bot_full.py`)
- Weight history → Pet data: reads records (evidence: `businka_feed_bot_full.py`)
- Feeding prompt → Pet data: reads pet name (evidence: `businka_feed_bot_full.py`)
- Pet data → Local JSON file: loads and saves (evidence: `businka_feed_bot_full.py`)
- Message dispatcher → Telegram: polls and replies (evidence: `businka_feed_bot_full.py`)
