# 🔧 DÉPANNAGE - SPOTIFY LE 2 > **Solutions aux problĂšmes les plus courants** --- ## đŸȘŸ Windows ### ❌ "python n'est pas reconnu" **Solution:** 1. TĂ©lĂ©chargez Python 3.11+ sur https://www.python.org/downloads/ 2. **IMPORTANT** Cochez "Add Python to PATH" 3. RedĂ©marrez votre terminal **VĂ©rification:** ```cmd python --version ``` --- ### ❌ "flutter n'est pas reconnu" **Solution:** 1. TĂ©lĂ©chargez Flutter: https://docs.flutter.dev/get-started/install/windows 2. Ajoutez Flutter au PATH: - Variables d'environnement - Nouvelle variable systĂšme: `Path` - Ajoutez: `C:\Path\Vers\flutter\bin` 3. RedĂ©marrez votre terminal **VĂ©rification:** ```cmd flutter --version ``` --- ### ❌ "docker: command not found" **Solution:** 1. TĂ©lĂ©chargez Docker Desktop: https://www.docker.com/products/docker-desktop/ 2. Installez-le 3. **RedĂ©marrez votre ordinateur** 4. Lancez Docker Desktop **VĂ©rification:** ```cmd docker --version docker ps ``` --- ### ❌ "Port 8000 dĂ©jĂ  utilisĂ©" **Solution 1 - Trouver le processus:** ```cmd netstat -ano | findstr :8000 taskkill /PID /F ``` **Solution 2 - Changer le port:** ```cmd cd backend uvicorn app.main:app --port 8001 ``` Et mettez Ă  jour `frontend/lib/core/constants/api_constants.dart`: ```dart const String baseUrl = 'http://localhost:8001/api/v1'; ``` --- ### ❌ "La base de donnĂ©es ne se connecte pas" **Solution:** 1. VĂ©rifiez que Docker Desktop tourne 2. Lancer: ```cmd cd docker docker-compose down docker-compose up -d ``` 3. VĂ©rifiez: ```cmd docker-compose ps ``` Doit montrer `postgres` et `redis` comme "Up" --- ### ❌ "Le frontend ne se compile pas" **Solution:** ```cmd cd frontend flutter clean flutter pub get flutter run ``` --- ### ❌ "Erreur SSL / Certificate" **Solution:** ```cmd cd backend set PYTHONHTTPSVERIFY=0 uvicorn app.main:app --reload ``` --- ## 🐧 Linux ### ❌ "Permission denied" **Solution:** ```bash chmod +x INSTALL.sh START.sh ``` ### ❌ "docker: Permission denied" **Solution:** ```bash sudo usermod -aG docker $USER # DĂ©connectez-vous et reconnectez-vous ``` ### ❌ "Port 8000 dĂ©jĂ  utilisĂ©" **Solution:** ```bash # Trouver le processus lsof -i :8000 kill -9 # Ou changer le port uvicorn app.main:app --port 8001 ``` --- ## 🍎 macOS ### ❌ "flutter: command not found" **Solution:** ```bash # Ajouter Flutter au PATH export PATH="$PATH:`pwd`/flutter/bin" # Permanent (ajouter Ă  ~/.zshrc ou ~/.bash_profile) echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.zshrc source ~/.zshrc ``` --- ## 🐛 ProblĂšmes Backend ### ❌ "ModuleNotFoundError: No module named 'fastapi'" **Solution:** ```bash cd backend source venv/bin/activate # Linux/Mac venv\Scripts\activate # Windows pip install -r requirements.txt ``` ### ❌ "SyntaxError: parameter without a default" **Solution:** CorrigĂ© ! VĂ©rifiez que vous avez la derniĂšre version du code. ### ❌ "relation 'users' does not exist" **Solution:** ```bash cd backend python -c "from app.core.database import init_db; import asyncio; asyncio.run(init_db())" ``` --- ## đŸ“± ProblĂšmes Frontend ### ❌ "Bad state: Cannot find a Flutter SDK" **Solution:** ```bash flutter config --clear-features flutter doctor ``` ### ❌ "No device found" **Solution:** ```bash flutter devices # Activer un appareil ou Ă©mulateur flutter devices flutter run -d ``` ### ❌ "Could not resolve package" **Solution:** ```bash cd frontend flutter clean flutter pub get flutter pub upgrade ``` --- ## 🌐 RĂ©seau ### ❌ "Connection refused" sur localhost:8000 **VĂ©rifiez:** 1. Backend lancĂ©? (Terminal backend ouvert) 2. Bon port? (http://localhost:8000) 3. Firewall? (Autorisez Python) **Test:** ```cmd curl http://localhost:8000/docs ``` Doit afficher la page Swagger UI. --- ### ❌ "CORS error" dans le navigateur **Solution:** DĂ©jĂ  configurĂ© dans le backend ! VĂ©rifiez: - `backend/app/core/config.py` → `CORS_ORIGINS` - Doit inclure `http://localhost:8000` --- ## 🎬 RedĂ©marrage Complet Si rien ne fonctionne: ```bash # ArrĂȘter tout cd docker docker-compose down # Nettoyer cd .. cd backend rm -rf venv python -m venv venv # RĂ©installer ./INSTALL.sh # ou INSTALL_WINDOWS.bat # RedĂ©marrer ./START.sh # ou START_WINDOWS.bat ``` --- ## 📞 Aide DĂ©taillĂ©e 1. **Logs Backend** → Terminal backend (erreurs en rouge) 2. **Logs Frontend** → `flutter run` (erreurs en rouge) 3. **Docker Logs** → `docker-compose logs` 4. **API Documentation** → http://localhost:8000/docs --- ## ✅ VĂ©rification ComplĂšte Lancez **`CHECK.bat`** (Windows) pour un diagnostic complet ! Il vĂ©rifie: - ✅ Python installĂ© - ✅ Git installĂ© - ✅ Docker installĂ© et tourne - ✅ Flutter installĂ© - ✅ Backend configurĂ© - ✅ Infrastructure Docker tourne - ✅ Frontend dĂ©pendances installĂ©es - ✅ Backend API rĂ©pond - ✅ Ports disponibles --- **Toujours bloquĂ©?** 1. Lancez `CHECK.bat` et regardez les erreurs 2. Consultez `INSTALLATION.md` 3. VĂ©rifiez les logs dans les terminaux 4. RedĂ©marrez Docker Desktop --- **Bon courage ! 🚀**