Commit Graph
39 Commits
Author SHA1 Message Date
Michael 184763b2da feat: Implement product search orchestration service combining direct site search, light scraping, and Browserless/AI fallback. 2025-11-23 16:26:13 +01:00
Michael e551927327 feat: Add direct e-commerce search service using Playwright/Browserless with site-specific configurations. 2025-11-23 16:06:16 +01:00
Michael 9a6ebf6f06 feat: Implement direct product search service using Browserless for e-commerce sites and add a search flow verification script. 2025-11-23 15:45:09 +01:00
Michael 7c8da4a337 feat: Implement dashboard delete confirmation UI, add a text utility, and install frontend dependencies. 2025-11-23 15:18:04 +01:00
Michael 45bb055566 feat: Add initial frontend application entry point, dependencies, and test configuration. 2025-11-23 14:51:42 +01:00
Michael 8d124bf0f8 feat: Add initial database migration and UI label component, alongside frontend dependency installation. 2025-11-23 14:37:35 +01:00
Claude 1dd6d4dae1 feat: Add authentication system and admin panel
- Add User model with authentication
- Create JWT-based auth service
- Add login page with admin/admin default credentials
- Create admin panel with user management, settings, and site configuration
- Move settings to admin section (admin only)
- Change search page from multi-site checkboxes to single site selector
- Add logout functionality to layout
- Protect routes with authentication
2025-11-23 09:15:56 +00:00
Claude 5e5f49a5f6 fix: Improve Amazon search reliability and URL validation
Amazon selectors simplified:
- Remove overly restrictive [href*='/ref='] requirement
- Use simpler data-asin and s-result-item selectors
- Wait for [data-component-type='s-search-result']

URL validation improved (_is_non_product_url):
- For Amazon: ONLY accept URLs containing /dp/ or /gp/product/
- Reject Amazon URLs with /ref=cs_ (error page links)
- Reject Amazon redirect URLs without product paths
- Add patterns: /503, /error, /robot, /captcha
- Add French site patterns: /application, /courses

Navigation link filter improvements:
- Add more Amazon error patterns: /ref=nb_, /ref=sr_
- Add /ap/signin, /gp/yourstore, /gp/cart
2025-11-23 09:02:51 +00:00
Claude 0a786b1c49 fix: Improve product selectors and URL filtering
Product selectors improvements:
- E.Leclerc: Target only /fp/ links, exclude promo/promotion URLs
- Auchan: Target only /p/*.html product links
- Carrefour: Target only /p/*.html product links
- Amazon FR/US: Target only /dp/ links with ASIN, exclude logo/nav links

URL filtering improvements (_is_navigation_link):
- Add French site-specific patterns: /application, /courses, /ep-
- Add promo/offers exclusions: /promo/, /offres/, /promotions/
- Add service pages: /magasin, /services/, /recettes
- Add Amazon-specific: /ref=cs_, /logo, /nav_, /gp/help
- Add generic exclusions: /home, /newsletter, /wishlist

These changes ensure only actual product URLs are captured,
not navigation links, app pages, or promotional banners.
2025-11-23 08:43:21 +00:00
Claude d2f95f5508 fix: Correct search URLs for French supermarkets
- E.Leclerc: Fix URL from /cat/recherche~q= to /recherche?q=
  (the old URL was showing promotions instead of search results)
- Auchan: Keep correct URL /recherche?text=
- Carrefour: Keep correct URL /s?q=
- Amazon FR/US: Simplify configuration, remove complex anti-bot
  headers that were causing more issues than helping
- Simplify browserless search function (remove special Amazon handling)
2025-11-23 08:29:28 +00:00
Claude 00d3aa9f1e fix: Improve Amazon search with anti-bot bypass measures
- Add special handling for Amazon (FR and US):
  - Custom User-Agent and HTTP headers mimicking real browser
  - Don't block images (Amazon uses them for bot detection)
  - Extra wait time and scroll for lazy-loaded content
  - Timezone set to Europe/Paris
  - Additional Sec-Fetch-* headers for authenticity
- Update Amazon product selectors with more robust patterns:
  - a.a-link-normal for direct product links
  - [data-asin]:not([data-asin='']) for filtering empty ASINs
  - .s-main-slot targeting main search results
- Add &ref=nb_sb_noss parameter to avoid redirects
2025-11-23 08:15:29 +00:00
Claude 3293b5d58a fix: Improve French price extraction and cookie handling
AI Schema:
- Improve extraction prompt for French e-commerce pages
- Add specific instructions for French price format (comma decimal, space thousands)
- Add French stock status terms (Ajouter au panier, Disponible, etc.)
- Fix price normalization to handle French format:
  - "12,99" -> 12.99
  - "1 234,56" -> 1234.56
  - "1.234,56" -> 1234.56

Scraper Service:
- Add comprehensive cookie/popup selectors for French sites:
  - E.Leclerc, Auchan, Carrefour (OneTrust, Didomi)
  - Cdiscount (#footer_tc_privacy_button_2)
  - Boulanger (.bcom-consent-accept-all)
  - Gifi, Centrakor (Magento cookie buttons)
  - PrestaShop sites (Stokomani, B&M)
- Add common CMP platform selectors
- Add French text-based selectors for cookie acceptance
2025-11-23 08:12:43 +00:00
Claude ee40ae68fc fix: Improve French e-commerce sites configuration
- Change default currency from USD to EUR for all French sites
- Update AI extraction prompt to use EUR by default
- Fix E.Leclerc search URL pattern
- Improve product selectors for Auchan, Carrefour, Amazon France
- Add Amazon France language parameter for better results
- Enhance cookie acceptance with site-specific selectors:
  - Amazon (#sp-cc-accept)
  - E.Leclerc (#onetrust-accept-btn-handler)
  - Auchan (#popin_tc_privacy_button_2, #didomi-notice-agree-button)
  - Carrefour (#onetrust-accept-btn-handler)
  - Cdiscount (#footer_tc_privacy_button_2)
  - And more CMP platforms (Didomi, OneTrust, Tarteaucitron, etc.)
- Improve cookie handling with iframe support and retry logic
2025-11-23 07:54:49 +00:00
Claude e1a9bd2657 feat: Hardcode French e-commerce websites configuration
- Remove ability to add/edit/delete search sites from settings UI
- Configure 16 French e-commerce sites with search URLs:
  - Discount: Gifi, Stokomani, B&M, Centrakor, L'Incroyable, Action, La Foir'Fouille
  - Grandes Surfaces: E.Leclerc, Auchan, Carrefour
  - E-commerce: Amazon France, Cdiscount
  - Électronique: Darty, Boulanger, Fnac
- Add automatic database seeding on application startup
- Add /api/search-sites/seed and /api/search-sites/reset endpoints
- Add cookie consent banner handling for sites that require it
- Simplify Settings page to only show site list with toggle for active state
2025-11-23 07:40:12 +00:00
Claude 7d92549a45 fix: Improve gifi.fr product link detection with .html pattern 2025-11-22 15:59:30 +00:00
Claude d132f991a9 fix: Add /products/ pattern for stokomani.fr 2025-11-22 15:58:18 +00:00
Claude 24fa6087fc fix: Improve product link detection for French e-commerce sites
- Add fallback to generic detection when configured selector fails
- Add many more CSS selectors for French e-commerce platforms (PrestaShop, Magento, WooCommerce)
- Add /produits/ pattern for bmstores.fr
- Improve generic container-based link detection
- Add navigation link filter to exclude non-product links
2025-11-22 15:57:58 +00:00
Claude 826d04331c fix: Improve domain matching and add discover-all endpoint
- Improve domain matching in direct_search_service to handle various formats
- Add /discover-all endpoint to discover search URLs for all sites missing one
- Add constants for magic numbers and fix linting issues
- Better domain cleaning in comparison functions
2025-11-22 15:40:59 +00:00
Claude aad16985d4 fix: Clean up linting issues in search URL discovery
- Move imports to top-level in search_sites router
- Fix line too long issue with input selector
- Define constants for magic numbers (HTTP_OK, MIN_PRODUCTS_TO_MATCH)
- Use 'raise from' pattern for proper exception chaining
2025-11-22 15:31:12 +00:00
Claude 62b145ca8f feat: Auto-discover search URLs when adding sites
- Add search_url_discovery.py service that visits sites and finds search forms
- Automatically discover search_url when a new site is created without one
- Add POST /{site_id}/discover endpoint to force rediscovery
- Discovery runs in background to not block the API response
- Tries multiple methods: form analysis, common URL patterns
2025-11-22 15:27:21 +00:00
Claude 5bee3e3396 feat: Add more site configs and fix screenshot display
- Add search URLs for French discount stores: stokomani, gifi, bmstores,
  centrakor, lafoirfouille, tedi, leclerc, carrefour, auchan
- Fix screenshot URL construction in search results
- Include screenshot_url in AI extraction results and error cases
2025-11-22 15:24:02 +00:00
Claude ccc9c0080e fix: Fix AI service call and domain URL building
- Use AIService.analyze_image() class method instead of module function
- Handle AIExtractionResponse tuple return type properly
- Add _clean_domain() to strip protocol/www from stored domains
- Fixes "https://https://" URL duplication issue
2025-11-22 15:09:50 +00:00
Claude df613cf64f fix: Use Browserless for search page scraping
- Replace httpx with Playwright/Browserless for search pages
- Handles JavaScript-rendered content and bot detection
- Add wait selectors for each site to ensure content is loaded
- Block images and tracking scripts for faster loading
- Sequential site scraping to avoid overloading Browserless
2025-11-22 15:05:47 +00:00
Claude 3b095801c5 feat: Replace DuckDuckGo with direct site search
- Remove duckduckgo-search dependency (unreliable results)
- Add direct_search_service.py that scrapes sites' search pages directly
- Add search_url and product_link_selector fields to SearchSite model
- Add beautifulsoup4 and lxml for HTML parsing
- Update schemas with new fields
- Add database migration for new columns

Direct search is more reliable as it queries each site's own search
functionality instead of relying on external search engines.
2025-11-22 15:00:49 +00:00
Claude 6f5b50a372 fix: Fix Browserless port and improve DuckDuckGo search
- Change BROWSERLESS_URL to use internal Docker port 3000 (not external 3012)
- Search each domain separately for better results
- Add detailed logging for debugging search issues
- Improve domain matching logic
2025-11-22 14:53:45 +00:00
Claude 36415b9cfc feat: Replace SearXNG with DuckDuckGo for product search
- Remove SearXNG container and configuration files
- Add duckduckgo-search library for web search
- Create duckduckgo_service.py with async search support
- Update search_service.py to use DuckDuckGo instead of SearXNG
- Fix BROWSERLESS_URL port to 3012

This eliminates the persistent limiter.toml directory issue and
provides a simpler, more reliable search solution.
2025-11-22 14:38:03 +00:00
Claude 1c07f08457 fix: Improve database migrations - create table if missing
- Create search_sites table if it doesn't exist
- Add price_selector column only if table exists but column doesn't
- Fixes 400 Bad Request when creating search sites
2025-11-22 13:32:24 +00:00
Claude 99e7592cdc fix: Add automatic database migration for missing columns
- Add run_migrations() function that runs at app startup
- Automatically adds price_selector column to search_sites if missing
- Prevents UndefinedColumn errors on existing databases
2025-11-22 13:29:29 +00:00
Claude 933cb2e66f feat: Improve search config + rename Dashboard + fix SearXNG
SearXNG:
- Fix tini not found error by calling entrypoint.sh directly
- Keep limiter.toml creation at container startup

UI Changes:
- Rename "Tableau de bord" to "Suivis produits" in navigation
- Move CSS selector configuration from item modal to Settings page
- Add price_selector field to search sites configuration
- Display CSS selector badge on site cards

Backend:
- Add price_selector column to SearchSite model and schemas
- Update init.sql with search_sites table and migration for existing DBs
2025-11-22 13:24:28 +00:00
Claude 5caee6dee4 fix: Disable SearXNG public_instance and add User-Agent header 2025-11-22 11:55:14 +00:00
Claude 058a2e46ed fix: Clean domain URLs before SearXNG query (remove protocol, www, etc.) 2025-11-22 11:46:16 +00:00
Claude 20080aee74 fix: Add X-Forwarded-For header to SearXNG requests to bypass bot detection 2025-11-22 11:23:08 +00:00
Claude 9235ad444a fix: Use SettingsService class method instead of standalone function 2025-11-22 11:18:18 +00:00
Claude d39b3346c0 fix: Correct Alembic migration chain for search_sites table 2025-11-22 11:08:39 +00:00
Claude 1116c3a648 feat: Add multi-site product search system with SearXNG integration
This commit adds a comprehensive product search feature that allows users
to search for products across multiple configured e-commerce sites.

Backend changes:
- Add SearXNG service to docker-compose for meta-search capability
- Add SearchSite model and Alembic migration with default sites
- Create searxng_service.py for search queries across sites
- Create light_scraper_service.py for fast HTTP-based extraction
- Create search_service.py orchestrator combining SearXNG + HTTP + Browserless
- Add API endpoints for search (/api/search) with SSE streaming
- Add CRUD endpoints for search sites (/api/search-sites)

Frontend changes:
- Add new /search page with real-time results display
- Create SearchResultCard component for product display
- Add Progress, Checkbox, and Badge UI components
- Update Settings page with search sites management section
- Add navigation link to search page
- Create new modern SVG logo with price-flow gradient design
- Update favicon to SVG format

The search system uses a hybrid approach:
1. SearXNG finds product URLs across configured sites
2. Light HTTP scraper attempts fast extraction
3. Falls back to Browserless for JavaScript-heavy sites
4. Results stream progressively via SSE
2025-11-22 11:03:48 +00:00
Claude 89f422744a fix: Stabilité Browserless v2 + headers anti-détection
Browserless (docker-compose.yml):
- Image mise à jour: ghcr.io/browserless/chromium:latest
- Timeout augmenté à 300s (5 minutes)
- shm_size: 2gb (critique pour Chrome)
- Mémoire: 3G limit, 1G reservation
- Nouvelles variables: HEALTH, CHROME_REFRESH_TIME

Scraper Service:
- Ajout headers HTTP réalistes (Accept-Language, Accept)
- Locale fr-FR et timezone Europe/Paris
- Timeout connexion explicite (60s)
- Fermeture propre des ressources (page, context, browser)
- Meilleure gestion des erreurs de fermeture
2025-11-22 10:05:36 +00:00
Claude b5cd1465ce fix: Amélioration scraping Amazon + stabilité Browserless
Browserless (docker-compose.yml):
- CONNECTION_TIMEOUT augmenté à 180s
- MAX_CONCURRENT_SESSIONS réduit à 3
- Limite mémoire 2G ajoutée
- Args Chrome optimisés (disable-dev-shm-usage, no-sandbox)

Scraper Service:
- Ajout simplification automatique des URLs Amazon (extraction ASIN)
- Suppression des paramètres de tracking (utm_, ref, etc.)
- Système de retries (2 tentatives avec backoff)
- Screenshot pris AVANT extraction texte (évite perte si timeout)
- Popups Amazon ajoutés (#sp-cc-accept, etc.)
- Meilleure gestion des erreurs avec logs détaillés
2025-11-22 09:55:49 +00:00
Claude d6c39252f2 feat: Rebranding PriceFlow + OpenRouter + i18n FR + Docker
Modifications majeures:

1. Rebranding: Pricecious → PriceFlow
   - Mise à jour du titre, logo et noms de projet

2. Intégration OpenRouter
   - Ajout comme provider IA avec filtres (chat, vision, code, reasoning, free)
   - Récupération dynamique des modèles et coûts
   - Service et router dédiés (/api/openrouter/models)

3. Internationalisation (i18n)
   - Installation i18next + react-i18next
   - Application entièrement traduite en français
   - Fichier de traduction: fr.json

4. Configuration Docker
   - docker-compose.yml avec réseau nginx_default (external)
   - PostgreSQL sur port 5488:5432
   - Browserless sur port 3012:3000
   - init.sql pour initialisation de la base de données
   - .env.example avec variables documentées

5. Favicon
   - Documentation ajoutée dans index.html pour faciliter le remplacement
2025-11-22 09:22:39 +00:00
LogiFlow afed10abc5 Add files via upload 2025-11-22 10:01:25 +01:00