Critical improvements to AI price extraction for better accuracy:
**1. Extract Visible Text Instead of HTML** (browserless_service.py)
- Changed from `page.content()` (raw HTML) to `page.inner_text('body')`
- Now captures text as rendered by JavaScript, not HTML source
- Amazon and other sites inject prices via JavaScript - HTML source doesn't contain them
- Includes proper fallback to HTML if inner_text fails
**2. Amazon-Specific Price Detection** (browserless_service.py)
- Wait for Amazon price elements to load before screenshot:
- `.a-price .a-offscreen` (main price)
- `#corePriceDisplay_desktop_feature_div` (price section)
- `#corePrice_desktop` (alternative container)
- `.a-price-whole` (price number)
- Prevents screenshots before dynamic prices are rendered
**3. Focused Amazon Screenshots** (browserless_service.py)
- Problem: Full-page Amazon screenshots are huge (multiple screens tall)
- When resized to 2048px, price text becomes tiny and unreadable
- Solution: Take focused screenshot of product container only:
- Try `#dp-container`, `#ppd`, or `#centerCol` (product areas)
- Falls back to viewport screenshot (better than full-page)
- Other sites still use full-page screenshots
**4. Enhanced Debug Logging** (ai_service.py)
- Log cleaned text preview (first 500 chars) to verify content
- Log prompt preview to debug AI instructions
- Warning when no page_text provided
These changes address the root causes of AI returning:
- price: null, confidence: 0.0-0.1 (too low to update DB)
Expected improvement:
- Visible text contains actual rendered prices
- Smaller, focused screenshots = better AI recognition
- Confidence scores should reach > 0.5 threshold
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