# sumaiya-akter-roshni/bazarwatch-bd architecture

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

- Interactive diagram: https://gitdiagram.com/sumaiya-akter-roshni/bazarwatch-bd
- Repository: https://github.com/sumaiya-akter-roshni/bazarwatch-bd

## Overview

BazarWatch BD is a Tkinter grocery-price monitoring and basket-planning app. The user enters or browses prices through the GUI; the manager validates and coordinates records, persistence, alerts, statistics, market comparisons, basket budgeting, and report generation. The central internal layer is the manager, which delegates calculations and file access. The README contains only the project title, so capabilities are drawn from sampled source and the source index; unsampled GUI actions and report-save wiring are not asserted.

Main entry points: [`BazarWatch/manager.py`](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/manager.py) (Bazar manager), [`BazarWatch/gui.py`](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/gui.py) (Tkinter interface), [`BazarWatch/file_handler.py`](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/file_handler.py) (File handling), [`BazarWatch/config.py`](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/config.py) (App configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["User interface"]
  node_app["App startup<br/>[main.py]"]
  node_gui["Tkinter interface<br/>[gui.py]"]
  node_theme["Visual theme<br/>[theme.py]"]
end

subgraph group_domain["Price domain"]
  node_validation["Input validation<br/>[validators.py]"]
  node_analytics["Price analytics<br/>[analytics.py]"]
  node_models["Products and records<br/>[models.py]"]
  node_config["App configuration<br/>[config.py]"]
end

subgraph group_services["Application services"]
  node_manager["Bazar manager<br/>[manager.py]"]
end

subgraph group_storage["Local data"]
  node_file_handler["File handling<br/>[file_handler.py]"]
  node_data_files[("Local price and basket files")]
  node_dataset_prep["WFP dataset preparation<br/>[prepare_dataset.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_gui
node_app -->|"starts"| node_gui
node_gui -->|"requests operations"| node_manager
node_gui -->|"uses styling"| node_theme
node_gui -->|"handles errors"| node_validation
node_manager -->|"validates input"| node_validation
node_manager -->|"delegates calculations"| node_analytics
node_manager -->|"loads and saves"| node_file_handler
node_manager -->|"creates records"| node_models
node_manager -->|"uses file settings"| node_config
node_file_handler -->|"reads and writes"| node_data_files
node_file_handler -->|"builds records"| node_models
node_file_handler -->|"uses CSV schema"| node_config
node_analytics -->|"uses thresholds"| node_config
node_models -->|"uses price limits"| node_config
node_dataset_prep -->|"produces dataset"| node_data_files

click node_app "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/main.py"
click node_gui "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/gui.py"
click node_theme "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/theme.py"
click node_manager "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/manager.py"
click node_validation "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/validators.py"
click node_analytics "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/analytics.py"
click node_models "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/models.py"
click node_config "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/config.py"
click node_file_handler "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/file_handler.py"
click node_data_files "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/tree/main/BazarWatch/data"
click node_dataset_prep "https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/prepare_dataset.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_app,node_gui,node_theme,node_user toneBlue
class node_validation,node_analytics,node_models,node_config toneAmber
class node_manager toneMint
class node_file_handler,node_data_files,node_dataset_prep toneRose
```

## Components

### User interface

- [App startup](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/main.py): `BazarWatch/main.py`
- [Tkinter interface](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/gui.py): `BazarWatch/gui.py`
- [Visual theme](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/theme.py): `BazarWatch/theme.py`

### Price domain

- [Input validation](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/validators.py): `BazarWatch/validators.py`
- [Price analytics](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/analytics.py): `BazarWatch/analytics.py`
- [Products and records](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/models.py): `BazarWatch/models.py`
- [App configuration](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/config.py): `BazarWatch/config.py`

### Application services

- [Bazar manager](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/manager.py): `BazarWatch/manager.py`

### Local data

- [File handling](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/file_handler.py): `BazarWatch/file_handler.py`
- [Local price and basket files](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/tree/main/BazarWatch/data): `BazarWatch/data`
- [WFP dataset preparation](https://github.com/sumaiya-akter-roshni/bazarwatch-bd/blob/main/BazarWatch/prepare_dataset.py): `BazarWatch/prepare_dataset.py`

### Other components

- **User**

## Connections

- User → Tkinter interface: uses (evidence: `BazarWatch/gui.py`)
- App startup → Tkinter interface: starts (evidence: `BazarWatch/main.py`)
- Tkinter interface → Bazar manager: requests operations (evidence: `BazarWatch/gui.py`)
- Tkinter interface → Visual theme: uses styling (evidence: `BazarWatch/gui.py`)
- Tkinter interface → Input validation: handles errors (evidence: `BazarWatch/gui.py`)
- Bazar manager → Input validation: validates input (evidence: `BazarWatch/manager.py`)
- Bazar manager → Price analytics: delegates calculations (evidence: `BazarWatch/manager.py`)
- Bazar manager → File handling: loads and saves (evidence: `BazarWatch/manager.py`)
- Bazar manager → Products and records: creates records (evidence: `BazarWatch/manager.py`)
- Bazar manager → App configuration: uses file settings (evidence: `BazarWatch/manager.py`)
- File handling → Local price and basket files: reads and writes (evidence: `BazarWatch/file_handler.py`)
- File handling → Products and records: builds records (evidence: `BazarWatch/file_handler.py`)
- File handling → App configuration: uses CSV schema (evidence: `BazarWatch/file_handler.py`)
- Price analytics → App configuration: uses thresholds (evidence: `BazarWatch/analytics.py`)
- Products and records → App configuration: uses price limits (evidence: `BazarWatch/models.py`)
- WFP dataset preparation → Local price and basket files: produces dataset (evidence: `BazarWatch/prepare_dataset.py`)
