# roodrigoreyes/bazarhistorias-cli architecture

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

- Interactive diagram: https://gitdiagram.com/roodrigoreyes/bazarhistorias-cli
- Repository: https://github.com/roodrigoreyes/bazarhistorias-cli

## Overview

Bazar Historias CLI is a read-only terminal client. Users invoke search or account commands; the CLI dispatches to the site client, then renders results as terminal tables or JSON. The client covers catalog search, authentication, and account data such as orders, spending, BazarCoins, addresses, and wishlist. README capabilities fill in domain details where client excerpts are incomplete; those relationships are cited to the README rather than treated as inspected source.

Main entry points: [`bazar/cli.py`](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/cli.py) (Command dispatcher), [`bazar/client.py`](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py) (Catalog search), [`bazar/output.py`](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/output.py) (Result rendering), [`bazar/credentials.py`](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/credentials.py) (Credential loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["CLI and output"]
  node_cli["Command dispatcher<br/>[cli.py]"]
  node_render["Result rendering<br/>[output.py]"]
end

subgraph group_catalog["Catalog search"]
  node_search["Catalog search<br/>[client.py]"]
  node_product["Product details / SKU<br/>[client.py]"]
end

subgraph group_account["Account services"]
  node_login["Login and session<br/>[client.py]"]
  node_account_overview["Account overview<br/>[client.py]"]
  node_orders["Order listing<br/>[client.py]"]
  node_spend["Monthly spending<br/>[client.py]"]
  node_order_details["Order details<br/>[client.py]"]
  node_coins["BazarCoins<br/>[client.py]"]
  node_addresses["Saved addresses<br/>[client.py]"]
  node_wishlist["Wishlist<br/>[client.py]"]
end

subgraph group_support["Session and labels"]
  node_credentials["Credential loading<br/>[credentials.py]"]
  node_status_labels["Status translations<br/>[status.py]"]
end

node_user(("Terminal user"))
node_site["Bazar Historias"]
node_session_file[("Local cookie file")]

node_user -->|"invokes"| node_cli
node_cli -->|"dispatches search"| node_search
node_cli -->|"dispatches auth"| node_login
node_cli -->|"dispatches account"| node_account_overview
node_cli -->|"dispatches orders"| node_orders
node_cli -->|"dispatches spend"| node_spend
node_cli -->|"dispatches details"| node_order_details
node_cli -->|"dispatches coins"| node_coins
node_cli -->|"dispatches addresses"| node_addresses
node_cli -->|"dispatches wishlist"| node_wishlist
node_cli -->|"renders result"| node_render
node_search -->|"fetches SKU"| node_product
node_search -->|"queries catalog"| node_site
node_login -->|"authenticates"| node_site
node_account_overview -->|"reads account"| node_site
node_orders -->|"reads orders"| node_site
node_spend -->|"reads order history"| node_site
node_order_details -->|"reads order"| node_site
node_coins -->|"reads balance"| node_site
node_addresses -->|"reads addresses"| node_site
node_wishlist -->|"reads wishlist"| node_site
node_login -->|"loads cookies"| node_credentials
node_credentials -->|"reads and writes"| node_session_file
node_orders -->|"maps statuses"| node_status_labels
node_render -->|"translates labels"| node_status_labels

click node_cli "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/cli.py"
click node_render "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/output.py"
click node_search "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_product "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_login "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_account_overview "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_orders "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_spend "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_order_details "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_coins "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_addresses "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_wishlist "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py"
click node_credentials "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/credentials.py"
click node_status_labels "https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/status.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_cli,node_render,node_user toneBlue
class node_search,node_product,node_session_file toneAmber
class node_login,node_account_overview,node_orders,node_spend,node_order_details,node_coins,node_addresses,node_wishlist toneMint
class node_credentials,node_status_labels toneRose
class node_site toneIndigo
```

## Components

### CLI and output

- [Command dispatcher](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/cli.py): `bazar/cli.py`
- [Result rendering](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/output.py): `bazar/output.py`

### Catalog search

- [Catalog search](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Product details / SKU](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`

### Account services

- [Login and session](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Account overview](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Order listing](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Monthly spending](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Order details](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [BazarCoins](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Saved addresses](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`
- [Wishlist](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/client.py): `bazar/client.py`

### Session and labels

- [Credential loading](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/credentials.py): `bazar/credentials.py`
- [Status translations](https://github.com/roodrigoreyes/bazarhistorias-cli/blob/main/bazar/status.py): `bazar/status.py`

### Other components

- **Terminal user**
- **Bazar Historias**
- **Local cookie file**

## Connections

- Terminal user → Command dispatcher: invokes (evidence: `bazar/cli.py`)
- Command dispatcher → Catalog search: dispatches search (evidence: `bazar/cli.py`)
- Command dispatcher → Login and session: dispatches auth (evidence: `bazar/cli.py`)
- Command dispatcher → Account overview: dispatches account (evidence: `bazar/cli.py`)
- Command dispatcher → Order listing: dispatches orders (evidence: `bazar/cli.py`)
- Command dispatcher → Monthly spending: dispatches spend (evidence: `bazar/cli.py`)
- Command dispatcher → Order details: dispatches details (evidence: `bazar/cli.py`)
- Command dispatcher → BazarCoins: dispatches coins (evidence: `bazar/cli.py`)
- Command dispatcher → Saved addresses: dispatches addresses (evidence: `bazar/cli.py`)
- Command dispatcher → Wishlist: dispatches wishlist (evidence: `bazar/cli.py`)
- Command dispatcher → Result rendering: renders result (evidence: `bazar/cli.py`)
- Catalog search → Product details / SKU: fetches SKU (evidence: `README.md`)
- Catalog search → Bazar Historias: queries catalog (evidence: `README.md`)
- Login and session → Bazar Historias: authenticates (evidence: `bazar/client.py`)
- Account overview → Bazar Historias: reads account (evidence: `README.md`)
- Order listing → Bazar Historias: reads orders (evidence: `README.md`)
- Monthly spending → Bazar Historias: reads order history (evidence: `bazar/client.py`)
- Order details → Bazar Historias: reads order (evidence: `bazar/client.py`)
- BazarCoins → Bazar Historias: reads balance (evidence: `bazar/client.py`)
- Saved addresses → Bazar Historias: reads addresses (evidence: `bazar/client.py`)
- Wishlist → Bazar Historias: reads wishlist (evidence: `README.md`)
- Login and session → Credential loading: loads cookies (evidence: `bazar/client.py`)
- Credential loading → Local cookie file: reads and writes (evidence: `README.md`)
- Order listing → Status translations: maps statuses (evidence: `bazar/client.py`)
- Result rendering → Status translations: translates labels (evidence: `bazar/output.py`)
