# pranav-kuppachi/automated-price-tracking-alert-system architecture

> Architecture diagram of the GitHub repository pranav-kuppachi/automated-price-tracking-alert-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pranav-kuppachi/automated-price-tracking-alert-system
- Repository: https://github.com/pranav-kuppachi/automated-price-tracking-alert-system

## Overview

Web-Watcher is a single-file Flask price-monitoring application. A user submits product details through its web interface; the application stores a watchlist entry, while a background watcher periodically fetches prices, compares them with targets, and sends alerts when conditions are met. The README documents this workflow and the MySQL, scraping, scheduling, and notification capabilities. Source excerpts show database operations, price-fetching code, and watcher startup; omitted portions limit certainty about some handler and comparison details.

Main entry points: [`main.py`](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py) (Background watcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Web interface"]
  node_web_ui["Watchlist form<br/>[main.py]"]
  node_flask_app["Flask application<br/>[main.py]"]
  node_add_product["Add product<br/>[main.py]"]
end

subgraph group_monitoring["Price monitoring"]
  node_watcher["Background watcher<br/>[main.py]"]
  node_price_fetch["Price fetcher<br/>[main.py]"]
  node_price_parse["Store price parsing<br/>[main.py]"]
  node_price_compare["Target comparison<br/>[main.py]"]
end

subgraph group_persistence["Data storage"]
  node_db_connection["MySQL connection<br/>[main.py]"]
  node_watchlist[("Watchlist records<br/>[main.py]")]
  node_price_logs[("Price history<br/>[main.py]")]
end

subgraph group_integrations["External services"]
  node_scraper_api{{"ScraperAPI"}}
  node_email_service{{"SendGrid email"}}
end

node_user(("Product watcher"))

node_user -->|"submits details"| node_web_ui
node_web_ui -->|"posts product"| node_flask_app
node_flask_app -->|"handles request"| node_add_product
node_add_product -->|"opens connection"| node_db_connection
node_db_connection -->|"writes entry"| node_watchlist
node_watcher -->|"opens connection"| node_db_connection
node_db_connection -->|"reads entries"| node_watchlist
node_watcher -->|"fetches price"| node_price_fetch
node_price_fetch -->|"requests page"| node_scraper_api
node_price_fetch -->|"parses response"| node_price_parse
node_watcher -->|"checks target"| node_price_compare
node_watcher -->|"sends alert"| node_email_service
node_watcher -.->|"logs price"| node_db_connection
node_db_connection -->|"stores price"| node_price_logs
node_flask_app -->|"starts thread"| node_watcher

click node_web_ui "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_flask_app "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_add_product "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_watcher "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_price_fetch "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_price_parse "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_price_compare "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_db_connection "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_watchlist "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py"
click node_price_logs "https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.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_web_ui,node_flask_app,node_add_product toneBlue
class node_watcher,node_price_fetch,node_price_parse,node_price_compare toneAmber
class node_db_connection,node_watchlist,node_price_logs toneMint
class node_scraper_api,node_email_service toneRose
class node_user toneIndigo
```

## Components

### Web interface

- [Watchlist form](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Flask application](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Add product](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`

### Price monitoring

- [Background watcher](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Price fetcher](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Store price parsing](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Target comparison](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`

### Data storage

- [MySQL connection](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Watchlist records](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`
- [Price history](https://github.com/pranav-kuppachi/automated-price-tracking-alert-system/blob/main/main.py): `main.py`

### External services

- **ScraperAPI**
- **SendGrid email**

### Other components

- **Product watcher**

## Connections

- Product watcher → Watchlist form: submits details (evidence: `README.md`)
- Watchlist form → Flask application: posts product (evidence: `main.py`)
- Flask application → Add product: handles request (evidence: `README.md`)
- Add product → MySQL connection: opens connection (evidence: `main.py`)
- MySQL connection → Watchlist records: writes entry (evidence: `main.py`)
- Background watcher → MySQL connection: opens connection (evidence: `main.py`)
- MySQL connection → Watchlist records: reads entries (evidence: `main.py`)
- Background watcher → Price fetcher: fetches price (evidence: `main.py`)
- Price fetcher → ScraperAPI: requests page (evidence: `main.py`)
- Price fetcher → Store price parsing: parses response (evidence: `main.py`)
- Background watcher → Target comparison: checks target (evidence: `README.md`)
- Background watcher → SendGrid email: sends alert (evidence: `main.py`)
- Background watcher → MySQL connection: logs price (evidence: `main.py`)
- MySQL connection → Price history: stores price (evidence: `main.py`)
- Flask application → Background watcher: starts thread (evidence: `main.py`)
