# 🚀 DĂ©marrage Rapide - Docker Guide ultra-rapide pour lancer Linux BenchTools avec le module PĂ©riphĂ©riques dans Docker. ## ⚡ En 3 commandes ```bash # 1. Cloner et entrer dans le dĂ©pĂŽt git clone && cd serv_benchmark # 2. Lancer Docker Compose docker-compose up -d --build # 3. AccĂ©der Ă  l'interface # Frontend : http://localhost:8087 # API Docs : http://localhost:8007/docs ``` **C'est tout !** Le module pĂ©riphĂ©riques est activĂ© par dĂ©faut. ## 📍 URLs importantes | Service | URL | Description | |---------|-----|-------------| | **Frontend principal** | http://localhost:8087 | Dashboard benchmarks | | **Module PĂ©riphĂ©riques** | http://localhost:8087/peripherals.html | Inventaire pĂ©riphĂ©riques | | **API Backend** | http://localhost:8007 | API REST | | **API Docs (Swagger)** | http://localhost:8007/docs | Documentation interactive | | **Stats PĂ©riphĂ©riques** | http://localhost:8007/api/peripherals/statistics/summary | Statistiques JSON | ## 🔍 VĂ©rifier que tout fonctionne ```bash # Healthcheck backend curl http://localhost:8007/api/health # ✅ {"status":"ok"} # Stats pĂ©riphĂ©riques curl http://localhost:8007/api/peripherals/statistics/summary # ✅ {"total_peripherals":0,"en_pret":0,"disponible":0,...} # Logs backend docker-compose logs backend | tail -20 # Vous devriez voir : # ✅ Main database initialized # ✅ Peripherals database initialized # ✅ Peripherals upload directories created ``` ## 📂 Fichiers créés automatiquement AprĂšs le premier dĂ©marrage, vous aurez : ``` serv_benchmark/ ├── backend/data/ │ ├── data.db # ✅ Créé automatiquement │ └── peripherals.db # ✅ Créé automatiquement │ └── uploads/ └── peripherals/ # ✅ Créé automatiquement ├── photos/ ├── documents/ └── locations/ ``` ## 🎯 Premiers pas ### 1. Ajouter votre premier pĂ©riphĂ©rique **Via l'interface web :** 1. Aller sur http://localhost:8087/peripherals.html 2. Cliquer sur "Ajouter un pĂ©riphĂ©rique" 3. Remplir le formulaire 4. Enregistrer **Via l'API (curl) :** ```bash curl -X POST http://localhost:8007/api/peripherals \ -H "Content-Type: application/json" \ -d '{ "nom": "Logitech MX Master 3", "type_principal": "USB", "sous_type": "Souris", "marque": "Logitech", "modele": "MX Master 3", "prix": 99.99, "etat": "Neuf", "rating": 5.0, "quantite_totale": 1, "quantite_disponible": 1 }' ``` ### 2. Importer un pĂ©riphĂ©rique USB **MĂ©thode automatique :** ```bash # Sur votre machine, rĂ©cupĂ©rer les infos USB lsusb -v > /tmp/usb_info.txt # Uploader via l'API curl -X POST http://localhost:8007/api/peripherals/import/usb \ -F "lsusb_output=@/tmp/usb_info.txt" ``` **MĂ©thode via interface :** 1. ExĂ©cuter `lsusb -v` dans un terminal 2. Copier toute la sortie 3. Sur http://localhost:8087/peripherals.html 4. Cliquer "Importer USB" 5. Coller la sortie 6. Valider ### 3. CrĂ©er une localisation ```bash curl -X POST http://localhost:8007/api/locations \ -H "Content-Type: application/json" \ -d '{ "nom": "Bureau", "type": "piece", "description": "Bureau principal" }' ``` ## đŸ› ïž Personnalisation ### Modifier les types de pĂ©riphĂ©riques Éditer `config/peripheral_types.yaml` et redĂ©marrer : ```bash nano config/peripheral_types.yaml docker-compose restart backend ``` ### Ajuster la compression d'images Éditer `config/image_processing.yaml` : ```yaml image_processing: compression: quality: 85 # 1-100 (dĂ©faut: 85) ``` ```bash docker-compose restart backend ``` ### DĂ©sactiver le module pĂ©riphĂ©riques Dans `.env` : ```bash PERIPHERALS_MODULE_ENABLED=false ``` ```bash docker-compose restart backend ``` ## 🐛 ProblĂšmes courants ### Le module ne se charge pas ```bash # VĂ©rifier les logs docker-compose logs backend | grep -i peripheral # Forcer la recrĂ©ation de la DB docker-compose exec backend rm /app/data/peripherals.db docker-compose restart backend ``` ### Erreur Pillow/QRCode ```bash # Rebuild complet docker-compose down docker-compose build --no-cache backend docker-compose up -d ``` ### Permissions uploads ```bash # VĂ©rifier les permissions docker-compose exec backend ls -la /app/uploads/ # Les crĂ©er manuellement si besoin mkdir -p uploads/peripherals/{photos,documents,locations/images,locations/qrcodes} chmod -R 755 uploads/ ``` ## 📊 Commandes utiles ```bash # Voir tous les conteneurs docker-compose ps # Logs en temps rĂ©el docker-compose logs -f # RedĂ©marrer un service docker-compose restart backend # ArrĂȘter tout docker-compose down # Rebuild et redĂ©marrer docker-compose up -d --build # Shell dans le backend docker-compose exec backend /bin/bash # Taille des bases de donnĂ©es docker-compose exec backend du -h /app/data/*.db # Backup rapide docker-compose exec backend tar -czf /tmp/backup.tar.gz /app/data/ docker cp linux_benchtools_backend:/tmp/backup.tar.gz ./backup.tar.gz ``` ## 📚 Documentation complĂšte - **Module PĂ©riphĂ©riques** : [README_PERIPHERALS.md](README_PERIPHERALS.md) - **DĂ©ploiement Docker** : [DOCKER_DEPLOYMENT.md](DOCKER_DEPLOYMENT.md) - **README principal** : [README.md](README.md) - **Changelog** : [CHANGELOG.md](CHANGELOG.md) ## 🎉 Prochaines Ă©tapes 1. ✅ Ajouter vos pĂ©riphĂ©riques 2. ✅ CrĂ©er vos localisations 3. ✅ Importer vos pĂ©riphĂ©riques USB 4. ✅ Uploader photos et documents 5. ✅ GĂ©nĂ©rer des QR codes pour les localisations 6. ✅ GĂ©rer les prĂȘts de matĂ©riel --- **Besoin d'aide ?** Consultez la documentation complĂšte ou ouvrez une issue.