9c504d2c3d
Features: - Frontend Flutter avec thème néon cyberpunk - Backend FastAPI avec streaming YouTube - Base de données PostgreSQL + Redis - Authentification JWT complète - Recherche multi-source (DB + YouTube) - Playlists CRUD avec drag & drop - Queue management - Settings avec audio quality - Interface adaptative (Desktop + Mobile) Tech Stack: - Frontend: Flutter 3.2+, Riverpod - Backend: Python 3.11+, FastAPI - Database: PostgreSQL 15+ - Cache: Redis 7+ - Streaming: yt-dlp + FFmpeg 🚀 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
309 lines
5.0 KiB
Markdown
309 lines
5.0 KiB
Markdown
# 🔧 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 <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 <PID>
|
|
|
|
# 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 <device-id>
|
|
```
|
|
|
|
### ❌ "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 ! 🚀**
|