# sumaiya-akter-roshni/shasroi_bazar architecture

> Architecture diagram of the GitHub repository sumaiya-akter-roshni/shasroi_bazar, 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/shasroi_bazar
- Repository: https://github.com/sumaiya-akter-roshni/shasroi_bazar

## Overview

Shasroi Bazar is a Tkinter desktop app for recording household food prices, evaluating alerts, comparing markets, and planning a budgeted basket. The principal flow is user input through the GUI and BazarManager, which validates and persists prices and obtains alert calculations; the GUI also presents records, statistics, reports, and basket plans. The graph preserves the documented dataset-preparation branch and the distinct persistence and domain-calculation layers. Some GUI and manager methods were only partially excerpted, so edges rely on the README where noted; no unsampled implementation details are assumed.

Main entry points: [`Shasroi_Bazar/manager.py`](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/manager.py) (BazarManager), [`Shasroi_Bazar/file_handler.py`](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/file_handler.py) (File handler), [`Shasroi_Bazar/gui.py`](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/gui.py) (BazarApp GUI), [`Shasroi_Bazar/prepare_dataset.py`](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/prepare_dataset.py) (WFP dataset preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_launcher["App launcher<br/>[main.py]"]
  node_interface["BazarApp GUI<br/>[gui.py]"]
  node_theme["Tkinter theme<br/>[theme.py]"]
end

subgraph group_domain["Price domain"]
  node_manager["BazarManager<br/>[manager.py]"]
  node_validators["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_storage["Data and reports"]
  node_filehandler["File handler<br/>[file_handler.py]"]
  node_datafiles[("Product, price, basket files")]
  node_reports["Text reports"]
end

subgraph group_dataset["Dataset preparation"]
  node_datasetprep["WFP dataset preparation<br/>[prepare_dataset.py]"]
  node_rawdata["Raw WFP price data"]
end

node_user(("Household user"))

node_user -->|"starts"| node_launcher
node_launcher -->|"launches"| node_interface
node_user -->|"uses"| node_interface
node_interface -->|"requests operations"| node_manager
node_theme -->|"styles"| node_interface
node_manager -->|"validates inputs"| node_validators
node_manager -->|"calculates results"| node_analytics
node_manager -->|"loads and saves"| node_filehandler
node_manager -->|"uses records"| node_models
node_manager -->|"uses settings"| node_config
node_filehandler -->|"builds records"| node_models
node_filehandler -->|"reads and writes"| node_datafiles
node_manager -->|"saves report"| node_reports
node_filehandler -->|"writes report"| node_reports
node_datasetprep -->|"reads prices"| node_rawdata
node_datasetprep -->|"creates price CSV"| node_datafiles

click node_launcher "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/main.py"
click node_interface "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/gui.py"
click node_theme "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/theme.py"
click node_manager "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/manager.py"
click node_validators "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/validators.py"
click node_analytics "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/analytics.py"
click node_models "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/models.py"
click node_config "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/config.py"
click node_filehandler "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/file_handler.py"
click node_datafiles "https://github.com/sumaiya-akter-roshni/shasroi_bazar/tree/main/Shasroi_Bazar/data"
click node_reports "https://github.com/sumaiya-akter-roshni/shasroi_bazar/tree/main/Shasroi_Bazar"
click node_datasetprep "https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/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_launcher,node_interface,node_theme,node_user toneBlue
class node_manager,node_validators,node_analytics,node_models,node_config toneAmber
class node_filehandler,node_datafiles,node_reports toneMint
class node_datasetprep,node_rawdata toneRose
```

## Components

### Desktop app

- [App launcher](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/main.py): `Shasroi_Bazar/main.py`
- [BazarApp GUI](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/gui.py): `Shasroi_Bazar/gui.py`
- [Tkinter theme](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/theme.py): `Shasroi_Bazar/theme.py`

### Price domain

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

### Data and reports

- [File handler](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/file_handler.py): `Shasroi_Bazar/file_handler.py`
- [Product, price, basket files](https://github.com/sumaiya-akter-roshni/shasroi_bazar/tree/main/Shasroi_Bazar/data): `Shasroi_Bazar/data`
- [Text reports](https://github.com/sumaiya-akter-roshni/shasroi_bazar/tree/main/Shasroi_Bazar): `Shasroi_Bazar`

### Dataset preparation

- [WFP dataset preparation](https://github.com/sumaiya-akter-roshni/shasroi_bazar/blob/main/Shasroi_Bazar/prepare_dataset.py): `Shasroi_Bazar/prepare_dataset.py`
- **Raw WFP price data**

### Other components

- **Household user**

## Connections

- Household user → App launcher: starts (evidence: `Shasroi_Bazar/main.py`)
- App launcher → BazarApp GUI: launches (evidence: `Shasroi_Bazar/main.py`)
- Household user → BazarApp GUI: uses (evidence: `README.md`)
- BazarApp GUI → BazarManager: requests operations (evidence: `README.md`)
- Tkinter theme → BazarApp GUI: styles (evidence: `Shasroi_Bazar/gui.py`)
- BazarManager → Input validation: validates inputs (evidence: `Shasroi_Bazar/manager.py`)
- BazarManager → Price analytics: calculates results (evidence: `Shasroi_Bazar/manager.py`)
- BazarManager → File handler: loads and saves (evidence: `Shasroi_Bazar/manager.py`)
- BazarManager → Products and records: uses records (evidence: `Shasroi_Bazar/manager.py`)
- BazarManager → App configuration: uses settings (evidence: `Shasroi_Bazar/manager.py`)
- File handler → Products and records: builds records (evidence: `Shasroi_Bazar/file_handler.py`)
- File handler → Product, price, basket files: reads and writes (evidence: `Shasroi_Bazar/file_handler.py`)
- BazarManager → Text reports: saves report (evidence: `Shasroi_Bazar/manager.py`)
- File handler → Text reports: writes report (evidence: `Shasroi_Bazar/file_handler.py`)
- WFP dataset preparation → Raw WFP price data: reads prices (evidence: `Shasroi_Bazar/prepare_dataset.py`)
- WFP dataset preparation → Product, price, basket files: creates price CSV (evidence: `Shasroi_Bazar/prepare_dataset.py`)
