# narges-soveyzi/pharmacy architecture

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

- Interactive diagram: https://gitdiagram.com/narges-soveyzi/pharmacy
- Repository: https://github.com/narges-soveyzi/pharmacy

## Overview

This is a Telegram pharmacy-shopping bot. Users browse products or look them up by code, add items to an in-memory cart, and receive payment instructions; receipt text and support, consultation, or prescription messages are forwarded to an administrator. The sampled implementation is largely one callback/message handler module, so the workflow stages below are responsibilities within that module, not separate services. Evidence is limited to the excerpts from main-pharmacy_py.py; the README is empty.

Main entry points: [`main-pharmacy_py.py`](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py) (Bot handlers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shopping["Product shopping"]
  node_catalog[("Product catalog")]
  node_browse["Category browsing"]
  node_lookup["Code lookup"]
end

subgraph group_orders["Cart and payment"]
  node_cart[("Cart management")]
  node_checkout["Payment instructions"]
  node_receipt["Receipt intake"]
end

subgraph group_communications["User communications"]
  node_support["Support requests"]
  node_consultation["Consultation requests"]
  node_prescription["Prescription intake"]
end

node_customer(("Telegram customer"))
node_telegram{{"Telegram platform"}}
node_admin(("Pharmacy administrator"))
node_bot["Bot handlers"]
node_session[("User state")]

node_customer -->|"sends updates"| node_telegram
node_telegram -->|"dispatches updates"| node_bot
node_bot -->|"routes callbacks"| node_browse
node_browse -->|"reads products"| node_catalog
node_bot -->|"routes messages"| node_lookup
node_lookup -->|"reads product code"| node_catalog
node_bot -->|"updates and reads"| node_cart
node_bot -->|"routes payment"| node_checkout
node_checkout -->|"reads totals"| node_cart
node_bot -->|"routes receipt text"| node_receipt
node_bot -->|"routes support text"| node_support
node_bot -->|"routes consultation text"| node_consultation
node_bot -->|"routes prescription text"| node_prescription
node_bot -->|"reads and writes"| node_session
node_bot -->|"sends replies"| node_telegram
node_receipt -->|"sends receipt details"| node_admin
node_support -->|"forwards message"| node_admin
node_consultation -->|"forwards question"| node_admin
node_prescription -->|"forwards details"| node_admin

click node_bot "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_catalog "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_browse "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_lookup "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_cart "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_checkout "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_receipt "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_support "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_consultation "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_prescription "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py"
click node_session "https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.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_catalog,node_browse,node_lookup toneBlue
class node_cart,node_checkout,node_receipt,node_session toneAmber
class node_support,node_consultation,node_prescription,node_bot toneMint
class node_customer,node_telegram,node_admin toneIndigo
```

## Components

### Product shopping

- [Product catalog](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [Category browsing](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [Code lookup](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`

### Cart and payment

- [Cart management](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [Payment instructions](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [Receipt intake](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`

### User communications

- [Support requests](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [Consultation requests](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [Prescription intake](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`

### Other components

- **Telegram customer**
- **Telegram platform**
- **Pharmacy administrator**
- [Bot handlers](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`
- [User state](https://github.com/narges-soveyzi/pharmacy/blob/master/main-pharmacy_py.py): `main-pharmacy_py.py`

## Connections

- Telegram customer → Telegram platform: sends updates
- Telegram platform → Bot handlers: dispatches updates (evidence: `main-pharmacy_py.py`)
- Bot handlers → Category browsing: routes callbacks (evidence: `main-pharmacy_py.py`)
- Category browsing → Product catalog: reads products (evidence: `main-pharmacy_py.py`)
- Bot handlers → Code lookup: routes messages (evidence: `main-pharmacy_py.py`)
- Code lookup → Product catalog: reads product code (evidence: `main-pharmacy_py.py`)
- Bot handlers → Cart management: updates and reads (evidence: `main-pharmacy_py.py`)
- Bot handlers → Payment instructions: routes payment (evidence: `main-pharmacy_py.py`)
- Payment instructions → Cart management: reads totals (evidence: `main-pharmacy_py.py`)
- Bot handlers → Receipt intake: routes receipt text (evidence: `main-pharmacy_py.py`)
- Bot handlers → Support requests: routes support text (evidence: `main-pharmacy_py.py`)
- Bot handlers → Consultation requests: routes consultation text (evidence: `main-pharmacy_py.py`)
- Bot handlers → Prescription intake: routes prescription text (evidence: `main-pharmacy_py.py`)
- Bot handlers → User state: reads and writes (evidence: `main-pharmacy_py.py`)
- Bot handlers → Telegram platform: sends replies (evidence: `main-pharmacy_py.py`)
- Receipt intake → Pharmacy administrator: sends receipt details (evidence: `main-pharmacy_py.py`)
- Support requests → Pharmacy administrator: forwards message (evidence: `main-pharmacy_py.py`)
- Consultation requests → Pharmacy administrator: forwards question (evidence: `main-pharmacy_py.py`)
- Prescription intake → Pharmacy administrator: forwards details (evidence: `main-pharmacy_py.py`)
