Commit Graph

156 Commits

Author SHA1 Message Date
5fd087979b feat: unify multimodels translation providers, remove self-hosting (Ollama/LibreTranslate), and fix local SQLite configuration
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m21s
2026-06-14 10:44:46 +02:00
feea02033b fix: resolve Google login hydration mismatch and dynamic env load
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s
2026-06-07 12:21:06 +02:00
5b8c29dae6 feat: enable passing NEXT_PUBLIC_GOOGLE_CLIENT_ID at docker compose build time
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m30s
2026-06-07 11:41:04 +02:00
29753881a6 feat: add Telegram notifications for user signup and Stripe events
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m34s
2026-06-07 11:37:01 +02:00
8659b6761f docs: update README.md to act as central documentation portal with French links
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m46s
2026-06-07 11:21:06 +02:00
fa19f33ab0 docs: add French restore procedure guide PROCEDURE_RESTAURATION.md
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
2026-06-07 11:20:04 +02:00
9bb02927c3 fix: redirect logs to stderr and reduce size thresholds in backup/verify scripts
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m42s
2026-06-07 11:16:45 +02:00
ddf6b8f6bc fix: ignore unbound variables when sourcing .env in all backup/DR scripts
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m35s
2026-06-07 11:14:04 +02:00
3f980ad537 feat: add NAS backup, verification, and DR scripts
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
2026-06-07 11:12:01 +02:00
Sepehr
fb6740f333 fix(glossaries): correct source/target display mapping (FR=source, EN=target, others=translations[lang])
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m55s
Avant : getDisplaySource(term, 'en') lisait term.translations.en
(qui n'existe pas) puis fallback sur term.source = francais.
C'est ce qui affichait du francais et du néerlandais au mauvais endroit.

Apres : le mapping reflete la structure reelle des donnees :
- FR (lang='fr') → term.source
- EN (lang='en') → term.target
- autres (de, es, it, pt, nl, ru, ja, ko, zh, ar, fa)
  → term.translations[lang]
- si manquant → '' (placeholder, JAMAIS une autre langue en fallback)

Memes regles pour getDisplayTarget, inversees (defaut = target).

Edition (handleTermChange) ecrit au bon endroit :
- FR → term.source
- EN (ou multi) → term.target
- autres → translations[lang]

Le remap automatique de term.target au changement de targetLanguage
est supprime (lecture a la volee maintenant, plus besoin de modifier
l'etat des termes).

Aucun changement de donnees, aucun changement backend, aucun
changement de schema. Fix purement frontend.
2026-06-07 10:59:57 +02:00
Sepehr
79848230c0 fix(glossaries): restore selectable source language (data was already there)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m37s
Revert du commit e11a6b1 : la langue source doit etre selectionnable
(car l'utilisateur peut vouloir traduire depuis n'importe quelle
des 12 langues supportees, pas seulement le francais).

Le data modele support deja le cas : chaque terme a un champ
\	ranslations\ (dict de 11 langues) qui contient la traduction du
terme source. Donc pour traduire depuis l'italien, on lit
\	erm.translations.it\ comme source, et \	erm.translations.es\
comme cible si la cible est l'espagnol.

Changements :
- Le combobox 'Langue source' est restaure (12 langues)
- Nouvelle fonction \getDisplaySource(term, lang)\ :
  * 'fr' ou 'multi' → term.source (le francais original)
  * autre → term.translations[lang] (la traduction dans la langue)
  * fallback → term.source si la traduction manque
- handleTermChange ecrit au bon endroit selon la langue :
  * source FR → term.source
  * autre source → term.translations[sourceLanguage]
  * target 'multi'/'en' → term.target
  * autre target → term.translations[targetLanguage]
- hasUnsavedChanges compare aussi le dict translations (avant
  il ne comparait que source|target, donc un edit dans une autre
  langue ne declenchait pas l'alerte 'non enregistre')
- Note sous le combobox source explique la regle
  (FR = source originale, autre = champ translations)
- i18n : nouvelle cle \glossaries.detail.sourceLangNote\
  ajoutee aux 13 locales (FR + EN traduit)

L'utilisateur peut maintenant choisir 'Italien' comme source et
'Espagnol' comme cible, et voir les termes correspondants.
2026-06-07 10:11:19 +02:00
Sepehr
e11a6b16a0 fix(glossaries): source language combobox was a lie — replace with fixed FR label
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m32s
Les templates data/glossaires/*.json ne stockent les termes sources
qu'en francais. Le combobox 'Langue source' laissait l'utilisateur
croire qu'il pouvait traduire depuis une autre langue, mais le
backend renverrait toujours des termes en francais.

Fix : remplacer le select par un label fixe 'Francais' avec un badge
'fixe' et une note explicative indiquant que le multilingue source
est sur la roadmap.

Le select 'Langue cible' reste : il determine quelle traduction du
terme est affichee dans la colonne 'Cible' (FR+10 langues via le
champ translations).
2026-06-07 09:58:16 +02:00
80b49ee354 Robustness: Implement multi-destination backups (LOCAL, NAS, SCP) and backup/restore of NPM configurations 2026-06-07 09:50:51 +02:00
c7299228cd Robustness: Add fallback path handling in disaster-recovery.sh for NAS offline cases
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m15s
2026-06-07 09:48:13 +02:00
Sepehr
02a4a7ded8 fix(glossaries): sync data files name/description with index.json (→ Multilingue)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m15s
Le index.json avait ete mis a jour '→ Multilingue' mais les fichiers
data/glossaries/*.json gardaient l'ancien nom '→ Anglais' (commit c66252b
n'avait touche que l'index, pas les donnees). Consequence : importer un
template creait un glossaire avec le nom '→ Anglais' alors que les termes
sont en 11 langues (multilingues).

Sync de name + description des 8 fichiers sur l'index.
2026-06-07 09:42:47 +02:00
670d3f4376 Documentation: Add French Disaster Recovery Playbook for server failovers 2026-06-07 09:39:26 +02:00
Sepehr
e497f2d218 refactor(glossaries): single source of truth + dedicated detail page
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m15s
UX refonte :
- Retire la section 'Glossaires professionnels' de la vue principale
  (les 8 cartes de templates sont maintenant dans le dialog de creation)
- Cartes 'Vos glossaires' plus simples : nom, langues, termes, date
  - Cliquer sur la carte navigue vers /dashboard/glossaries/[id]
  - Plus de boutons Edit/Delete sur la carte (deplaces dans la page detail)
- Recherche par nom (visible si > 3 glossaires)
- Badge 'Non enregistre' si modifications non sauvegardees

Nouvelle page /dashboard/glossaries/[id] :
- Edition inline du nom (input), langues source/cible (select)
- Tableau des termes avec recherche et edition en place
- Ajout/suppression de termes (max 500)
- Export / Import CSV (meme logique que l'edit dialog)
- Zone danger : confirmation en 2 temps pour la suppression
- Back link vers la liste
- i18n : 40 nouvelles cles ajoutees aux 13 locales (FR + EN traduit,
  les autres utilisent le fallback EN)

Design preserve : editorial-card, brand-accent, meme typographie,
meme palette. Refactor structurel uniquement, pas de restyling.

Le system prompt (Instructions de contexte) reste tel quel, au-dessus
de la liste des glossaires, comme dans le design actuel.
2026-06-07 09:38:19 +02:00
23373ab91a Robustness: Update backup-database.sh with robust python resolution and cross-platform path handling 2026-06-07 09:29:19 +02:00
9104f6123d Security: Enforce strict CORS domain restriction in production environment 2026-06-07 09:26:45 +02:00
e7b5ea9a61 Robustness: Add json-file log rotation limits to all docker services 2026-06-07 09:26:39 +02:00
8805044bb6 Security: Untrack SSL private keys and certificates and add to .gitignore 2026-06-07 09:24:10 +02:00
Sepehr
1d883c3c69 feat(glossaries): add migrate_glossaries_to_multilingual.py
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 5m10s
Nouveau script dedie a la migration 'multilingue uniquement' :
- Supprime tout glossaire dont le nom ne contient pas '-> Multilingue'
- Backup JSON integral des glossaires + termes avant suppression
- Mode --dry-run / confirmation interactive / --yes
- Heuristique par nom uniquement (target_language peut etre 'multi' partout
  apres les migrations passees, donc non fiable)

Utilise apres le dedup (user_id, name) pour finir la migration.
2026-06-03 21:56:01 +02:00
Sepehr
8f55e3d9aa fix(glossaries): dedup by (user_id, name) instead of (user_id, template_id)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 3m1s
Le groupement par template_id etait faux sur la prod :
- Les doublons historiques ont template_id=NULL (crees avant la migration)
- Deux glossaires 'Finance - FR->Anglais' et 'Finance - FR->Multilingue'
  partagent le meme template_id mais DOIVENT etre conserves separement.

Changements :
- Groupement par (user_id, name) -> c'est ce que l'utilisateur voit dans l'UI
  et la definition reelle d'un doublon.
- Les glossaires multilingues ('-> Multilingue') ont un nom distinct des
  versions '-> Anglais' : ils ne sont jamais fusionnes (preserve par design).
- Fallback automatique si la colonne template_id est absente du schema
  (dev DB) : warning + requete sans la colonne, aucun crash.
- Suppression du flag --allow-missing-template-id devenu inutile.
- Nettoyage des imports ORM inutiles (text brut uniquement, plus rapide).
2026-06-03 21:48:53 +02:00
Sepehr
cd32a42b1a feat(glossaries): add backup + delete scripts and Gitea workflow for duplicate cleanup
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 6m31s
- scripts/backup_duplicate_glossaries.py : exporte en JSON les doublons
  (meme user_id + template_id) sans rien supprimer. Schema validation,
  tri stable, mode degrade si colonne template_id absente.
- scripts/delete_duplicate_glossaries.py : lit un backup JSON et supprime
  les doublons listes. Validation IDs, confirmation interactive,
  commit par user, mode --dry-run / --yes.
- .gitea/workflows/cleanup-glossaries.yml : workflow_dispatch qui SSH
  sur le serveur de prod et execute le script dans le conteneur backend
  (postgres demarre, .env charge, env_file docker-compose).
2026-06-03 21:21:11 +02:00
e1f9f3db04 feat: add Alembic migration for template_id column on glossaries
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m37s
2026-06-01 23:44:04 +02:00
818eac5490 feat: prevent duplicate glossary presets + fix i18n source warning bug
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m5s
- Add template_id column to Glossary model (nullable, indexed)
- Backend: return 409 Conflict if user already imported a template
- Frontend: disable preset cards already imported, show 'Imported' badge
- Fix duplicated text in GlossarySelector source warning (hardcoded FR text removed)
- Complete i18n migration for glossaries page and GlossarySelector
- Add glossaries.presets.alreadyImported key in all 13 locales
2026-06-01 23:39:53 +02:00
ce53f0df16 fix(admin): resolve hydration layout crash by removing layout-level return null and using mount-conditional text
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m5s
2026-06-01 23:24:03 +02:00
6da8a85b1d fix(admin): secure routes, add real IP detection, SMTP header validation, and fix Next.js layout hydration mismatch
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m5s
2026-06-01 23:16:03 +02:00
6d27dc4cda feat(i18n): Phase 1 — migrate 5 critical files from hardcoded text to i18n
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m51s
47 new i18n keys added across all 13 locales (en, fr, es, de, pt, it,
nl, ru, ja, ko, zh, ar, fa). English and French are fully translated,
remaining locales use French as placeholder.

Files migrated:
- EditGlossaryDialog.tsx (18 strings)
- DeleteGlossaryDialog.tsx (7 strings)
- ProUpgradePrompt.tsx (10 strings)
- WebhookSnippet.tsx (4 strings)
- TranslationModeToggle.tsx (8 strings)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 00:28:24 +02:00
c82e70681f fix: edit dialog remaps terms when target language changes
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m20s
When the user changes the target language dropdown in the edit dialog,
terms now remap to show the language-specific translation from the
translations dict. E.g. changing to Spanish shows 'servidor' instead
of 'server'. Falls back to default English if no translation exists.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 00:08:27 +02:00
0efdf6a3f4 feat: add source/target language selectors to edit glossary dialog
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m24s
Users can now change the language pair when editing a glossary:
- EditGlossaryDialog has source/target language dropdowns
- Default target_language changed from 'en' to 'multi' in create dialog
- onSave passes source_language and target_language to the backend
- Backend PATCH endpoint already supports updating these fields

Also fixes:
- CreateGlossaryDialog defaults to 'multi' instead of 'en'
- SUPPORTED_LANGUAGES now includes 'multi' option for target

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 00:03:22 +02:00
8fa1ab9ceb fix: delete all old FR→EN glossaries and deduplicate multilingual ones
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m13s
18 glossaries accumulated from multiple imports. This migration:
1. Deletes ALL glossaries with target_language='en' (old stale imports)
2. Deduplicates multilingual glossaries keeping only the newest per name

Result: 8 clean glossaries (one per template), all marked as multilingual.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 23:56:18 +02:00
9ab166c31e fix: glossaries page support for multilingual (target_language='multi')
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m58s
The /dashboard/glossaries page had two issues:
1. SUPPORTED_LANGUAGES had no 'multi' code, so multilingual glossaries
   showed '🌐 undefined' instead of '🌐 Multilingue'
2. The Compatible/Autre cible badge compared target_language directly
   with currentTargetLang, so 'multi' never matched → always showed
   'Autre cible'. Now 'multi' is treated as compatible with any target.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 23:48:48 +02:00
e9ac30ed1d style: use same serif/typography font styles on profile page as translate page
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m47s
2026-05-31 23:33:32 +02:00
32d75f8a84 fix: delete stale FR→EN glossaries + convert all remaining to multilingual
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
Old glossaries imported before enrichment have target_language='en' and no
translations dict — they're stale duplicates. This migration:

1. Deletes old FR→EN glossaries with empty/null translations (no Persian, etc.)
2. Renames multilingual glossaries from 'Anglais' to 'Multilingue'
3. Sets ALL remaining FR glossaries to target_language='multi'
4. Users re-import from enriched templates to get Persian/Arabic/etc. terms

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 23:31:24 +02:00
744a97f58d fix: import datetime in email_service.py to fix NameError, add Stripe emails unit tests
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m30s
2026-05-31 23:25:20 +02:00
b4096fd2ca fix: show target-language-specific translations in preview + rename migration
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
Two issues found in screenshot review:
1. Glossary preview always showed English 'target' field (foie → liver)
   instead of the language-specific translation. Now looks up
   term.translations[targetLang] first, falls back to term.target.
   When target is Persian, preview shows 'foie → کبد' (Persian).

2. Previous migration b7c8d9e0f1a2 was already applied on server before
   the rename was added. New migration c8d9e0f1a2b3 handles the rename
   separately: glossaries with target_language='multi' get their name
   changed from 'Anglais' to 'Multilingue'.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 23:22:50 +02:00
a79ce0fc9b fix: comprehensive glossary system audit — 6 critical fixes
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m27s
Full audit found 18 issues across backend, frontend, and data files.
Root cause: target_language had no single source of truth — 'en' was
hardcoded as default in 6+ places while templates are actually multilingual.

Fixes applied:
- routes/glossary_routes.py: list_glossaries() fallback 'en' → 'multi'
- routes/glossary_routes.py: import reads target_lang from index.json
  (source of truth) instead of template file
- data/glossaries/*.json: all 8 template files target_lang 'en' → 'multi'
- services/glossary_service.py: get_glossary_terms() now returns
  target_language field (was missing entirely)
- schemas/glossary_schemas.py: all defaults 'en' → 'multi'
  (GlossaryCreate, GlossaryResponse, GlossaryListItem)
- useTranslationConfig.ts: only reset glossary on sourceLang change,
  not targetLang (multilingual glossaries work with any target)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 23:14:41 +02:00
2386e94c6d fix: page /checkout/success qui auto-sync le plan apres paiement Stripe (success_url corrige)
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 3m5s
2026-05-31 23:05:01 +02:00
ebfa784b0a fix: also rename multilingual glossaries from 'Anglais' to 'Multilingue' in migration
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m4s
The migration already sets target_language='multi' but the glossary name
in the DB still said 'Français → Anglais'. Now it renames them to
'Français → Multilingue' so users aren't confused when translating to
Persian, Arabic, etc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:48:29 +02:00
ab296ea259 fix: Stripe billing portal auto-config programmatique, separation changer-forfait vs gerer-facturation
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
2026-05-31 22:45:45 +02:00
00c54997bf fix: sync plan+tier after checkout, portal same-tab nav, cancel button always visible for paid plans, portal return URL to profile tab
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m44s
2026-05-31 22:37:51 +02:00
277589aea3 fix: resolve alembic migration cycle — unique revision ID, correct chain
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
The previous migration used revision 'a1b2c3d4e5f6' which was already
taken by 005_add_reset_token_to_users.py, causing a cycle. Also both
f6a7b8c9d0e1 and the new migration pointed to the same down_revision.

Fixed:
- New unique revision ID: b7c8d9e0f1a2
- down_revision points to f6a7b8c9d0e1 (current head)
- Chain: e5b2c9d1f4a8 → f6a7b8c9d0e1 → b7c8d9e0f1a2

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:36:26 +02:00
c66252bed4 feat: mark glossary templates as multilingual — support 11 target languages
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m30s
Templates enriched by enrich_glossary_templates.py already contain
translations for de, es, it, pt, nl, ru, ja, ko, zh, ar, fa (including
Persian). But they were labeled FR→EN, causing incorrect filtering and
warnings when translating to other languages.

Changes:
- index.json: set target_lang='multi' for all 8 templates
- GlossarySelector: treat target_language='multi' as compatible with
  any target language (no false warnings, auto-select works)
- GlossarySelector: display '🌐 MULTILINGUE' badge instead of EN flag
- glossary_routes: default target_language to 'multi' instead of 'en'
- Migration: detect existing multilingual glossaries in DB (5+ keys in
  translations JSON) and set their target_language to 'multi'

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:32:27 +02:00
ad8ac089a4 fix: don't auto-select glossary when no target language match
When activating the glossary toggle, only auto-select a glossary if it
matches BOTH source and target language. If no matching glossary exists
(e.g. translating to Persian but only have FR→EN glossaries), leave the
selector empty so the user picks manually instead of forcing an
incompatible glossary.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:22:05 +02:00
67b41b2c24 chore: re-trigger deploy after password fix
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m44s
2026-05-31 22:12:54 +02:00
5122bfdf99 fix: glossary selection respects target language — sort by source+target, reset on lang change, fix template import
Some checks failed
Deploy to Production / Build and Deploy (push) Has been cancelled
- GlossarySelector: filteredGlossaries now sorts matching target_language
  first so FR→FA appears before FR→EN when translating to Persian
- GlossarySelector: toggle auto-select prefers glossary matching
  targetLang, falls back to first available
- useTranslationConfig: reset glossaryId when targetLang changes (was
  only resetting on sourceLang change)
- glossary_routes: set target_language from template data on import
  (was missing, defaulted to None/en)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 22:00:40 +02:00
89c31f8298 fix: safe JSON parse in checkout handlers, show proper error on 500
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m32s
2026-05-31 21:59:18 +02:00
fbe39d81e1 fix: align landing page prices with backend, pass billing mode in URL to /pricing
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m50s
2026-05-31 21:54:15 +02:00
b067be2ff7 fix: deploy.sh auto-selects compose file, docker-compose.yml uses correct Stripe var names
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 1m16s
2026-05-31 21:51:38 +02:00