- Add TTSService.js for text-to-speech functionality - Add comprehensive deployment documentation (guides, checklists, diagnostics) - Add new SBS content (chapters 8 & 9) - Refactor 14 game modules for better maintainability (-947 lines) - Enhance SettingsDebug.js with improved debugging capabilities - Update configuration files and startup scripts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
318 lines
21 KiB
Plaintext
318 lines
21 KiB
Plaintext
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
║ ║
|
|
║ 🛡️ STRATÉGIE DE DÉFENSE EN PROFONDEUR 🛡️ ║
|
|
║ ║
|
|
║ Déploiement en Milieu Inconnu Windows 10 ║
|
|
║ ║
|
|
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 📦 PHASE 1: PRÉPARATION (Avant de Partir) │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
✅ Package Complet
|
|
├── nodejs-portable/ (50 MB)
|
|
├── node_modules/ (100 MB) ← PRÉ-INSTALLER !
|
|
├── DIAGNOSTIC.bat ← Détection automatique
|
|
├── START_PORTABLE_SAFE.bat ← Lancement sécurisé
|
|
├── LISEZMOI.txt ← Guide utilisateur
|
|
├── DEPLOYMENT_GUIDE.md ← Troubleshooting complet
|
|
└── DEPLOYMENT_CHECKLIST.md ← Checklist étape par étape
|
|
|
|
✅ Test Local
|
|
└── Tester TOUT avant de partir
|
|
└── Sur votre machine → Sur Desktop/TEST/ → Valider
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 🔍 PHASE 2: DIAGNOSTIC (Sur Place) │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
Double-clic: DIAGNOSTIC.bat
|
|
|
|
┌────────────────────────────────────────────┐
|
|
│ Vérifie 9 points critiques: │
|
|
│ 1. Windows 10 │
|
|
│ 2. Node.js portable fonctionne │
|
|
│ 3. NPM disponible │
|
|
│ 4. Fichiers projet présents │
|
|
│ 5. Port 8080 libre │
|
|
│ 6. Permissions d'écriture │
|
|
│ 7. État du firewall │
|
|
│ 8. Firefox disponible (CRITIQUE!) │
|
|
│ 9. Blocage antivirus │
|
|
└────────────────────────────────────────────┘
|
|
|
|
Résultats:
|
|
|
|
┌─────────────────┬──────────────────────────────────────────┐
|
|
│ [SUCCESS] │ → Tout OK, lancer START_PORTABLE_SAFE │
|
|
├─────────────────┼──────────────────────────────────────────┤
|
|
│ [CAUTION] │ → Warnings mais devrait marcher │
|
|
│ (1-3 warnings) │ → Continuer avec surveillance │
|
|
├─────────────────┼──────────────────────────────────────────┤
|
|
│ [FAILURE] │ → STOP ! Corriger avant de lancer │
|
|
│ (1+ errors) │ → Consulter DEPLOYMENT_GUIDE.md │
|
|
└─────────────────┴──────────────────────────────────────────┘
|
|
|
|
Génère: DIAGNOSTIC_REPORT.txt (pour support IT si besoin)
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 🚀 PHASE 3: DÉMARRAGE SÉCURISÉ │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
Double-clic: START_PORTABLE_SAFE.bat
|
|
|
|
Améliorations vs START_PORTABLE.bat standard:
|
|
|
|
┌────────────────────────────────────────────────────────────────────┐
|
|
│ ✅ Vérification Node.js + messages d'erreur détaillés │
|
|
│ ✅ Installation deps AVEC vérification de succès │
|
|
│ ✅ Kill CIBLÉ du port (pas tous les node.exe) │
|
|
│ ✅ Détection si autre programme utilise le port │
|
|
│ ✅ Logging automatique (logs/server.log) │
|
|
│ ✅ Attente INTELLIGENTE du serveur (ping HTTP, pas juste timeout) │
|
|
│ ✅ Timeout de 10s avec compteur │
|
|
│ ✅ Cleanup propre sur erreur │
|
|
│ ✅ Messages d'erreur avec SOLUTIONS │
|
|
└────────────────────────────────────────────────────────────────────┘
|
|
|
|
Progression visible:
|
|
|
|
[1/7] Checking Node.js... → Existe et fonctionne ?
|
|
[2/7] Checking dependencies... → Présentes ou installer
|
|
[3/7] Checking port 8080... → Libre ou libérer
|
|
[4/7] Verifying project files... → Intégrité projet
|
|
[5/7] Starting server... → Lancement avec log
|
|
[6/7] Waiting for server... → Ping HTTP (max 10s)
|
|
[7/7] Opening browser... → Firefox puis fallback
|
|
|
|
┌─────────────────────────────────────────────┐
|
|
│ SUCCESS! Server is running │
|
|
│ URL: http://localhost:8080 │
|
|
│ Logs: logs\server.log │
|
|
└─────────────────────────────────────────────┘
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 🔧 PLAN B: PROBLÈMES COURANTS │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
╔════════════════════════════════════════════════════════════════════╗
|
|
║ PROBLÈME 1: "Node.js exists but won't run" ║
|
|
╚════════════════════════════════════════════════════════════════════╝
|
|
|
|
Plan B1: Antivirus bloque
|
|
└─→ Ajouter exception pour dossier complet
|
|
|
|
Plan B2: Pas de droits
|
|
└─→ Clic droit "Exécuter en tant qu'administrateur"
|
|
|
|
Plan B3: Runtime manquant
|
|
└─→ Installer Visual C++ Redistributable
|
|
|
|
───────────────────────────────────────────────────────────────────────
|
|
|
|
╔════════════════════════════════════════════════════════════════════╗
|
|
║ PROBLÈME 2: "Port 8080 used by another program" ║
|
|
╚════════════════════════════════════════════════════════════════════╝
|
|
|
|
Plan B1: Tuer le processus
|
|
└─→ Script le fait automatiquement SI c'est un node.exe
|
|
└─→ Sinon: message d'erreur avec PID du coupable
|
|
|
|
Plan B2: Changer le port
|
|
└─→ Éditer server.js: PORT = 8081
|
|
|
|
───────────────────────────────────────────────────────────────────────
|
|
|
|
╔════════════════════════════════════════════════════════════════════╗
|
|
║ PROBLÈME 3: "Server did not start within 10 seconds" ║
|
|
╚════════════════════════════════════════════════════════════════════╝
|
|
|
|
Plan B1: Vérifier les logs
|
|
└─→ type logs\server.log
|
|
└─→ Script le fait automatiquement en cas d'erreur
|
|
|
|
Plan B2: Dépendances manquantes
|
|
└─→ Si node_modules/ inclus → Pas censé arriver
|
|
└─→ Sinon: npm install (nécessite internet)
|
|
|
|
───────────────────────────────────────────────────────────────────────
|
|
|
|
╔════════════════════════════════════════════════════════════════════╗
|
|
║ PROBLÈME 4: "Firefox not found" / "Browser doesn't open" ║
|
|
╚════════════════════════════════════════════════════════════════════╝
|
|
|
|
⚠️ CRITIQUE: Edge et Chrome NE FONCTIONNENT PAS
|
|
✅ UNIQUEMENT Firefox compatible
|
|
|
|
Plan B1: Installer Firefox
|
|
└─→ Télécharger depuis mozilla.org
|
|
└─→ Ou demander à l'IT
|
|
|
|
Plan B2: Firefox Portable (pas de droits admin)
|
|
└─→ Télécharger Firefox Portable
|
|
└─→ Extraire et lancer FirefoxPortable.exe
|
|
|
|
Plan B3: Ouverture manuelle
|
|
└─→ Laisser console ouverte
|
|
└─→ Ouvrir FIREFOX → http://localhost:8080
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 🎯 PLAN C: ÉCHEC TOTAL │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
Si après 30-60 minutes RIEN ne marche:
|
|
|
|
1. Collecter les preuves
|
|
├─ DIAGNOSTIC_REPORT.txt
|
|
├─ logs\server.log
|
|
└─ Screenshots des erreurs
|
|
|
|
2. Contacter IT/Support
|
|
└─ Expliquer: "Application éducative locale"
|
|
└─ Montrer les diagnostics
|
|
└─ Demander assistance
|
|
|
|
3. Chercher une autre machine
|
|
└─ PC avec moins de restrictions
|
|
└─ Refaire déploiement complet
|
|
|
|
4. Fallback Python (si disponible)
|
|
└─ python -m http.server 8080
|
|
└─ Fonctionnalité limitée mais accès aux fichiers
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 📊 PROBABILITÉS DE SUCCÈS │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
Environnement standard (Windows 10 perso):
|
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 95% ✅
|
|
|
|
Environnement entreprise standard:
|
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 75% ⚠️
|
|
|
|
Environnement très restreint (école/gouv):
|
|
━━━━━━━━━━━━━━━━━━━━ 50% ⚠️
|
|
|
|
Environnement ultra-sécurisé:
|
|
━━━━━━━━━━ 25% ❌
|
|
|
|
AVEC node_modules pré-installés: +20%
|
|
AVEC administrateur: +15%
|
|
AVEC exclusion antivirus: +10%
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ ⏱️ TEMPS ESTIMÉS │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
Scénario Idéal (tout fonctionne):
|
|
├─ Installation/Copie: 5 min
|
|
├─ Diagnostic: 2 min
|
|
├─ Démarrage: 3 min
|
|
├─ Tests: 5 min
|
|
└─ TOTAL: ~15 minutes ✅
|
|
|
|
Scénario Normal (1-2 problèmes mineurs):
|
|
├─ Installation/Copie: 5 min
|
|
├─ Diagnostic: 2 min
|
|
├─ Problème + correction: 10-15 min
|
|
├─ Démarrage: 3 min
|
|
├─ Tests: 5 min
|
|
└─ TOTAL: ~25-30 minutes ⚠️
|
|
|
|
Scénario Difficile (problèmes multiples):
|
|
├─ Installation/Copie: 5 min
|
|
├─ Diagnostic: 2 min
|
|
├─ Problèmes + troubleshooting: 30-45 min
|
|
├─ Démarrage: 3 min
|
|
├─ Tests: 5 min
|
|
└─ TOTAL: ~45-60 minutes ⚠️
|
|
|
|
Scénario Échec:
|
|
└─ Abandonner après 1 heure ❌
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 🎁 CE QUI FAIT LA DIFFÉRENCE │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
✅ CRITIQUES (Must-have):
|
|
├── node_modules/ PRÉ-INSTALLÉS (évite 80% des problèmes)
|
|
├── DIAGNOSTIC.bat (détection avant crash)
|
|
├── START_PORTABLE_SAFE.bat (gestion d'erreurs)
|
|
└── Logs automatiques (debug facile)
|
|
|
|
⚠️ IMPORTANTS (Should-have):
|
|
├── DEPLOYMENT_GUIDE.md (résolution de problèmes)
|
|
├── DEPLOYMENT_CHECKLIST.md (process clair)
|
|
└── LISEZMOI.txt (utilisateur final)
|
|
|
|
💡 BONUS (Nice-to-have):
|
|
├── Droits administrateur
|
|
├── Exclusion antivirus
|
|
└── Connexion internet (backup)
|
|
|
|
|
|
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
║ ║
|
|
║ 🎯 RÉSUMÉ DE LA STRATÉGIE ║
|
|
║ ║
|
|
║ 1. PRÉPARER un package complet (node_modules inclus) ║
|
|
║ 2. DIAGNOSTIQUER avant de lancer ║
|
|
║ 3. LANCER avec gestion d'erreurs robuste ║
|
|
║ 4. LOGGER tout pour faciliter debug ║
|
|
║ 5. DOCUMENTER chaque problème et solution ║
|
|
║ ║
|
|
║ → Défense en profondeur = Maximiser les chances de succès ║
|
|
║ ║
|
|
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ 📚 DOCUMENTATION DISPONIBLE │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
LISEZMOI.txt → Guide rapide utilisateur final
|
|
DEPLOYMENT_GUIDE.md → Troubleshooting complet
|
|
DEPLOYMENT_CHECKLIST.md → Checklist étape par étape
|
|
PLAN_B_STRATEGY.txt → Ce fichier (vue d'ensemble)
|
|
|
|
DIAGNOSTIC.bat → Script de diagnostic
|
|
START_PORTABLE_SAFE.bat → Script de lancement sécurisé
|
|
START_PORTABLE.bat → Script original (backup)
|
|
|
|
DIAGNOSTIC_REPORT.txt → Généré par diagnostic
|
|
logs/server.log → Généré au démarrage
|
|
|
|
|
|
┌──────────────────────────────────────────────────────────────────────────────┐
|
|
│ ✅ VALIDATION FINALE │
|
|
└──────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
Avant de dire "C'est bon":
|
|
|
|
□ DIAGNOSTIC.bat → [SUCCESS] ou [CAUTION] acceptable
|
|
□ START_PORTABLE_SAFE.bat → Affiche "SUCCESS! Server is running"
|
|
□ http://localhost:8080 → Page charge dans le navigateur
|
|
□ Navigation → Fonctionne sans erreurs console
|
|
□ Exercice test → Une fonctionnalité marche
|
|
□ Arrêt (touche dans console) → Serveur s'arrête proprement
|
|
□ Redémarrage → L'application redémarre sans problème
|
|
|
|
SI TOUS COCHÉS → Déploiement validé ✅
|
|
SINON → Consulter DEPLOYMENT_GUIDE.md
|
|
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|
|
|
|
Bonne chance ! 🚀
|
|
|
|
═══════════════════════════════════════════════════════════════════════════════
|