# kalikibhuvanesh/pricewatch architecture

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

- Interactive diagram: https://gitdiagram.com/kalikibhuvanesh/pricewatch
- Repository: https://github.com/kalikibhuvanesh/pricewatch

## Overview

PriceWatch is an Amazon.in price-monitoring and market-intelligence application. Users search for products, track ASINs, monitor prices and sellers, and review trends, competition, location-specific Buy Box results, and alerts in a browser dashboard. The API routes requests to scraping, analytics, and watchlist operations; scheduled checks update MongoDB history and can send email alerts. The route, product, and analytics modules are present in the tree, but their source excerpts are incomplete or unavailable, so some internal wiring is left out.

Main entry points: [`src/index.js`](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/index.js) (Express server), [`src/routes/bearingSearch.js`](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/bearingSearch.js) (Bearing routes), [`src/jobs/priceChecker.js`](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/jobs/priceChecker.js) (Price checker), [`src/services/scraper.js`](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/scraper.js) (Amazon scraper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Dashboard"]
  node_frontend["Dashboard SPA<br/>[frontend.html]"]
end

subgraph group_api["API"]
  node_server["Express server<br/>[index.js]"]
  node_product_routes["Watchlist routes<br/>[products.js]"]
  node_search_routes["Product search<br/>[search.js]"]
  node_bearing_routes["Bearing routes<br/>[bearingSearch.js]"]
  node_analytics_routes["Analytics routes<br/>[analytics.js]"]
end

subgraph group_intelligence["Market intelligence"]
  node_scraper["Amazon scraper<br/>[scraper.js]"]
  node_location["Location Buy Box<br/>[locationScraper.js]"]
  node_competitive["Competitive analysis"]
end

subgraph group_monitoring["Price monitoring"]
  node_scheduler["Price checker<br/>[priceChecker.js]"]
  node_email["Alert email service<br/>[emailService.js]"]
end

subgraph group_state["Persistence and identity"]
  node_auth["JWT verification<br/>[auth.js]"]
  node_product[("Tracked products<br/>[Product.js]")]
  node_database_config["MongoDB connection<br/>[database.js]"]
end

node_user(("PriceWatch user"))
node_amazon(("Amazon.in"))
node_firebase(("Firebase Auth"))
node_smtp(("SMTP provider"))

node_user -->|"uses dashboard"| node_frontend
node_server -->|"serves"| node_frontend
node_frontend -->|"requests API"| node_server
node_server -->|"mounts routes"| node_product_routes
node_server -->|"mounts routes"| node_search_routes
node_server -->|"mounts routes"| node_bearing_routes
node_server -->|"mounts routes"| node_analytics_routes
node_server -->|"connects"| node_database_config
node_server -->|"starts checker"| node_scheduler
node_search_routes -->|"fetches search page"| node_scraper
node_scraper -->|"scrapes listings"| node_amazon
node_bearing_routes -->|"checks locations"| node_location
node_bearing_routes -->|"scrapes sellers"| node_scraper
node_bearing_routes -->|"reads trending history"| node_product
node_bearing_routes -->|"analyzes sellers"| node_competitive
node_analytics_routes -->|"analyzes prices"| node_competitive
node_analytics_routes -->|"reads tracked data"| node_product
node_product_routes -->|"verifies user"| node_auth
node_auth -->|"fetches signing keys"| node_firebase
node_scheduler -->|"loads and saves"| node_product
node_scheduler -->|"checks prices"| node_scraper
node_scheduler -->|"evaluates alerts"| node_competitive
node_scheduler -->|"sends triggered alerts"| node_email
node_email -->|"sends email"| node_smtp

click node_frontend "https://github.com/kalikibhuvanesh/pricewatch/blob/master/frontend.html"
click node_server "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/index.js"
click node_product_routes "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/products.js"
click node_search_routes "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/search.js"
click node_bearing_routes "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/bearingSearch.js"
click node_analytics_routes "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/analytics.js"
click node_auth "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/middleware/auth.js"
click node_scraper "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/scraper.js"
click node_location "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/locationScraper.js"
click node_competitive "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/competitiveAnalytics.js"
click node_scheduler "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/jobs/priceChecker.js"
click node_email "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/emailService.js"
click node_product "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/models/Product.js"
click node_database_config "https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/config/database.js"

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_frontend,node_user toneBlue
class node_server,node_product_routes,node_search_routes,node_bearing_routes,node_analytics_routes toneAmber
class node_scraper,node_location,node_competitive toneMint
class node_scheduler,node_email toneRose
class node_auth,node_product,node_database_config,node_amazon,node_firebase,node_smtp toneIndigo
```

## Components

### Dashboard

- [Dashboard SPA](https://github.com/kalikibhuvanesh/pricewatch/blob/master/frontend.html): `frontend.html`

### API

- [Express server](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/index.js): `src/index.js`
- [Watchlist routes](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/products.js): `src/routes/products.js`
- [Product search](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/search.js): `src/routes/search.js`
- [Bearing routes](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/bearingSearch.js): `src/routes/bearingSearch.js`
- [Analytics routes](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/routes/analytics.js): `src/routes/analytics.js`

### Market intelligence

- [Amazon scraper](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/scraper.js): `src/services/scraper.js`
- [Location Buy Box](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/locationScraper.js): `src/services/locationScraper.js`
- [Competitive analysis](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/competitiveAnalytics.js): `src/services/competitiveAnalytics.js`

### Price monitoring

- [Price checker](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/jobs/priceChecker.js): `src/jobs/priceChecker.js`
- [Alert email service](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/services/emailService.js): `src/services/emailService.js`

### Persistence and identity

- [JWT verification](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/middleware/auth.js): `src/middleware/auth.js`
- [Tracked products](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/models/Product.js): `src/models/Product.js`
- [MongoDB connection](https://github.com/kalikibhuvanesh/pricewatch/blob/master/src/config/database.js): `src/config/database.js`

### Other components

- **PriceWatch user**
- **Amazon.in**
- **Firebase Auth**
- **SMTP provider**

## Connections

- PriceWatch user → Dashboard SPA: uses dashboard
- Express server → Dashboard SPA: serves
- Dashboard SPA → Express server: requests API
- Express server → Watchlist routes: mounts routes
- Express server → Product search: mounts routes
- Express server → Bearing routes: mounts routes
- Express server → Analytics routes: mounts routes
- Express server → MongoDB connection: connects
- Express server → Price checker: starts checker
- Product search → Amazon scraper: fetches search page
- Amazon scraper → Amazon.in: scrapes listings
- Bearing routes → Location Buy Box: checks locations
- Bearing routes → Amazon scraper: scrapes sellers
- Bearing routes → Tracked products: reads trending history
- Bearing routes → Competitive analysis: analyzes sellers
- Analytics routes → Competitive analysis: analyzes prices
- Analytics routes → Tracked products: reads tracked data
- Watchlist routes → JWT verification: verifies user
- JWT verification → Firebase Auth: fetches signing keys
- Price checker → Tracked products: loads and saves
- Price checker → Amazon scraper: checks prices
- Price checker → Competitive analysis: evaluates alerts
- Price checker → Alert email service: sends triggered alerts
- Alert email service → SMTP provider: sends email
