# 🚀 Commandes rapides - START ICI ## ⚡ DĂ©marrage rapide (3 commandes) ```bash # 1. Aller dans le dossier cd /mnt/e/My\ IA # 2. Tuer l'ancien processus sur le port 9001 (si existant) fuser -k 9001/tcp 2>/dev/null # 3. Tout lancer bash start.sh ``` **Ouvrir dans le navigateur** : http://localhost:9000 --- ## đŸ”„ Si le script ne marche pas : Lancement manuel ### Terminal 1 : Backend ```bash cd /mnt/e/My\ IA/backend # CrĂ©er venv si pas fait python3 -m venv venv # Activer . venv/bin/activate # Installer dĂ©pendances pip install -r requirements.txt # LANCER python main.py ``` Tu verras : ``` INFO: Uvicorn running on http://0.0.0.0:9001 ``` ### Terminal 2 : Frontend ```bash cd /mnt/e/My\ IA/frontend # LANCER python3 -m http.server 9000 ``` ### Navigateur Ouvrir : **http://localhost:9000** --- ## 🛑 ArrĂȘter tout ```bash # MĂ©thode 1 : Script bash stop.sh # MĂ©thode 2 : Tuer les processus pkill -f "python main.py" pkill -f "http.server 9000" pkill ollama # MĂ©thode 3 : Par port fuser -k 9001/tcp # Backend fuser -k 9000/tcp # Frontend ``` --- ## 🔍 VĂ©rifier que tout tourne ```bash # Backend (doit retourner du JSON) curl http://localhost:9001/health # Frontend (doit retourner du HTML) curl http://localhost:9000 | head -5 # Ollama curl http://localhost:11434/api/tags # Tout en un cat > check.sh << 'EOF' #!/bin/bash echo "Backend (9001):" curl -s http://localhost:9001/health | python3 -m json.tool 2>/dev/null || echo "❌ Non accessible" echo -e "\nFrontend (9000):" curl -s http://localhost:9000 | grep -q "/dev/null | head -3 || echo "❌ Non accessible" EOF chmod +x check.sh bash check.sh ``` --- ## 💡 Ports utilisĂ©s | Service | Port | URL | |----------|------|-------------------------------| | Backend | 9001 | http://localhost:9001 | | Frontend | 9000 | http://localhost:9000 | | Ollama | 11434| http://localhost:11434 | --- ## 🐛 RĂ©solution de problĂšmes ### Erreur : Address already in use ```bash # Trouver ce qui utilise le port lsof -i :9001 # Tuer le processus fuser -k 9001/tcp # Ou tuer par PID kill ``` ### Backend ne dĂ©marre pas ```bash # Voir les erreurs cd backend . venv/bin/activate python main.py # RĂ©installer les dĂ©pendances pip install --upgrade -r requirements.txt ``` ### Frontend affiche page blanche ```bash # VĂ©rifier que index.html existe ls -la frontend/index.html # Si non, retĂ©lĂ©charger l'archive ``` ### WebSocket ne connecte pas Le backend doit tourner **avant** d'ouvrir le frontend. 1. Lancer le backend 2. Attendre le message "Uvicorn running" 3. Puis ouvrir http://localhost:9000 --- ## ✅ Checklist avant de commencer - [ ] WSL2 installĂ© - [ ] Python 3.10+ : `python3 --version` - [ ] Ollama installĂ© : `which ollama` - [ ] ModĂšle tĂ©lĂ©chargĂ© : `ollama list` - [ ] Fichiers prĂ©sents : `ls -la frontend/index.html` - [ ] Ports libres : `lsof -i :9000` et `lsof -i :9001` → rien --- ## đŸ“± Ouvrir dans le navigateur (Windows) ```bash # Depuis WSL cmd.exe /c start http://localhost:9000 # Ou taper directement dans Windows : # http://localhost:9000 ``` --- ## 🎯 Si TOUT Ă©choue : RĂ©installation propre ```bash # 1. Tout arrĂȘter bash stop.sh pkill -9 python pkill -9 ollama # 2. Nettoyer rm -rf backend/venv rm /tmp/*.log rm /tmp/ai-assistant-*.pid # 3. RetĂ©lĂ©charger l'archive # TĂ©lĂ©charger ai-code-assistant.zip # 4. Extraire proprement unzip -o ai-code-assistant.zip cd ai-code-assistant # 5. Lancer chmod +x *.sh bash start.sh ``` --- **EN CAS DE DOUTE : Lance les commandes du Lancement manuel (Terminal 1 + Terminal 2)** C'est la mĂ©thode la plus fiable pour voir exactement ce qui se passe ! 🎉