PriceWatch is a production-grade e-commerce intelligence platform that empowers users to make smarter purchasing decisions. It combines real-time price tracking, cross-platform product comparison, and AI-powered sentiment analysis into a seamless Chrome extension experience, monitoring prices across Amazon, Flipkart, and Reliance Digital with automated multi-channel notifications (email + WhatsApp).
- Smart Price Monitoring: Track any product from supported e-commerce platforms with custom target price alerts
- Intelligent Notifications: Receive alerts via email or WhatsApp the moment your target price is reached
- Dynamic Scheduling: Adaptive price checks (45s for active tabs, 5 minutes in background, 2 minutes when near target)
- Failure Resilience: Automatic retry logic with exponential backoff; tracks failure history
- Multi-Site Comparison: Compare prices across Amazon, Flipkart, and Reliance Digital instantly
- Fuzzy Product Matching: TF-IDF similarity algorithm ensures accurate product matching across platforms
- Real-Time Availability: Check stock status across all platforms in one view
- Review Summarization: BART-powered summaries (5-6 lines) synthesizing key review themes
- Sentiment Analysis: Dual-model analysis (DistilBERT + RoBERTa) with 0-100 sentiment score and multi-class distribution
- Dynamic Pros/Cons Extraction: KeyBERT semantic extraction pinpoints advantages and disadvantages from customer feedback
- Multi-Language Support: Processes English and transliterated text; filters spam automatically
- Google OAuth Integration: One-click login with automatic profile sync
- WhatsApp Verification: OTP-based secure WhatsApp number registration (5-min expiry, SHA256 hashed)
- Multi-Channel Alerts: Per-user notification preferences with repeat alert controls
- Watchlist Management: Add, edit, delete, and test alerts for tracked products
Smart price monitoring on Amazon products with real-time alerts
AI-powered sentiment analysis with distribution metrics
Dynamic extraction of product advantages and disadvantages from reviews
Compare prices across multiple e-commerce platforms side-by-side
PriceWatch is built as a distributed system with three independent services:
- Tech Stack: React 19 + Vite 7 + Vanilla CSS + Chrome MV3
- Responsibilities:
- Context-aware product detection on supported e-commerce sites
- On-page price & review extraction via content scripts
- Real-time popup UI with watchlist management
- Background service worker for interval-based price checks and notifications
- Entrypoints:
popup.htmlβ React popup UIsrc/background/index.jsβ Background service worker (Chrome MV3)src/content/index.jsβ Content script (runs on product pages)
- Tech Stack: Node.js + Express 5.2.1 + MongoDB (Mongoose 9.1.5)
- Responsibilities:
- User authentication & profile management (Google OAuth)
- Persistent storage of price alerts (MongoDB)
- Price checking orchestration via cron jobs (every 5 minutes)
- Email notifications via Nodemailer
- WhatsApp notifications via Baileys
- Cross-platform product comparison & search
- Review extraction and caching
- Orchestration of Python NLP analysis
- API Prefix: All routes under
/api/ - Port: 8000
- Tech Stack: FastAPI 0.115.6 + Uvicorn + HuggingFace Transformers
- Responsibilities:
- Review preprocessing (HTML stripping, emoji conversion, deduplication, spam filtering)
- BART-powered summarization of reviews
- Dual-model sentiment analysis (DistilBERT + RoBERTa with confidence arbitration)
- KeyBERT semantic keyphrase extraction
- Fallback frequency-based pros/cons generation
- Port: 5001
PriceWatch/
βββ extension/ # Chrome Extension (MV3)
β βββ public/
β β βββ manifest.json # Extension permissions, OAuth config
β βββ src/
β β βββ App.jsx # Popup root component
β β βββ index.css # Global popup styles
β β βββ main.jsx # React entry point
β β βββ background/
β β β βββ index.js # Service worker, tab monitoring, alarms
β β β βββ notificationService.js # Desktop notifications
β β βββ content/
β β β βββ index.js # Content script message handlers
β β β βββ productScraper.js # Platform-agnostic extraction
β β β βββ reviewExtractor.js # Review pagination controller
β β β βββ scrapers/ # Platform-specific scrapers
β β β β βββ amazonScraper.js
β β β β βββ flipkartScraper.js
β β β β βββ relianceDigitalScraper.js
β β β βββ selectors/ # CSS selectors per platform
β β β β βββ amazonSelectors.js
β β β β βββ flipkartSelectors.js
β β β β βββ relianceSelectors.js
β β β βββ utils/ # Helpers (price parsing, availability)
β β βββ popup/
β β βββ components/ # React components (15+ UI modules)
β β β βββ Header.jsx, FeatureGrid.jsx, ProductCard.jsx
β β β βββ PriceTracker.jsx, Watchlist.jsx
β β β βββ ReviewSummaryTable.jsx, SentimentChart.jsx
β β β βββ PriceComparisonTable.jsx
β β β βββ WhatsAppSettings.jsx, ErrorState.jsx
β β β βββ LoadingState.jsx, Footer.jsx
β β βββ hooks/ # Custom React hooks
β βββ vite.config.js # Build: React popup + content + bg scripts
β βββ eslint.config.js
β βββ package.json
β
βββ backend/ # Express REST API
β βββ server.js # Express app setup, middleware, scheduler
β βββ package.json # Dependencies (Express, Mongoose, etc.)
β βββ config/
β β βββ constants.js # Price check interval, timeouts, thresholds
β β βββ database.js # MongoDB connection via Mongoose
β β βββ email.js # Nodemailer SMTP config
β β βββ (others)
β βββ routes/
β β βββ index.js # Route aggregator (/api/auth, /api/tracker, etc.)
β β βββ authRoutes.js # OAuth, OTP, WhatsApp verification
β β βββ trackingRoutes.js # Price alert CRUD + manual checks
β β βββ reviewRoutes.js # Review analysis orchestration
β β βββ comparisonRoutes.js # Multi-site product comparison
β β βββ whatsappRoutes.js # WhatsApp QR, connection, messaging
β βββ controllers/
β β βββ authController.js # HTTP handlers for auth routes
β β βββ trackingController.js # HTTP handlers for tracking routes
β βββ models/
β β βββ User.js # User schema (OAuth, WhatsApp, OTP fields)
β β βββ Tracking.js # Price alert schema with indexes
β β βββ userModel.js # (legacy/alternate)
β βββ services/
β β βββ authService.js # Google token validation, user upsert
β β βββ otpService.js # OTP generation, verification, cooldown
β β βββ trackingService.js # Price check execution, notifications
β β βββ priceComparisonService.js # Multi-site search + TF-IDF matching
β β βββ reviewOrchestrator.js # Pipeline coordinator (validation β AI β cache)
β β βββ reviewExtractionService.js # Smart review filtering
β β βββ reviewScrapingService.js # Server-side pagination (Amazon/Flipkart)
β β βββ pythonNlpClient.js # HTTP bridge to Python service (circuit breaker)
β β βββ emailService.js # Alert formatting + Nodemailer send
β β βββ whatsappService.js # Baileys connection, message queue
β β βββ notificationService.js # Unified email + WhatsApp notifier
β β βββ scrapingService.js # Generic HTML scraping with retry
β β βββ productMatcher.js # (helper functions)
β β βββ scrapers/
β β βββ amazonSearchScraper.js # Search + product extraction
β β βββ flipkartSearchScraper.js # Search + product extraction
β β βββ relianceSearchScraper.js # Search + product extraction
β βββ middlewares/
β β βββ errorHandler.js # Centralized error handling
β βββ jobs/
β β βββ priceMonitor.js # Cron job logic (every 5 minutes)
β β βββ scheduler.js # node-cron scheduler orchestration
β βββ utils/
β β βββ browserPool.js # Puppeteer connection pooling
β β βββ cacheService.js # In-memory cache (analysis results)
β β βββ priceExtractor.js # Price parsing utilities
β β βββ responseHelper.js # Standard response formatting
β β βββ sanitizer.js # Input validation/sanitization
β β βββ textCleaner.js # Text preprocessing
β β βββ timeoutGuard.js # Timeout enforcement helpers
β βββ validators/
β β βββ trackingValidator.js # Schema validation for tracking requests
β βββ debug-scrapers.js # Development scraper test utility
β βββ migrate-db.js # Database migration script
β βββ unit-tests.js # Test suite
β βββ test-*.js # Individual service tests (email, whatsapp, smtp)
β
βββ ai-service/ # Python FastAPI NLP Service
β βββ app.py # FastAPI app, /health, /analyze endpoints
β βββ preprocessing.py # Review cleaning, deduplication, spam filter
β βββ keyphrase.py # KeyBERT extraction + fallback frequency
β βββ sentiment-analysis.py # (Reference script for validation)
β βββ review-summary.py # (Reference script for validation)
β βββ requirements.txt # Dependencies
β βββ __pycache__/ # Compiled Python modules
β
βββ package.json # Root package config
βββ README.md # This comprehensive guide
βββ PROJECT_REPORT_DOCUMENTATION.txt # Technical specifications document
- Node.js 18+ with npm
- Python 3.9+ with pip
- MongoDB Atlas account (free tier available)
- Google OAuth credentials (for Chrome extension)
- SMTP email provider (Gmail, SendGrid, etc.)
- Chrome/Chromium browser
cd backend
npm installConfigure .env file in backend/ directory:
# Database
MONGODB_URI=mongodb+srv://<user>:<password>@<cluster>/<database>
# Email Notifications (Nodemailer)
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-specific-password
# Python AI Service
PYTHON_SERVICE_URL=http://localhost:5001
PYTHON_TIMEOUT_MS=300000
# WhatsApp (optional, set to false to disable)
WHATSAPP_ENABLED=true
# Server Port (default 8000)
PORT=8000Start the backend:
npm start
# Server runs on http://localhost:8000
# Automatic price checks start immediately (cron: every 5 minutes)What happens:
- Connects to MongoDB
- Initializes the scheduler
- Sets up route handlers
- Main service runs on port 8000
- Price monitor job starts (non-blocking)
cd ai-service
pip install -r requirements.txtLaunch the service:
python -m uvicorn app:app --host 0.0.0.0 --port 5001
# Service runs on http://localhost:5001
# Models auto-load on startup (~30-60 seconds)What happens:
- DistilBERT, RoBERTa, BART, All-MiniLM-L6-v2 models download on first run (~3-5 GB)
- Service becomes ready after all models load
- Exposes
/healthand/analyzeendpoints
cd extension
npm install
npm run build
# Output: extension/dist/ (ready to load)Load into Chrome:
- Open
chrome://extensions/ - Enable Developer mode (toggle top-right)
- Click "Load unpacked"
- Select the
extension/dist/folder - Extension appears in your toolbar
Start building locally (recommended for development):
npm run watch
# Vite watches src/ for changes
# Auto-rebuilds dist/ on every save (~2 seconds)
# Refresh extension in Chrome after each rebuildAll endpoints require valid Google OAuth tokens in the Authorization: Bearer <token> header.
POST /api/auth/google
Body: { token: "google_id_token" }
Response: { success, user: { email, name, picture }, token }
POST /api/auth/whatsapp/send-otp
Body: { email, phoneNumber }
Response: { success, expirySeconds: 300 }
POST /api/auth/whatsapp/verify-otp
Body: { email, otp }
Response: { success, verified: true }
POST /api/auth/whatsapp/toggle
Body: { email, enabled: true }
Response: { success, whatsappNotificationsEnabled }
GET /api/auth/whatsapp/status/:email
Response: { verified: true, number, notificationsEnabled }
POST /api/tracker/add
Body: { email, productName, currentPrice, targetPrice, url,
platform, image, currency }
Response: { success, trackingId, message }
GET /api/tracker/list/:email
Response: { success, alerts: [...], count: 5 }
GET /api/tracker/check/:email/:url
Response: { success, isTracked: true, tracking: {...} }
DELETE /api/tracker/delete/:id
Response: { success, deletedId }
DELETE /api/tracker/remove/:email/:url
Response: { success }
POST /api/tracker/check-now/:id
Response: { success, checkResult: {...} }
POST /api/tracker/test-email/:id
Response: { success, emailSent: true }
POST /api/tracker/test-whatsapp/:id
Response: { success, messageSent: true }
POST /api/reviews/analyze-direct
Body: { reviews: [{text, rating, author?, title?}],
platform, productId }
Response: { success, summary, sentimentScore,
sentimentDistribution, pros, cons,
processingMs }
POST /api/reviews/invalidate-cache
Body: { platform, productId }
Response: { success, cacheCleared }
GET /api/reviews/health
Response: { nodeStatus, pythonStatus, circuitBreakerState }
POST /api/comparison/compare
Body: { productName, referencePrice? }
Response: { success, results: [{platform, name, price, url,
availability}], bestPrice }
GET /api/whatsapp/status
Response: { connected: true, authenticated: false }
POST /api/whatsapp/initialize
Response: { success, qrCode: "..." }
GET /api/whatsapp/qr
Response: { qrCode: "data:image/png;base64,..." }
POST /api/whatsapp/disconnect
Response: { success, disconnected: true }
POST /api/whatsapp/clear-session
Response: { success }
POST /api/whatsapp/test-message
Body: { number, message }
Response: { success, messageSent }
{
_id: ObjectId,
email: String, // Unique, from Google OAuth
googleId: String,
name: String,
picture: String,
whatsappNumber: String, // E.164 format: +919876543210
whatsappVerified: Boolean,
whatsappNotificationsEnabled: Boolean,
whatsappOtp: String, // SHA256 hash
whatsappOtpExpiry: Date, // 5-minute window
whatsappOtpAttempts: Number, // Max 5
whatsappPendingNumber: String, // Staged during re-verification
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
userEmail: String, // Indexed
productName: String,
currentPrice: Number,
previousPrice: Number,
targetPrice: Number,
url: String,
platform: String, // "amazon" | "flipkart" | "reliance_digital"
image: String, // Product image URL
currency: String, // "INR", "USD", etc.
isActive: Boolean,
lastChecked: Date,
notified: Boolean,
notifiedAt: Date,
lastNotificationChannels: {
email: Date,
whatsapp: Date
},
repeatAlerts: Boolean, // Send alert multiple times
failureCount: Number,
lastError: String,
createdAt: Date,
updatedAt: Date,
// Indexes:
// { userEmail, url } - Unique compound
// { userEmail }
}Terminal 1 - Backend:
cd backend
npm start
# Logs start with [Backend], [Cron], [Scheduler] tagsTerminal 2 - AI Service:
cd ai-service
python -m uvicorn app:app --reload --host 0.0.0.0 --port 5001
# Auto-reloads on file changesTerminal 3 - Extension (Watch Mode):
cd extension
npm run watch
# Auto-rebuilds on src/ changes
# Refresh extension in chrome://extensions/ after rebuild| Location | Change Required | Test Steps |
|---|---|---|
backend/services/*.js |
Restart backend | Restart terminal 1, test API |
backend/jobs/priceMonitor.js |
Restart backend | Trigger /api/tracker/check-now/:id |
ai-service/*.py |
Auto-reload | Wait for uvicorn reload message |
extension/src/popup/**/*.jsx |
Rebuild + refresh | npm run watch auto-rebuilds, refresh popup in Chrome |
extension/src/content//*.js |
Rebuild + page refresh | npm run watch auto-rebuilds, refresh e-commerce page |
extension/src/background/index.js |
Rebuild + reload | npm run watch auto-rebuilds, reload extension in chrome://extensions/ |
CSS (*.css) |
Rebuild + refresh | Auto-rebuilds, refresh UI |
Popup UI:
- Right-click popup β "Inspect" β DevTools for React debugging
Background Service Worker:
chrome://extensions/β PriceWatch β "Background page" link
Content Script:
- Right-click product page β "Inspect" β "Console" tab (shows content script logs)
API Requests:
- Popup DevTools β "Network" tab β filter for API calls to
localhost:8000
PRICE_CHECK_INTERVAL: '*/5 * * * *' // Cron: Every 5 min
SCRAPE_TIMEOUT: 10000 // 10 seconds per request
NEAR_TARGET_THRESHOLD: 0.10 // 10% above target
INTERVAL_ACTIVE_TAB: 45/60 // 45 sec (active tab)
INTERVAL_BACKGROUND: 5 // 5 min (background)
INTERVAL_NEAR_TARGET: 2 // 2 min (price near target)
WHATSAPP_OTP_EXPIRY_MS: 5*60*1000 // 5 minutes
WHATSAPP_MESSAGE_RATE_LIMIT_MS: 2000 // 2 sec between messagesMAX_REVIEWS = 2000 # Input limit
MAX_REVIEW_CHARS = 5000 # Per-review limit
ROBERTA_CONFIDENCE_THRESHOLD = 0.65 # Use RoBERTa if uncertain
SENTIMENT_BATCH_SIZE = 32 # CPU batch size
BART_MAX_TOTAL_CHARS = 24_000 # Summary input limit
REQUEST_TIMEOUT_SECS = 300 # 5 minute timeout- Domains: .com, .in, .co.uk, .de, .ca
- Features: β Product extraction, β Price scraping, β Review pagination, β Availability check, β Cross-site search
- Domains: .com, .in
- Features: β Product extraction, β Price scraping, β Review pagination, β Availability check, β Cross-site search
- Domains: .in
- Features: β Product extraction, β Price scraping, β Review extraction, β Cross-site search
- OTP Storage: SHA256 hashed with 5-minute expiry
- OAuth: Token introspected with Google userinfo endpoint
- Database: MongoDB Atlas with connection string from environment
- Secrets: All credentials in
.env(never committed to git) - WhatsApp Rate Limiting: 2-second gap between messages to prevent bans
| Layer | Technology | Version |
|---|---|---|
| Extension | React + Vite | 19 + 7 |
| Extension Build | Chrome MV3 | Latest |
| Backend | Express.js | 5.2.1 |
| Database | MongoDB + Mongoose | Latest + 9.1.5 |
| Python AI | FastAPI + Uvicorn | 0.115.6 + 0.32.1 |
| NLP Models | HuggingFace Transformers | 4.47.1 |
| Notifications | Nodemailer + Baileys | 7.0.13 + 7.0.0-rc.9 |
| Scheduling | node-cron | 4.2.1 |
| HTTP Client | Axios | 1.13.4 |
| DOM Parsing | Cheerio | 1.2.0 |
| Scraping | Puppeteer | 24.37.5 |
- Clear browser cache:
chrome://settings/clearBrowserData - Rebuild extension:
npm run build - Re-load unpacked in chrome://extensions/
- Verify AI service is running on port 5001
- Check firewall:
curl http://localhost:5001/health - Check dependencies:
pip list | grep -E "torch|transformers"
- Verify MongoDB connection: Check backend logs for connection errors
- Check cron job: Manually trigger
/api/tracker/check-now/:id - Verify WhatsApp/Email config: Test endpoints
/api/tracker/test-email/:id
- Check circuit breaker state:
/api/reviews/health - Verify Python service is accessible:
curl http://localhost:5001/health