# hsynylmz-umhg/bedulonca architecture

> Architecture diagram of the GitHub repository hsynylmz-umhg/bedulonca, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hsynylmz-umhg/bedulonca
- Repository: https://github.com/hsynylmz-umhg/bedulonca

## Overview

Bedülonca is a Streamlit commerce intelligence platform for sellers. Its main workflow runs from the dashboard into a LangGraph analysis: trend discovery, web intelligence, competitor positioning, FIFO-based cost and margin checks, then Gemini-generated pricing or inventory recommendations returned for display. Separate product-detail and settings pages support SKU analysis and model configuration. The README documents additional dashboard analytics and UI capabilities. Some source is unsampled, so those documented features are shown at subsystem level; edges reflect only visible calls or documented relationships.

Main entry points: [`agents/market_news_agent.py`](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/market_news_agent.py) (Web intelligence), [`state.py`](https://github.com/hsynylmz-umhg/bedulonca/blob/main/state.py) (Shared agent state), [`main.py`](https://github.com/hsynylmz-umhg/bedulonca/blob/main/main.py) (BI dashboard), [`pages/product_detail.py`](https://github.com/hsynylmz-umhg/bedulonca/blob/main/pages/product_detail.py) (Product detail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Seller interface"]
  node_dashboard["BI dashboard<br/>[main.py]"]
  node_product_detail["Product detail<br/>[product_detail.py]"]
  node_settings["Model settings<br/>[settings.py]"]
end

subgraph group_orchestration["Analysis workflow"]
  node_agent_graph["Agent graph<br/>[agent_graph.py]"]
  node_agent_state["Shared agent state<br/>[state.py]"]
end

subgraph group_intelligence["Market intelligence"]
  node_trend_agent["Trend analysis<br/>[trend_agent.py]"]
  node_market_news["Web intelligence"]
  node_market_agent["Competitor pricing<br/>[market_agent.py]"]
end

subgraph group_economics["Cost and strategy"]
  node_cost_agent["FIFO cost analysis<br/>[cost_agent.py]"]
  node_strategist["Pricing strategist"]
  node_mock_data["Product and market data<br/>[mock_data.json]"]
end

node_seller(("E-commerce seller"))
node_search["DuckDuckGo search"]
node_gemini["Google Gemini"]
node_fx_api["USD/TRY rate API"]

node_seller -->|"opens"| node_dashboard
node_dashboard -->|"triggers analysis"| node_agent_graph
node_agent_graph -->|"dispatches"| node_trend_agent
node_trend_agent -->|"dispatches"| node_market_news
node_market_news -->|"dispatches"| node_market_agent
node_market_agent -->|"dispatches"| node_cost_agent
node_cost_agent -->|"dispatches"| node_strategist
node_trend_agent -->|"updates"| node_agent_state
node_market_news -->|"updates"| node_agent_state
node_market_agent -->|"reads"| node_mock_data
node_market_agent -->|"updates"| node_agent_state
node_cost_agent -->|"reads"| node_mock_data
node_cost_agent -->|"updates"| node_agent_state
node_strategist -->|"reads and updates"| node_agent_state
node_market_news -->|"searches"| node_search
node_market_news -->|"cleans results"| node_gemini
node_strategist -->|"generates decisions"| node_gemini
node_dashboard -->|"renders results"| node_agent_state
node_dashboard -.->|"reads"| node_mock_data
node_dashboard -->|"fetches exchange rate"| node_fx_api
node_seller -->|"opens SKU analysis"| node_product_detail
node_product_detail -.->|"loads product data"| node_mock_data
node_product_detail -->|"uses FIFO calculation"| node_cost_agent
node_product_detail -->|"fetches intelligence"| node_market_news
node_product_detail -->|"fetches exchange rate"| node_fx_api
node_seller -->|"configures model"| node_settings

click node_dashboard "https://github.com/hsynylmz-umhg/bedulonca/blob/main/main.py"
click node_product_detail "https://github.com/hsynylmz-umhg/bedulonca/blob/main/pages/product_detail.py"
click node_settings "https://github.com/hsynylmz-umhg/bedulonca/blob/main/pages/settings.py"
click node_agent_graph "https://github.com/hsynylmz-umhg/bedulonca/blob/main/agent_graph.py"
click node_agent_state "https://github.com/hsynylmz-umhg/bedulonca/blob/main/state.py"
click node_trend_agent "https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/trend_agent.py"
click node_market_news "https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/market_news_agent.py"
click node_market_agent "https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/market_agent.py"
click node_cost_agent "https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/cost_agent.py"
click node_strategist "https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/strategist_agent.py"
click node_mock_data "https://github.com/hsynylmz-umhg/bedulonca/blob/main/data/mock_data.json"

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_dashboard,node_product_detail,node_settings toneBlue
class node_agent_graph,node_agent_state toneAmber
class node_trend_agent,node_market_news,node_market_agent,node_fx_api toneMint
class node_cost_agent,node_strategist,node_mock_data toneRose
class node_seller,node_search,node_gemini toneIndigo
```

## Components

### Seller interface

- [BI dashboard](https://github.com/hsynylmz-umhg/bedulonca/blob/main/main.py): `main.py`
- [Product detail](https://github.com/hsynylmz-umhg/bedulonca/blob/main/pages/product_detail.py): `pages/product_detail.py`
- [Model settings](https://github.com/hsynylmz-umhg/bedulonca/blob/main/pages/settings.py): `pages/settings.py`

### Analysis workflow

- [Agent graph](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agent_graph.py): `agent_graph.py`
- [Shared agent state](https://github.com/hsynylmz-umhg/bedulonca/blob/main/state.py): `state.py`

### Market intelligence

- [Trend analysis](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/trend_agent.py): `agents/trend_agent.py`
- [Web intelligence](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/market_news_agent.py): `agents/market_news_agent.py`
- [Competitor pricing](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/market_agent.py): `agents/market_agent.py`

### Cost and strategy

- [FIFO cost analysis](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/cost_agent.py): `agents/cost_agent.py`
- [Pricing strategist](https://github.com/hsynylmz-umhg/bedulonca/blob/main/agents/strategist_agent.py): `agents/strategist_agent.py`
- [Product and market data](https://github.com/hsynylmz-umhg/bedulonca/blob/main/data/mock_data.json): `data/mock_data.json`

### Other components

- **E-commerce seller**
- **DuckDuckGo search**
- **Google Gemini**
- **USD/TRY rate API**

## Connections

- E-commerce seller → BI dashboard: opens (evidence: `README.md`)
- BI dashboard → Agent graph: triggers analysis (evidence: `README.md`)
- Agent graph → Trend analysis: dispatches (evidence: `agent_graph.py`)
- Trend analysis → Web intelligence: dispatches (evidence: `agent_graph.py`)
- Web intelligence → Competitor pricing: dispatches (evidence: `agent_graph.py`)
- Competitor pricing → FIFO cost analysis: dispatches (evidence: `agent_graph.py`)
- FIFO cost analysis → Pricing strategist: dispatches (evidence: `agent_graph.py`)
- Trend analysis → Shared agent state: updates (evidence: `agents/trend_agent.py`)
- Web intelligence → Shared agent state: updates (evidence: `agents/market_news_agent.py`)
- Competitor pricing → Product and market data: reads (evidence: `agents/market_agent.py`)
- Competitor pricing → Shared agent state: updates (evidence: `agents/market_agent.py`)
- FIFO cost analysis → Product and market data: reads (evidence: `agents/cost_agent.py`)
- FIFO cost analysis → Shared agent state: updates (evidence: `agents/cost_agent.py`)
- Pricing strategist → Shared agent state: reads and updates (evidence: `agents/strategist_agent.py`)
- Web intelligence → DuckDuckGo search: searches (evidence: `agents/market_news_agent.py`)
- Web intelligence → Google Gemini: cleans results (evidence: `agents/market_news_agent.py`)
- Pricing strategist → Google Gemini: generates decisions (evidence: `agents/strategist_agent.py`)
- BI dashboard → Shared agent state: renders results (evidence: `README.md`)
- BI dashboard → Product and market data: reads (evidence: `README.md`)
- BI dashboard → USD/TRY rate API: fetches exchange rate (evidence: `main.py`)
- E-commerce seller → Product detail: opens SKU analysis (evidence: `README.md`)
- Product detail → Product and market data: loads product data (evidence: `README.md`)
- Product detail → FIFO cost analysis: uses FIFO calculation (evidence: `pages/product_detail.py`)
- Product detail → Web intelligence: fetches intelligence (evidence: `pages/product_detail.py`)
- Product detail → USD/TRY rate API: fetches exchange rate (evidence: `pages/product_detail.py`)
- E-commerce seller → Model settings: configures model (evidence: `README.md`)
