Commit graph

115 commits

Author SHA1 Message Date
clucraft
4acd5c1432 Fix navbar button heights for visual consistency
Match theme toggle and profile dropdown to same 42px height

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:36:46 -05:00
clucraft
a2b632d35b Add staggered checking with jitter to prevent rate limiting
- Add next_check_at column to track when each product should be checked
- New products get random initial delay (0 to refresh_interval) to spread them out
- Each check adds ±5 minute jitter so products naturally drift apart over time
- Randomize delay between requests (2-5 seconds instead of fixed 2s)

This prevents all products from being checked at the same time,
reducing the risk of being rate-limited or blocked by retailers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:34:28 -05:00
clucraft
a6928a0c17 Add refresh controls and notification support
- Add refresh button to product list items with spinning animation
- Add editable refresh interval dropdown on product detail page
- Add user profile dropdown with settings link in navbar
- Create Settings page for Telegram and Discord configuration
- Add per-product notification options (price drop threshold, back in stock)
- Integrate notifications into scheduler for automatic alerts
- Add notification service supporting Telegram Bot API and Discord webhooks

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:15:04 -05:00
clucraft
8c5d20707d Add out-of-stock detection and display
- Add stock_status column to products table (in_stock/out_of_stock/unknown)
- Detect out-of-stock status on Amazon by checking:
  - #availability text for "currently unavailable"
  - #outOfStock element presence
  - Missing "Add to Cart" button
- Add generic stock status detection for other sites
- Allow adding out-of-stock products (they just won't have a price)
- Update background scheduler to track stock status changes
- Display stock status badge in product list and detail pages
- Dim out-of-stock products in the dashboard
- Show "Currently Unavailable" badge instead of price when out of stock

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:54:12 -05:00
clucraft
bf111e13d8 Fix Amazon scraper picking up coupon prices instead of product price
- Add detection for coupon/savings containers and skip prices within them
- Check parent elements for coupon-related IDs, classes, and text
- Add minimum price threshold of $2 (coupons are typically $1-5)
- Add fallback to parse Amazon's whole/fraction price format directly
- Increase findMostLikelyPrice threshold from $0.99 to $5

This fixes the issue where $1 coupon savings were being scraped
instead of the actual $25.99 product price.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 20:46:17 -05:00
clucraft
ba9e52b90f Redesign dashboard with list layout, sparklines, and search
- Add sparkline component for 7-day price history visualization
- Convert product cards to horizontal list items
- Add search functionality to filter products by name/URL
- Backend returns sparkline data and 7-day price change with products
- Show price trend indicator (green for drops, red for increases)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 19:32:25 -05:00
clucraft
93dbb5cc7c Improve price scraping with site-specific extractors
Added dedicated scrapers for major retailers:
- Amazon (all regions)
- Walmart
- Best Buy
- Target
- eBay
- Newegg
- Home Depot
- Costco
- AliExpress

Improvements:
- Site-specific selectors tried first
- Skip "original/was" prices in generic scraper
- Better browser headers to avoid blocks
- Prefer lowPrice for price ranges in JSON-LD
- Increased timeout to 20s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 19:24:40 -05:00
clucraft
4ef61517e3 Add dark mode with theme toggle
- Add dark theme CSS variables
- Theme toggle button in navbar and auth pages
- Persist theme preference in localStorage
- Update chart colors for dark mode
- Auto-detect theme changes via MutationObserver

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:27:17 -05:00
clucraft
a2b0c2cc65 Fix price formatting for PostgreSQL DECIMAL type
PostgreSQL returns DECIMAL as strings, not numbers.
Updated all price formatting functions to handle both.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:22:40 -05:00
clucraft
5263ac93a9 Add database initialization script
- Add database/init.sql with schema
- Mount init.sql in docker-compose for auto-initialization
- PostgreSQL will run this on first startup

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:14:00 -05:00
clucraft
93b6338e99 Fix TypeScript errors in scraper
- Fix cheerio import to use named exports
- Add proper interfaces for JSON-LD data
- Fix type annotations for CheerioAPI

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:09:10 -05:00
clucraft
324d47d8b1 Update docker-compose to use GitHub Container Registry images
Images:
- ghcr.io/clucraft/priceghost-backend:latest
- ghcr.io/clucraft/priceghost-frontend:latest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:03:54 -05:00
clucraft
8992087220 Fix Dockerfiles: use npm install instead of npm ci
npm ci requires package-lock.json which wasn't generated.
Using npm install instead for builds.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 14:02:06 -05:00
clucraft
56c553aa02 Add GitHub Actions workflow for Docker builds
Builds and pushes images to GitHub Container Registry:
- ghcr.io/clucraft/priceghost-backend
- ghcr.io/clucraft/priceghost-frontend

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:59:22 -05:00
clucraft
10660e5626 Initial commit: PriceGhost price tracking application
Full-stack application for tracking product prices:
- Backend: Node.js + Express + TypeScript
- Frontend: React + Vite + TypeScript
- Database: PostgreSQL
- Price scraping with Cheerio
- JWT authentication
- Background price checking with node-cron
- Price history charts with Recharts
- Docker support with docker-compose

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 13:58:13 -05:00