# therealmoeid/agricultural-pharmacy architecture

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

- Interactive diagram: https://gitdiagram.com/therealmoeid/agricultural-pharmacy
- Repository: https://github.com/therealmoeid/agricultural-pharmacy

## Overview

This is an early-stage Persian agricultural-pharmacy catalog and consultation site, not an online shop. Customers browse and search products, then contact the store by phone; they can also submit a question or farm-visit request. The consultation flow saves the request before attempting a Telegram notice, leaving the admin inbox as the source of truth. The README also describes expert/FAQ content and seasonal articles, though their public presentation is incomplete or unsampled. Edges reflect README statements or references in the supplied source index; unsampled routing details are omitted.

Main entry points: [`apps/consultations/views.py`](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/views.py) (Request handling), [`apps/consultations/notifications.py`](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/notifications.py) (Telegram notices), [`apps/consultations/models.py`](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/models.py) (Request inbox), [`apps/catalog/search.py`](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/search.py) (Product search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Product catalog"]
  node_catalog_views["Product pages<br/>[views.py]"]
  node_product_search["Product search<br/>[search.py]"]
  node_catalog_data[("Catalog data<br/>[models.py]")]
end

subgraph group_consult["Consultations"]
  node_consult_views["Request handling<br/>[views.py]"]
  node_consult_forms["Request forms<br/>[forms.py]"]
  node_consult_data[("Request inbox<br/>[models.py]")]
  node_notifications["Telegram notices<br/>[notifications.py]"]
  node_rate_limit["Submission limits<br/>[ratelimit.py]"]
end

subgraph group_content["Site content"]
  node_experts_faq[("Experts and FAQ<br/>[models.py]")]
  node_page_views["Static pages<br/>[views.py]"]
  node_articles[("Seasonal articles<br/>[models.py]")]
end

subgraph group_shared["Shared services"]
  node_text["Persian text<br/>[text.py]"]
  node_phone["Phone formatting<br/>[phone.py]"]
  node_jalali["Jalali dates<br/>[jalali.py]"]
  node_image_fields["Image processing<br/>[fields.py]"]
  node_image_tools["Image transforms<br/>[images.py]"]
end

node_customer(("Customer"))
node_store(("Store staff"))
node_telegram{{"Telegram Bot API"}}

node_customer -->|"browses products"| node_catalog_views
node_catalog_views -->|"searches with"| node_product_search
node_product_search -->|"queries products"| node_catalog_data
node_customer -->|"submits request"| node_consult_views
node_consult_views -->|"checks limits"| node_rate_limit
node_consult_views -->|"validates with"| node_consult_forms
node_consult_forms -->|"validates request"| node_consult_data
node_consult_views -->|"saves request"| node_consult_data
node_consult_views -->|"notifies after save"| node_notifications
node_notifications -->|"sends message"| node_telegram
node_store -->|"reviews inbox"| node_consult_data
node_catalog_data -->|"normalizes text"| node_text
node_product_search -->|"normalizes query"| node_text
node_consult_data -->|"normalizes numbers"| node_phone
node_consult_forms -->|"uses crop choices"| node_catalog_data
node_notifications -->|"formats phone"| node_phone
node_notifications -->|"formats dates"| node_jalali
node_experts_faq -->|"defines photo fields"| node_image_fields
node_articles -.->|"defines image field"| node_image_fields
node_image_fields -->|"transforms uploads"| node_image_tools

click node_catalog_views "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/views.py"
click node_product_search "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/search.py"
click node_catalog_data "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/models.py"
click node_consult_views "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/views.py"
click node_consult_forms "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/forms.py"
click node_consult_data "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/models.py"
click node_notifications "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/notifications.py"
click node_rate_limit "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/ratelimit.py"
click node_experts_faq "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/pages/models.py"
click node_page_views "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/pages/views.py"
click node_articles "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/articles/models.py"
click node_text "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/text.py"
click node_phone "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/phone.py"
click node_jalali "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/jalali.py"
click node_image_fields "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/fields.py"
click node_image_tools "https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/images.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_views,node_product_search,node_catalog_data toneBlue
class node_consult_views,node_consult_forms,node_consult_data,node_notifications,node_rate_limit toneAmber
class node_experts_faq,node_page_views,node_articles,node_telegram toneMint
class node_text,node_phone,node_jalali,node_image_fields,node_image_tools toneRose
class node_customer,node_store toneIndigo
```

## Components

### Product catalog

- [Product pages](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/views.py): `apps/catalog/views.py`
- [Product search](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/search.py): `apps/catalog/search.py`
- [Catalog data](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/catalog/models.py): `apps/catalog/models.py`

### Consultations

- [Request handling](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/views.py): `apps/consultations/views.py`
- [Request forms](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/forms.py): `apps/consultations/forms.py`
- [Request inbox](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/models.py): `apps/consultations/models.py`
- [Telegram notices](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/notifications.py): `apps/consultations/notifications.py`
- [Submission limits](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/consultations/ratelimit.py): `apps/consultations/ratelimit.py`

### Site content

- [Experts and FAQ](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/pages/models.py): `apps/pages/models.py`
- [Static pages](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/pages/views.py): `apps/pages/views.py`
- [Seasonal articles](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/articles/models.py): `apps/articles/models.py`

### Shared services

- [Persian text](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/text.py): `apps/core/text.py`
- [Phone formatting](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/phone.py): `apps/core/phone.py`
- [Jalali dates](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/jalali.py): `apps/core/jalali.py`
- [Image processing](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/fields.py): `apps/core/fields.py`
- [Image transforms](https://github.com/therealmoeid/agricultural-pharmacy/blob/main/apps/core/images.py): `apps/core/images.py`

### Other components

- **Customer**
- **Store staff**
- **Telegram Bot API**

## Connections

- Customer → Product pages: browses products (evidence: `README.md`)
- Product pages → Product search: searches with (evidence: `apps/catalog/views.py`)
- Product search → Catalog data: queries products (evidence: `apps/catalog/search.py`)
- Customer → Request handling: submits request (evidence: `README.md`)
- Request handling → Submission limits: checks limits (evidence: `apps/consultations/views.py`)
- Request handling → Request forms: validates with (evidence: `apps/consultations/views.py`)
- Request forms → Request inbox: validates request (evidence: `apps/consultations/forms.py`)
- Request handling → Request inbox: saves request (evidence: `README.md`)
- Request handling → Telegram notices: notifies after save (evidence: `apps/consultations/views.py`)
- Telegram notices → Telegram Bot API: sends message (evidence: `apps/consultations/notifications.py`)
- Store staff → Request inbox: reviews inbox (evidence: `README.md`)
- Catalog data → Persian text: normalizes text (evidence: `apps/catalog/models.py`)
- Product search → Persian text: normalizes query (evidence: `apps/catalog/search.py`)
- Request inbox → Phone formatting: normalizes numbers (evidence: `apps/consultations/models.py`)
- Request forms → Catalog data: uses crop choices (evidence: `apps/consultations/forms.py`)
- Telegram notices → Phone formatting: formats phone (evidence: `apps/consultations/notifications.py`)
- Telegram notices → Jalali dates: formats dates (evidence: `apps/consultations/notifications.py`)
- Experts and FAQ → Image processing: defines photo fields (evidence: `apps/pages/models.py`)
- Seasonal articles → Image processing: defines image field (evidence: `apps/articles/models.py`)
- Image processing → Image transforms: transforms uploads (evidence: `apps/core/fields.py`)
