Commit graph

33 commits

Author SHA1 Message Date
clucraft
2549118555 Add self-hosted ntfy support with authentication
- Add server URL field (defaults to ntfy.sh if blank)
- Add optional username/password for protected servers
- Auth fields only shown when custom server URL is entered
- Database migration for ntfy_server_url, ntfy_username, ntfy_password
- Update CHANGELOG with self-hosted ntfy feature

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:27:09 -05:00
clucraft
617953dcf5 Add Google Gemini AI support (v1.0.6)
- Add Gemini as new AI provider option alongside Anthropic, OpenAI, Ollama
- Support models: Gemini 2.5 Flash Lite (default), Flash, Pro, 3 Flash Preview
- Add test API key endpoint to verify connection before saving
- Full support for extraction, verification, stock status, and arbitration
- Update all version files to 1.0.6

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 21:02:14 -05:00
clucraft
26a802e3d0 Add per-product pause/resume checking feature
Users can now pause and resume price checking for individual products
or in bulk via the Actions menu.

Backend:
- Added checking_paused column to products table
- Scheduler skips products with checking_paused=true
- Added POST /products/bulk/pause endpoint for bulk pause/resume

Frontend:
- Added Pause Checking and Resume Checking to bulk Actions menu
- Added filter dropdown (All/Active/Paused) next to sort controls
- Paused products show greyed out with pause icon and "Paused" label
- Progress bar hidden when paused

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 21:04:02 -05:00
clucraft
d9374c2f57 Add Gotify notification support
- Add gotify_url, gotify_app_token, gotify_enabled columns to users table
- Add sendGotifyNotification function with priority levels
- Add testGotifyConnection function to verify server connectivity
- Add test-gotify endpoint for connection testing before save
- Add Gotify section in Settings with:
  - Server URL input with Test Connection button
  - App Token input (masked)
  - Enable/disable toggle
  - Send Test button (after configured)
- Include Gotify in notification dispatching

Gotify is a self-hosted push notification server popular in the
self-hosted community, complementing the existing ntfy support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:52:33 -05:00
clucraft
5e850aee18 Fix manual refresh to respect AI disable flags
- Update refresh endpoint to use scrapeProductWithVoting instead of scrapeProduct
- Pass skipAiVerification and skipAiExtraction flags from product settings
- Also use preferred extraction method and anchor price for consistency

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:14:56 -05:00
clucraft
be6dd6382e Add per-product AI extraction disable option
- Add ai_extraction_disabled column to products table
- Add toggle in Advanced Settings alongside AI verification disable
- Pass skipAiExtraction flag through scheduler to scraper
- Skip AI extraction fallback when flag is set for product

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 21:09:19 -05:00
clucraft
b9d8d15e68 Add per-product AI verification disable option
Users can now disable AI verification for individual products that
AI is having trouble with (e.g., Amazon products where AI keeps
picking the main buy box price instead of "other sellers").

Changes:
- Add ai_verification_disabled column to products table
- Add toggle in product detail page under "Advanced Settings"
- Pass skip flag to scrapeProductWithVoting
- Skip AI verification when flag is set

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 20:32:25 -05:00
clucraft
8131017f3a Fix anchor price selection - prioritize anchor over method
The previous logic checked preferred method first, which could select
a wrong price even when anchor price was available. Now:

1. PRIORITY 1: Anchor price - if user confirmed a price, find closest
   match (within 10% tolerance) across ALL candidates
2. PRIORITY 2: Preferred method - only used if no anchor match found
3. PRIORITY 3: Consensus voting

Also added debug logging to trace anchor price saving and retrieval.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 19:01:15 -05:00
clucraft
389915a6ec Add anchor price support for variant products
When a user confirms a price from the modal, we now store it as an
"anchor price". On subsequent refreshes, if multiple price candidates
are found (common with variant products like different sizes/colors),
we select the candidate closest to the anchor price.

This fixes the issue where variant products would randomly switch to
a different variant's price on refresh.

Changes:
- Add anchor_price column to products table
- Save anchor price when user confirms a price selection
- Use anchor price to select correct variant on refresh
- 20% tolerance - if no candidate is within 20% of anchor, fall back to consensus

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 15:50:18 -05:00
clucraft
cf23ac9db1 fix: Always show price selection modal and use browser for JS-heavy sites
- Always show price selection modal when adding a product so users can verify
- Use browser rendering for known JS-heavy sites (Best Buy, Target, Walmart, Costco)
- Update modal text to say "Confirm Price" for single candidates

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:58:58 -05:00
clucraft
4fd04cd160 feat: Multi-strategy price voting system with user selection
- Add multi-strategy voting: runs JSON-LD, site-specific, generic CSS,
  and AI extraction methods in parallel
- Implement consensus voting to select the correct price when methods agree
- Add AI arbitration when extraction methods disagree
- Add PriceSelectionModal for users to select correct price when ambiguous
- Store preferred extraction method per product for faster re-checks
- Add database columns for preferred_extraction_method and needs_price_review

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 14:45:51 -05:00
clucraft
28d6523959 Add Clear button to notification bell dropdown
- Add notifications_cleared_at column to users table
- Clear button marks notifications as seen without deleting history
- Badge and dropdown only show notifications after last clear
- History page still shows all notifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 03:20:03 -05:00
clucraft
63fcaebfd8 Add notification history feature with bell icon and history page
- Add notification_history database table for logging all triggered notifications
- Create API endpoints for fetching recent and historical notifications
- Add NotificationBell component in navbar with badge showing recent count
- Dropdown shows 5 most recent notifications with links to products
- Create full NotificationHistory page with filtering by notification type
- Log notifications when sent: price drops, target prices, back-in-stock
- Track which channels (telegram, discord, pushover, ntfy) received each notification
- Update sendNotifications to return which channels succeeded
- Bump version to 1.0.3

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:32:34 -05:00
clucraft
ccbc188487 Add AI status badges to show verification status on prices
- Add ai_status column to price_history table (verified/corrected/null)
- Track AI verification status through scraper and scheduler
- Display badges next to prices:
  - ✓ AI (green): AI verified the price is correct
  -  AI (orange): AI corrected an incorrect price
- Show badges on Dashboard product cards and ProductDetail page
- Add legend explaining badges in Settings when AI Verification is enabled

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 09:45:45 -05:00
clucraft
3d91489f12 Fix AI verification toggle not persisting
The GET and PUT /api/settings/ai endpoints were missing
ai_verification_enabled in the request/response handling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 09:32:49 -05:00
clucraft
3d6af13ac4 Add ntfy.sh notification support
- Add ntfy_topic and ntfy_enabled columns to database
- Add sendNtfyNotification function with emoji tags
- Add /settings/notifications/test/ntfy endpoint
- Add ntfy section in Settings UI with topic input
- Show ntfy badge in ProductDetail notification status

ntfy.sh is a free, simple notification service - no account needed.
Users just pick a topic name and subscribe in the ntfy app.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 21:02:49 -05:00
clucraft
a4da43c127 Return actual sensitive values from API for visibility toggle
Backend:
- Update /settings/notifications to return actual tokens/keys
- Update /settings/ai to return actual API keys

Frontend:
- Update NotificationSettings and AISettings types
- Populate form fields with actual saved values on load
- Eye toggle now reveals actual stored values
- Always show toggle button for consistent UX

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 20:45:06 -05:00
clucraft
082aae8789 Add Ollama support for local AI-powered price extraction
- Add database migration for ollama_base_url and ollama_model columns
- Update backend models and queries for Ollama settings
- Add extractWithOllama function using Ollama's /api/chat endpoint
- Add /api/settings/ai/test-ollama endpoint to test connection and list models
- Update frontend Settings page with Ollama configuration UI
- Support model selection from dropdown after testing connection

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 20:14:14 -05:00
clucraft
6c2aece1e8 Add stock status history tracking and timeline visualization
- Create stock_status_history table to track status changes over time
- Add stockStatusHistoryQueries with getByProductId, recordChange, getStats
- Update scheduler to record status changes
- Update product creation and manual refresh to record initial/changed status
- Add GET /products/:id/stock-history API endpoint
- Create StockTimeline component with:
  - Visual timeline bar showing in-stock (green) vs out-of-stock (red)
  - Availability percentage
  - Outage count and duration stats
- Integrate timeline into ProductDetail page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 14:23:55 -05:00
clucraft
433c0a0b12 Add toggles to enable/disable notification channels
- Add telegram_enabled, discord_enabled, pushover_enabled columns to database
- Update notification service to check enabled status before sending
- Add toggle switches in Settings UI for each configured channel
- Update ProductDetail to only show badges for enabled channels
- Channels default to enabled so existing users keep notifications

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 14:07:44 -05:00
clucraft
3fa913814d Add Pushover notification support
- Add pushover_user_key and pushover_app_token columns to users table
- Add sendPushoverNotification function to notifications service
- Add Pushover test endpoint
- Add Pushover settings UI in Settings page
- User provides both User Key and App Token (self-hosted friendly)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 13:48:31 -05:00
clucraft
2ecb02677e Display user's name instead of email in profile button
- Add name field to auth login/register responses
- Update User interface in AuthContext to include name
- Show name (or email as fallback) in navbar dropdown

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 22:17:36 -05:00
clucraft
906212e6ae Fix AI extraction JSON-LD parsing and add debug logging
- Extract JSON-LD scripts BEFORE removing script tags
- Add logging for prepared HTML, AI responses, and parsed data
- Include more detailed error messages in test endpoint

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:58:39 -05:00
clucraft
d98138fe7c Add AI-powered price extraction fallback
- Add AI extraction service supporting Anthropic (Claude) and OpenAI
- Add AI settings UI in Settings page with provider selection
- Add database migration for AI settings columns
- Integrate AI fallback into scraper when standard methods fail
- Add API endpoints for AI settings and test extraction

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 21:49:55 -05:00
clucraft
a85e22d8bc Add target price alerts, historical low indicator, bulk actions, and dashboard summary
Features:
- Target price alerts: Set a specific price target and get notified when reached
- Historical low indicator: Badge showing when current price is at/near all-time low
- Bulk actions: Select multiple products to delete at once
- Dashboard summary: Shows total products, items at lowest price, at target, biggest drops

Backend changes:
- Add target_price column to products table
- Add target_price notification type with Telegram/Discord support
- Include min_price in product queries for historical low detection
- Update scheduler to check target price conditions

Frontend changes:
- Add target price input to ProductDetail notification settings
- Show target price badge on product cards
- Add "Lowest Price" and "Near Low" badges to product cards
- Add bulk selection mode with checkboxes
- Add dashboard summary cards at top of product list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 13:40:39 -05:00
clucraft
040cdb9c42 Add user management features to admin section
- Add ability to create new users from admin panel
- Add role dropdown (User/Admin) for each user
- Replace toggle buttons with select dropdown for role management
- Admin users can access the Admin section in settings
- Regular users see only Profile and Notifications sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 13:17:27 -05:00
clucraft
f46c6ad9d4 Add settings page with profile, notifications, and admin sections
- Add sidebar navigation to settings page
- Add profile section for name management and password change
- Add admin section for user management and registration toggle
- Add profile API endpoints (GET/PUT /profile, PUT /profile/password)
- Add admin API endpoints (users CRUD, system settings)
- Add system_settings table for registration control
- Add name and is_admin columns to users table
- First registered user automatically becomes admin
- Check registration status on register/login page

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 07:58:11 -05:00
clucraft
59db0f5bb0 Fix product update route to include notification settings
Add price_drop_threshold and notify_back_in_stock to PUT /products/:id

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 22:18:44 -05:00
clucraft
fde620357a Fix updateLastChecked calls to include refresh_interval
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 21:44: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
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
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