Commit Graph
338 Commits
Author SHA1 Message Date
Claude dcb12a1b3b feat: restore PostgreSQL as primary database configuration
Switched back from SQLite to PostgreSQL configuration to reconnect
to the existing PostgreSQL database with user data.

Changes:
- Renamed database.js to database-sqlite.js (SQLite backup config)
- Renamed database-postgres.js to database.js (PostgreSQL primary)
- Created .env file with PostgreSQL connection settings (not committed)

The backend now expects PostgreSQL on localhost:5499. To start the
database, run: docker-compose up -d postgres

Note: This resolves the empty notes issue - once PostgreSQL is started,
all user notes will be loaded from the PostgreSQL database.
2025-11-27 20:57:01 +00:00
Claude 5d011e81ae debug: add logging to loadNotes function for troubleshooting
Added console.log statements to track:
- When notes API fetch is initiated
- Number of notes fetched
- The actual notes data returned

This helps identify if the issue is with the API request, the response,
or the data handling in the frontend.
2025-11-27 20:42:47 +00:00
Claude 5cec61d336 fix: configure Vite proxy to connect frontend to backend
Added proxy configuration to route API requests from frontend (port 5173)
to backend (port 2222). This resolves the issue where the frontend
couldn't fetch notes because it was trying to access the API on the
wrong port.

Changes:
- Changed Vite dev server port from 2222 to 5173
- Added proxy rules for /api and /uploads endpoints
- Both proxies target http://localhost:2222 (backend)

This completes the fix for notes not displaying. The frontend can now
properly communicate with the backend through the proxy.
2025-11-27 20:37:55 +00:00
Claude f0ab6f26b0 fix: switch to SQLite database temporarily for development
PostgreSQL was not available in the development environment, causing
the backend server to fail on startup with connection timeout errors.

Changes:
- Renamed database.js to database-postgres.js (PostgreSQL config)
- Renamed database-sqlite-backup.js to database.js (SQLite config)
- This allows the backend to start and serve data to the frontend

This fixes the issue where no notes were displaying (Total: 0)
because the backend server couldn't connect to the database.

Note: This is a temporary workaround for the development environment.
Production should continue using PostgreSQL via Docker.
2025-11-27 20:28:05 +00:00
Claude a7bc2eb7ae debug: add temporary debug logging to identify notes filter issue
Added console.log statements and temporary debug UI panel to help
diagnose why notes are not displaying. This includes:
- Logging total notes count and active filters
- Logging which specific filter is excluding each note
- Visual debug panel showing filter state in the UI

This is temporary debugging code to resolve the issue reported
by the user where no notes are displaying.
2025-11-27 20:04:32 +00:00
Claude 04035d55fd feat: add advanced export/import system
- Create exportImport utility with JSON and CSV export
- Support full backup with version tracking
- Add BackupData interface with notes, todos, settings
- Implement file parsing and validation
- Create ExportImportModal component with tabs
- Show current data statistics before export
- Preview backup content before import
- Download as timestamped JSON or CSV files
- Calculate and display backup statistics
- Support reading and validating imported backups
2025-11-27 19:51:31 +00:00
Claude e294ff772b feat: add Kanban view to mobile interface
- Add view mode toggle (List/Kanban) in mobile notes page
- Integrate KanbanBoard component with drag & drop support
- Support moving notes between columns via tags
- Auto-refresh notes list after moving to new column
- Maintain search and filter functionality in Kanban view
- Add mobile-optimized horizontal scrolling for Kanban columns
2025-11-27 19:49:54 +00:00
Claude 4895cb4462 feat: add due dates support for todos
- Update Todo interface to include due_date, parent_id, level fields
- Add due_date parameter to NotesService.addTodo method
- Add due_date parameter to TodosService.createTodo method
- updateTodo already supports Partial<Todo> including due_date
- Backend migrations already created (003 and 004)
- Prepare foundation for due date UI in future updates
2025-11-27 19:45:16 +00:00
Claude a3d8167a46 feat: add keyboard shortcuts and statistics dashboard
Keyboard Shortcuts:
- Create useKeyboardShortcuts hook with configurable shortcuts
- Support Ctrl/Cmd, Alt, Shift modifiers
- Add 7 global shortcuts (New note, Search, Quick capture, etc.)
- Create KeyboardShortcutsHelp modal with categorized shortcuts
- Show formatted shortcut keys (⌘ on Mac, Ctrl on Windows)
- Press ? to open shortcuts help

Statistics Dashboard:
- Create StatsDashboard component with productivity metrics
- Calculate productivity score (0-100) based on completion rate
- Show notes statistics (total, active, archived, priority)
- Display todos statistics with completion rate
- Track content stats (notes with todos/images/files, unique tags)
- Show recent activity (notes updated in last 7 days)
- Visual progress bar for productivity score
- Integrate dashboard in left column below calendar
2025-11-27 19:43:26 +00:00
Claude 1e9795e5d9 feat: add quick capture floating widget for fast note creation
- Create QuickCaptureWidget with floating action button
- Support quick note capture with optional title
- Auto-generate timestamped title if none provided
- Add keyboard shortcuts: Ctrl+Enter to save, Escape to cancel
- Integrate into desktop interface with reload on capture
- Display visual feedback with kbd tags for shortcuts
- Position as floating FAB in bottom-right corner
- Refresh notes list automatically after capture
2025-11-27 14:06:15 +00:00
Claude ea926cb1a1 feat: add note linking system with wiki-style syntax
- Create noteLinks utility for wiki-style [[Note Title]] links
- Support automatic link detection and conversion to clickable HTML
- Show broken links (when target note doesn't exist) in gray strikethrough
- Implement backlinks detection (find notes linking to current note)
- Add autocomplete suggestions when typing [[ for quick note selection
- Support cursor position detection for inline link editing
- Prioritize exact matches and recent notes in suggestions
- Convert links to HTML with custom styling and click handlers
2025-11-27 14:04:33 +00:00
Claude e48bc1eaf1 feat: add smart tag auto-suggestions for notes
- Create smartTags utility with keyword extraction algorithm
- Filter out 100+ French stop words for better keyword quality
- Implement category-based tag suggestions (travail, dev, design, etc.)
- Suggest tags from similar notes based on content similarity
- Display smart suggestions with one-click add in note editor
- Show sparkle icon to indicate AI-assisted suggestions
- Combine multiple suggestion strategies for best results
- Limit to top 8 most relevant suggestions per note
2025-11-27 14:03:41 +00:00
Claude 712d3fd21a feat: add Kanban board view for notes organization
- Create KanbanBoard component with drag-and-drop functionality
- Support 5 columns: Backlog, À faire, En cours, En révision, Terminé
- Use tag-based system to track note status in columns
- Add view toggle between List and Kanban modes in desktop interface
- Display note metadata (todos, images, files, tags) in Kanban cards
- Support moving notes between columns by dragging
- Auto-update tags when moving notes to different columns
- Show task completion progress in Kanban cards
2025-11-27 14:01:14 +00:00
Claude 07756f2411 feat: add Pomodoro timer for productivity
- Create PomodoroTimer component with 25/5/15 minute intervals
- Support work sessions, short breaks, and long breaks
- Track completed sessions with visual counter
- Add progress bar and audio notification when timer completes
- Auto-advance to appropriate break after work session
- Add pause/resume and reset functionality
- Integrate timer in desktop right column above todos/RSS
2025-11-27 13:55:17 +00:00
Claude bde406bc3e feat: add backend support for hierarchical subtasks
- Create migration 005 to add parent_id and level columns to todos tables
- Fix migration 003 to use correct table name (note_todos instead of todos)
- Update POST /api/notes/:id/todos to accept parent_id parameter
- Update POST /api/todos to accept parent_id for global todos
- Add automatic level calculation based on parent depth
- Update GET endpoints to return parent_id and level fields
- Add validation to ensure parent todo exists before creating subtask
- Support CASCADE DELETE for subtasks when parent is deleted
2025-11-27 13:51:42 +00:00
Claude a1addbacba feat: add advanced search with filters for notes
- Create AdvancedSearch component with multiple filter options
- Add filters for tags, date range, content type (todos/images/files), and priority
- Integrate advanced search in desktop and mobile note pages
- Extract unique tags from notes for filter dropdown
- Support multiple simultaneous filters with clear visual feedback
- Reset pagination when filters change
2025-11-27 13:48:02 +00:00
Claude 0a22cc784f feat: add note templates system with 10 pre-built templates
- Create noteTemplates.ts with 10 default templates (Meeting, Daily Journal, Project Planning, etc.)
- Add TemplateSelector component with search and category filtering
- Integrate template selector in desktop and mobile note creation flows
- Support automatic todo creation from templates
- Organize templates by category (Travail, Personnel, Créativité, Autre)
2025-11-27 13:43:22 +00:00
Claude c4c17264f4 chore: add database migrations for due dates feature
Prepared SQL migrations for adding due_date support to todos.

Migrations:
- 003_add_due_date_to_todos.sql - Adds due_date column to todos table
- 004_add_due_date_to_global_todos.sql - Adds due_date column to global_todos table

Features:
- TIMESTAMPTZ column for timezone-aware dates
- Indexes on due_date for query performance
- Composite indexes on (completed, due_date) for filtering

Note: Backend and frontend implementation pending.
These migrations are ready to be applied when the feature is completed.
2025-11-27 13:35:59 +00:00
Claude 94530246af feat: add markdown export functionality
Implemented comprehensive markdown export for notes and todos with automatic HTML to Markdown conversion.

New Features:
- Export single note to Markdown file
- Export all notes to combined Markdown
- Export todos list to Markdown
- Smart HTML to Markdown conversion
- Preserves formatting, links, lists, and code blocks

Files Created:
- src/utils/markdownExport.ts - Complete export utilities

Desktop (Index.tsx):
- Added FileDown icon to imports
- New export button in note editor toolbar
- Downloads note as .md file with one click

Mobile (NoteDetailPage.tsx):
- Added "Exporter en Markdown" to dropdown menu
- Same functionality as desktop version

Markdown Export Features:
✅ Converts HTML formatting to Markdown syntax
✅ Includes note metadata (creation date, tags, priority)
✅ Exports todos as checkboxes [ ] or [x]
✅ Includes image references
✅ Automatic filename generation
✅ One-click download

Export includes:
- Note title as H1
- Creation date and metadata
- Tags with # prefix
- Priority indicator ⭐
- Full content with formatting preserved
- Todo items with completion status
- Image links

Perfect for:
- Backing up notes
- Sharing notes externally
- Version control (git)
- Using notes in other markdown editors
2025-11-27 13:34:54 +00:00
Claude 21d3f7057f feat: add dark/light/system theme toggle
Implemented complete theme switching with three modes:
- Light theme
- Dark theme
- System (auto-detect from OS)

Changes:
- Created ModeToggle component with dropdown menu (src/components/mode-toggle.tsx)
- Added theme toggle to desktop header (Index.tsx)
- Enhanced mobile settings with radio group for theme selection (SettingsPage.tsx)
- Changed default theme from "light" to "system" for better UX (App.tsx)

Features:
✅ Seamless theme switching without page reload
✅ Persists user preference in localStorage
✅ System theme auto-detects OS preference
✅ Smooth transitions between themes
✅ Works on both mobile and desktop

Desktop: Theme toggle button in top navigation
Mobile: Theme settings in Settings page with Light/Dark/System options
2025-11-27 13:31:19 +00:00
Claude cc635f786f feat: add automatic image compression before upload
Added client-side image compression to improve upload speed and reduce storage.

New Features:
- Created imageCompression utility (src/utils/imageCompression.ts)
  * Automatically compresses images larger than 1MB
  * Resizes to max 1920x1080px while preserving aspect ratio
  * Uses 80% JPEG quality by default
  * Preserves PNG transparency when present
  * Falls back to 60% quality if still over 2MB

Mobile (NoteDetailPage.tsx):
- Integrated compression before upload
- Shows compression stats to user (e.g., "5.2 MB → 1.1 MB")
- Better error messages with specific details

Desktop (Index.tsx):
- Same compression integration as mobile
- Consistent user experience across platforms

Benefits:
✅ Users can upload large photos from cameras/phones
✅ Faster uploads (smaller files)
✅ Reduced server storage requirements
✅ Better mobile experience (photos often 5-10MB)
✅ Transparent to user (happens automatically)

Technical Details:
- Uses HTML5 Canvas API for processing
- Client-side compression (no server load)
- Maintains image quality while reducing size
- Handles JPEG, PNG, WebP, and GIF formats
- Smart transparency detection for PNGs
2025-11-27 13:14:37 +00:00
Claude 185fe92b6a fix: improve image upload error handling on mobile and desktop
Fixed image upload issues by improving error handling and validation:

Mobile (NoteDetailPage.tsx):
- Added file size validation (5MB max) before upload
- Added error message when upload returns null
- Specified exact image types in accept attribute
- Better user feedback for all error cases

Desktop (Index.tsx):
- Added file size validation (5MB max) before upload
- Added error message when upload returns null
- Specified exact image types in accept attribute
- Removed unnecessary handleUpdateNote call (backend ignores images field)
- Fixed state update to only update local state, not call backend

Both versions now:
- Show clear error messages to users when upload fails
- Validate file size before attempting upload
- Accept only supported formats: JPEG, PNG, WebP, GIF
- Handle null responses from upload service properly

This fixes the silent failure issue where images would not upload but no error was shown to the user.
2025-11-27 13:00:38 +00:00
Claude e420364b50 fix: correct SQL bug in todo creation query
Fixed critical SQL type error in todo creation endpoint that prevented todos from being added to notes.

Bug:
- Line 417: Used FALSE (boolean) instead of 0 (integer) in COALESCE function
- SQL: COALESCE(MAX(position), FALSE) + 1
- This caused a type mismatch error when inserting new todos

Fix:
- Changed to: COALESCE(MAX(position), 0) + 1
- Now correctly defaults to 0 when no todos exist for a note

This fix resolves the issue where adding todos would fail silently or throw database errors.
2025-11-27 12:49:07 +00:00
Claude 2b7d824c22 chore: update package-lock.json after npm install 2025-11-27 08:44:34 +00:00
Claude 75551be69d fix: resolve note todos synchronization issue between mobile and desktop
Fixed critical bug where todos added on mobile or desktop were being silently lost.

Root cause:
- Mobile and desktop were sending todos via the generic PUT /api/notes/:id endpoint
- Backend ignored the 'todos' field in this endpoint (only processes title and content)
- Users saw success messages but todos were never saved to database
- On reload, todos disappeared

Solution:
- Added dedicated todo management methods to NotesService:
  * addTodo() - POST /api/notes/:id/todos
  * updateTodo() - PUT /api/notes/todos/:todoId
  * toggleTodo() - PUT /api/notes/todos/:todoId
  * deleteTodo() - DELETE /api/notes/todos/:todoId

- Updated NoteDetailPage.tsx (mobile) to use proper API methods
- Updated Index.tsx (desktop) to use proper API methods
- Both versions now correctly persist todos to the database

Files modified:
- src/services/NotesService.ts - Added todo management methods
- src/pages/mobile/NoteDetailPage.tsx - Fixed todo handlers
- src/pages/Index.tsx - Fixed todo handlers in note detail view
2025-11-27 08:43:46 +00:00
LogiFlow 425b7f36a0 Merge pull request #122 from R0m1k3/antigravity
feat: implement main application dashboard with notes, todos, RSS, ca…
2025-11-23 17:39:24 +01:00
Michael 29e19414b8 feat: implement main application dashboard with notes, todos, RSS, calendar, and chat functionalities. 2025-11-23 17:38:57 +01:00
LogiFlow 44ff130e0b Merge pull request #121 from R0m1k3/antigravity
Antigravity
2025-11-23 17:29:31 +01:00
Michael 2703e80afa feat: Add PostgreSQL database connection, custom type parsers, and initial schema definition for all application tables. 2025-11-23 17:28:55 +01:00
Michael e71d81c05d feat: Add automatic database schema migrations for tracking timestamps, priority, and in-progress fields, executed at startup. 2025-11-23 17:13:20 +01:00
LogiFlow 200bdd1de7 Merge pull request #120 from R0m1k3/antigravity
feat: add admin service for user management and migration, and routes…
2025-11-23 16:32:14 +01:00
Michael 00ac17da70 feat: add admin service for user management and migration, and routes for database cleanup. 2025-11-23 16:31:47 +01:00
LogiFlow 1499987821 Merge pull request #119 from R0m1k3/antigravity
feat: implement the main application index page with integrated notes…
2025-11-23 16:04:54 +01:00
Michael c177833b38 feat: implement the main application index page with integrated notes, todos, RSS, calendar, and chat functionalities. 2025-11-23 16:04:06 +01:00
LogiFlow 341affdd30 Merge pull request #118 from R0m1k3/antigravity
feat: add comprehensive dashboard page with todo management, RSS feed…
2025-11-23 15:45:35 +01:00
Michael 2665ba5cc1 feat: add comprehensive dashboard page with todo management, RSS feeds, calendar, and AI integration 2025-11-23 15:40:03 +01:00
LogiFlow 4f44a3bbe0 Merge pull request #117 from R0m1k3/antigravity
feat: Implement new React frontend with authentication, add user and …
2025-11-23 15:19:32 +01:00
Michael 4d29bc7454 feat: Implement new React frontend with authentication, add user and auth routes, and introduce various database migration and timezone diagnostic scripts. 2025-11-23 15:19:08 +01:00
LogiFlow f6e2ba21f8 Merge pull request #116 from R0m1k3/antigravity
Antigravity
2025-11-23 14:04:52 +01:00
Michael 623cb2f4f8 arichivage 2025-11-23 14:02:54 +01:00
LogiFlow ff5d227307 Merge pull request #115 from R0m1k3/claude/fix-note-overwrite-bug-01Rx2KMQBoF8XiWUyEHb4c1K
Fix: Amélioration des logs et gestion d'erreurs pour l'assistant IA O…
2025-11-23 13:53:24 +01:00
Michael 9d039d20c4 feat: Implement new React frontend with authentication, routing, theming, and add comprehensive calendar timezone management and database migration scripts. 2025-11-23 13:52:41 +01:00
LogiFlow 060a401824 Merge pull request #114 from R0m1k3/claude/add-database-cleanup-017GyBxnCE3LSomAPinGgDT5
Claude/add database cleanup 017 gy bxn ce3 l som a pin gg dt5
2025-11-21 15:20:09 +01:00
Claude 3677bdfe70 Feat: Système de migrations automatiques au démarrage
Implémente un système de migrations automatiques qui s'exécute à chaque
démarrage de l'application Docker/Node.

Problème résolu :
- Les utilisateurs n'ont plus besoin d'exécuter manuellement les migrations
- Les nouveaux champs SQL sont ajoutés automatiquement
- Évite les erreurs "column does not exist"
- Garantit la cohérence entre le code et le schéma DB

Fonctionnement :
1. Au démarrage : initDatabase() → autoMigrate() → startSchedulers()
2. autoMigrate() vérifie chaque colonne via information_schema
3. Si la colonne n'existe pas, elle est ajoutée automatiquement
4. Les triggers et index sont également créés/mis à jour

Migrations incluses :
- Migration 1 : Champs de tracking (archived_at, completed_at)
  * notes.archived_at
  * global_todos.completed_at
  * note_todos.completed_at + created_at
  * Triggers automatiques

- Migration 2 : Champ priority pour tâches
  * global_todos.priority
  * note_todos.priority
  * Index de performance

Caractéristiques :
- ✅ Idempotent : Peut s'exécuter plusieurs fois sans problème
- ✅ Transactionnel : Utilise BEGIN/COMMIT/ROLLBACK
- ✅ Non-bloquant : L'application démarre même en cas d'erreur
- ✅ Intelligent : Vérifie avant de créer
- ✅ Sécurisé : Double protection avec rétrocompatibilité API
- ✅ Documenté : Guide complet dans docs/MIGRATIONS.md

Fichiers créés :
- scripts/auto-migrate.js - Script de migrations automatiques
- docs/MIGRATIONS.md - Documentation complète

Fichiers modifiés :
- server.js - Appel de autoMigrate() au démarrage

Logs au démarrage :
✓ Base de données initialisée avec succès
🔄 Vérification des migrations...
  → Ajout du champ priority à global_todos (si nécessaire)
✅ Migrations automatiques terminées avec succès
✓ Migrations automatiques appliquées

Impact :
Les utilisateurs peuvent maintenant simplement démarrer l'application avec
docker-compose up et tous les champs SQL seront automatiquement créés.
Plus besoin de lancer des scripts de migration manuellement !
2025-11-21 14:19:33 +00:00
Claude 941493cb16 Fix: Rétrocompatibilité pour le champ priority
Rend le code compatible avec les bases de données qui n'ont pas encore
exécuté la migration priority.

Changements :
- Route GET /api/todos utilise un fallback si priority n'existe pas
- Route PATCH /api/todos/:id/priority retourne un message explicite
- Les tâches s'affichent même sans migration
- Message clair pour guider l'utilisateur vers la migration

L'application fonctionne maintenant avec ou sans le champ priority.
2025-11-21 14:17:11 +00:00
LogiFlow 5bde1a3530 Merge pull request #113 from R0m1k3/claude/add-database-cleanup-017GyBxnCE3LSomAPinGgDT5
Feat: Ajout de l'icône de priorité pour les tâches
2025-11-21 14:52:21 +01:00
Claude 026f0499f5 Feat: Ajout de l'icône de priorité pour les tâches
Implémente un système de marquage de priorité pour les tâches avec une
icône étoile cliquable.

Fonctionnalités ajoutées :
- Champ priority (BOOLEAN) ajouté aux tables global_todos et note_todos
- Migration automatique avec script add-priority-field.js
- Route API PATCH /api/todos/:id/priority pour basculer la priorité
- Icône étoile (Star) dans l'interface frontend
- Tri automatique : tâches prioritaires en premier
- Index PostgreSQL pour optimiser les performances

Comportement de l'icône :
- Toujours visible et jaune quand la tâche est prioritaire
- Visible au survol (hover) quand la tâche n'est pas prioritaire
- Un clic bascule l'état prioritaire/non prioritaire
- Affichage discret (opacity 50%) pour les tâches complétées

Scripts npm ajoutés :
- npm run db:migrate:priority - Exécuter la migration

Routes API mises à jour :
- GET /api/todos - Inclut le champ priority, tri par priorité
- POST /api/todos - Accepte le champ priority
- PUT /api/todos/:id - Accepte le champ priority
- PATCH /api/todos/:id/priority - Bascule la priorité (nouveau)

UI améliorée :
- Icône étoile jaune pour les tâches prioritaires
- Animation au survol pour les interactions
- Tooltip explicatif au survol
- Onglets "Actives" et "Complétées" mis à jour
2025-11-21 10:20:00 +00:00
LogiFlow faa84373f4 Merge pull request #112 from R0m1k3/claude/add-database-cleanup-017GyBxnCE3LSomAPinGgDT5
Feat: Ajout du système de purge automatique de la base de données
2025-11-19 08:10:22 +01:00
Claude 86e825b9d1 Feat: Ajout du système de purge automatique de la base de données
Implémente un système complet de purge automatique pour maintenir
la base de données propre et performante.

Fonctionnalités ajoutées :
- Migration pour ajouter les champs de tracking (archived_at, completed_at)
- Triggers PostgreSQL pour mise à jour automatique des dates
- Script de purge manuel avec mode simulation (dry-run)
- Scheduler automatique configurable (défaut: 24h)
- Routes API admin pour contrôle et monitoring
- Documentation complète

Éléments purgés :
- Flux RSS désactivés (tous)
- Tâches complétées > 3 mois (configurable)
- Notes archivées > 6 mois (configurable)
- Rendez-vous passés > 6 mois (configurable)

Scripts npm ajoutés :
- npm run db:migrate - Exécuter la migration
- npm run db:cleanup - Purge manuelle
- npm run db:cleanup:dry-run - Simulation de purge

Routes API ajoutées :
- POST /api/admin/cleanup - Déclencher la purge
- GET /api/admin/cleanup/preview - Prévisualiser la purge
- GET /api/admin/cleanup/status - Statut du scheduler
- GET /api/admin/stats - Statistiques DB

Configuration via variables d'environnement :
- CLEANUP_ENABLED (défaut: true)
- CLEANUP_INTERVAL_HOURS (défaut: 24)
- CLEANUP_COMPLETED_TASKS_DAYS (défaut: 90)
- CLEANUP_ARCHIVED_NOTES_DAYS (défaut: 180)
- CLEANUP_PAST_EVENTS_DAYS (défaut: 180)
2025-11-19 06:49:27 +00:00
Claude f8cef758ad Fix: Amélioration des logs et gestion d'erreurs pour l'assistant IA OpenRouter
Problème :
- Erreur 502 (Bad Gateway) sur /api/openrouter/chat
- Message d'erreur générique "Provider returned error" peu informatif
- Difficile de diagnostiquer la cause réelle du problème

Solution backend (routes/openrouter.routes.js) :
1. Ajout de logs détaillés à chaque étape :
   - Début de requête avec modèle et nombre de messages
   - Validation de la clé API
   - Requête envoyée à OpenRouter
   - Réponse reçue avec status HTTP
   - Contenu de la réponse ou erreur détaillée

2. Amélioration de la gestion des erreurs :
   - Extraction du message d'erreur d'OpenRouter
   - Logs structurés avec contexte complet
   - Messages d'erreur plus descriptifs

Solution frontend (src/services/OpenRouterService.ts) :
1. Ajout de logs console à chaque étape
2. Messages d'erreur contextuels selon le code HTTP :
   - 400 : Requête invalide (message d'erreur API)
   - 401 : Clé API invalide
   - 402 : Crédits épuisés
   - 429 : Trop de requêtes
   - 502/503 : Service temporairement indisponible

3. Validation de la réponse :
   - Vérification que le contenu existe
   - Message d'erreur si réponse vide

Résultat :
- Logs détaillés backend + frontend pour diagnostic
- Messages d'erreur clairs et actionnables pour l'utilisateur
- Meilleure traçabilité des problèmes OpenRouter
2025-11-18 10:40:43 +00:00