The Problem

Manually monitoring eCommerce product prices is tedious and error-prone. Tracking a single Amazon product across days or weeks requires repeated manual checks, and catching a price drop or restock at the right moment is impractical. This repo addresses that by automating scraping, storage, and notification for tracked products.

What This Does

pricewise is a Next.js 13 eCommerce price tracker. Users paste an Amazon product URL into the search bar on app/page.tsx, and the app scrapes product data (title, price, availability, images, ratings) via lib/scraper/index.ts, which uses Cheerio and Bright Data's web unlocker to bypass site protections. Scraped data is persisted to MongoDB through lib/models/product.model.ts and lib/mongoose.ts.

The app has two core user flows. First, a product detail page (app/products/[id]/page.tsx) shows the scraped data and a modal (components/Modal.tsx) where users submit their email for price-drop or restock alerts. Second, a cron job at app/api/cron/route.ts periodically rescrapes tracked products and triggers email notifications via lib/nodemailer/index.ts. The UI is built with Tailwind CSS and includes components for product cards, price info, a hero carousel, and a navbar.

How To Use It

The README documents a standard Next.js setup. Environment variables are required for MongoDB connection, Bright Data credentials, and email service keys, though the exact variable names are not fully documented in the README excerpt—you'll need to inspect lib/mongoose.ts, lib/scraper/index.ts, and lib/nodemailer/index.ts to identify them.

npm install npm run dev

For production, deploy the Next.js app and configure the cron route (app/api/cron/route.ts) on a scheduler (e.g., Vercel Cron, GitHub Actions). No Dockerfile or CI configuration is present in the repo.

Real-World Use

A small eCommerce seller tracks competitor pricing on five key products. They deploy pricewise, enter the product URLs, and the cron job rescrapes daily. When a competitor drops a price below the seller's threshold, the app emails the seller with the new price and a link to the product page, allowing them to adjust their own pricing promptly.

Code Health & Issues

Medium – No test files detected: All scraping, database, and notification logic is untested. Scrapers are particularly brittle—a single change in Amazon's HTML structure breaks the app silently. Medium – No CI/CD pipeline: No .github/ directory or CI config exists. There's no automated build or test gate before deployment. Medium – No LICENSE file: Usage and redistribution rights are unclear, which matters if this is intended for commercial use. Low – No input validation visible: The search bar accepts a URL, but there's no evidence of validation against malformed or non-Amazon URLs before scraping. Low – Hardcoded scraping selectors: lib/scraper/index.ts likely contains Amazon-specific CSS selectors that will break without warning when Amazon updates its markup.

The Bottom Line

This is a solid educational reference for learning web scraping, cron jobs, and email automation with Next.js, and the code structure is clean and well-organized. However, it's not production-ready: no tests, no CI, no license, and scrapers are inherently fragile. Use it as a learning template or a starting point, but expect to add testing, validation, and deployment automation before relying on it in a real workflow.