# bhavishya41/price_drop architecture

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

- Interactive diagram: https://gitdiagram.com/bhavishya41/price_drop
- Repository: https://github.com/bhavishya41/price_drop

## Overview

This repository contains two standalone product-price monitors: one tracks a MCHOSE keyboard and the other a VXE mouse. Each script fetches product JSON, selects a variant using SKU and text fallbacks, compares its price with a local baseline, and sends a Telegram alert when the price falls. The scripts maintain separate state files and do not call one another. The workflow file is not mapped because its contents were not provided.

Main entry points: [`main.py`](https://github.com/bhavishya41/price_drop/blob/master/main.py) (Keyboard monitor), [`mouse.py`](https://github.com/bhavishya41/price_drop/blob/master/mouse.py) (Mouse monitor), [`last_price.txt`](https://github.com/bhavishya41/price_drop/blob/master/last_price.txt) (Keyboard baseline), [`last_price_mouse.txt`](https://github.com/bhavishya41/price_drop/blob/master/last_price_mouse.txt) (Mouse baseline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_monitors["Price monitors"]
  node_keyboard["Keyboard monitor<br/>[main.py]"]
  node_mouse["Mouse monitor<br/>[mouse.py]"]
end

subgraph group_state["Price state"]
  node_keyboard_state[("Keyboard baseline<br/>[last_price.txt]")]
  node_mouse_state[("Mouse baseline")]
end

subgraph group_integrations["External services"]
  node_genesispc["GenesisPC store"]
  node_telegram["Telegram API"]
end

node_keyboard -->|"fetches product"| node_genesispc
node_keyboard -->|"reads baseline"| node_keyboard_state
node_keyboard -->|"writes price"| node_keyboard_state
node_keyboard -->|"sends alert"| node_telegram
node_mouse -->|"fetches product"| node_genesispc
node_mouse -->|"reads baseline"| node_mouse_state
node_mouse -->|"writes price"| node_mouse_state
node_mouse -->|"sends alert"| node_telegram

click node_keyboard "https://github.com/bhavishya41/price_drop/blob/master/main.py"
click node_mouse "https://github.com/bhavishya41/price_drop/blob/master/mouse.py"
click node_keyboard_state "https://github.com/bhavishya41/price_drop/blob/master/last_price.txt"
click node_mouse_state "https://github.com/bhavishya41/price_drop/blob/master/last_price_mouse.txt"

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_keyboard,node_mouse toneBlue
class node_keyboard_state,node_mouse_state toneAmber
class node_genesispc,node_telegram toneMint
```

## Components

### Price monitors

- [Keyboard monitor](https://github.com/bhavishya41/price_drop/blob/master/main.py): `main.py`
- [Mouse monitor](https://github.com/bhavishya41/price_drop/blob/master/mouse.py): `mouse.py`

### Price state

- [Keyboard baseline](https://github.com/bhavishya41/price_drop/blob/master/last_price.txt): `last_price.txt`
- [Mouse baseline](https://github.com/bhavishya41/price_drop/blob/master/last_price_mouse.txt): `last_price_mouse.txt`

### External services

- **GenesisPC store**
- **Telegram API**

## Connections

- Keyboard monitor → GenesisPC store: fetches product (evidence: `main.py`)
- Keyboard monitor → Keyboard baseline: reads baseline (evidence: `main.py`)
- Keyboard monitor → Keyboard baseline: writes price (evidence: `main.py`)
- Keyboard monitor → Telegram API: sends alert (evidence: `main.py`)
- Mouse monitor → GenesisPC store: fetches product (evidence: `mouse.py`)
- Mouse monitor → Mouse baseline: reads baseline (evidence: `mouse.py`)
- Mouse monitor → Mouse baseline: writes price (evidence: `mouse.py`)
- Mouse monitor → Telegram API: sends alert (evidence: `mouse.py`)
