# Guide de Test Rapide - ChartBastan 🚀 **DĂ©marrage rapide pour tester l'application complĂšte** --- ## 📋 PrĂ©requis Avant de commencer, assurez-vous d'avoir: - ✅ Node.js 20+ ([TĂ©lĂ©charger](https://nodejs.org/)) - ✅ Python 3.11+ ([TĂ©lĂ©charger](https://www.python.org/)) - ✅ Git (optionnel) **VĂ©rifier les versions:** ```bash node --version # Doit ĂȘtre 20+ python --version # Doit ĂȘtre 3.11+ ``` --- ## 🚀 DĂ©marrage en 3 Étapes ### Étape 1: Installer les DĂ©pendances Backend ```bash cd backend pip install -r requirements.txt ``` ### Étape 2: Installer les DĂ©pendances Frontend ```bash cd ../chartbastan npm install ``` ### Étape 3: DĂ©marrer les Deux Serveurs **Terminal 1 - Backend:** ```bash cd backend python -m uvicorn app.main:app --reload --port 8000 ``` Le backend dĂ©marre sur: **http://localhost:8000** **Terminal 2 - Frontend:** ```bash cd chartbastan npm run dev ``` Le frontend dĂ©marre sur: **http://localhost:3000** --- ## 🎯 Tester l'Application 1. **Ouvrir votre navigateur** sur http://localhost:3000 2. **Page d'accueil** s'affiche avec le branding ChartBastan 3. **Tester l'inscription** → CrĂ©er un compte 4. **Tester le login** → Se connecter 5. **Explorer le dashboard** → Voir les matchs et prĂ©dictions --- ## đŸ§Ș FonctionnalitĂ©s Ă  Tester ### 1. Authentification - [ ] Inscription d'un utilisateur - [ ] Connexion avec identifiants valides - [ ] DĂ©connexion - [ ] Rester connectĂ© (session persistence) ### 2. Dashboard Principal - [ ] Affichage des matchs actuels - [ ] Graphique d'Ă©nergie en temps rĂ©el - [ ] Mise Ă  jour automatique (pull-to-refresh) ### 3. PrĂ©dictions - [ ] Faire une prĂ©diction sur un match - [ ] Voir les scores de confiance - [ ] Voir l'Ă©nergie collective calculĂ©e - [ ] Historique des prĂ©dictions ### 4. Classement (Leaderboard) - [ ] Voir le Top 100 - [ ] Voir son propre rang - [ ] Comparer avec d'autres utilisateurs ### 5. Badges et Gamification - [ ] Voir les badges obtenus - [ ] Progression des badges - [ ] Partager les succĂšs ### 6. Notifications - [ ] Activer les notifications - [ ] Recevoir des notifications de prĂ©dictions - [ ] GĂ©rer les prĂ©fĂ©rences de notification ### 7. Historique - [ ] Voir l'historique des prĂ©dictions - [ ] Voir le taux de prĂ©cision - [ ] Comparer les rĂ©sultats avec l'Ă©nergie collective ### 8. Parrainage - [ ] GĂ©nĂ©rer un lien de parrainage - [ ] Voir les rĂ©compenses ### 9. Comparaison Énergie vs Stats - [ ] Voir la comparaison Ă©nergie/stats - [ ] Graphiques comparatifs - [ ] Performance historique --- ## 🔧 Configuration Optionnelle ### API Documentation Le backend fournit une documentation interactive: - **Swagger UI:** http://localhost:8000/docs - **ReDoc:** http://localhost:8000/redoc ### Base de DonnĂ©es La base de donnĂ©es SQLite est créée automatiquement: - Chemin: `chartbastan/chartbastan.db` - RĂ©initialiser: Supprimer le fichier `.db` et redĂ©marrer ### Workers Asynchrones Les workers sont optionnels (pour scraping asynchrone): ```bash # Scraper worker cd backend python workers/run_scraping_worker.py # Sentiment worker python workers/run_sentiment_worker.py # Energy worker python workers/run_energy_worker.py ``` --- ## 📊 Structure des DonnĂ©es ### Tables Principales - **users** - Utilisateurs authentifiĂ©s - **matches** - Matchs de football - **predictions** - PrĂ©dictions du systĂšme - **user_predictions** - PrĂ©dictions utilisateurs - **tweets** - DonnĂ©es Twitter scrapĂ©es - **reddit_posts** - DonnĂ©es Reddit scrapĂ©es - **sentiment_scores** - Scores de sentiment - **energy_scores** - Scores d'Ă©nergie collective --- ## 🐛 DĂ©pannage Rapide ### Backend ne dĂ©marre pas ```bash # VĂ©rifier si le port 8000 est utilisĂ© # Windows: netstat -ano | findstr :8000 # Linux/Mac: lsof -ti:8000 | xargs kill -9 # RĂ©essayer python -m uvicorn app.main:app --reload --port 8000 ``` ### Frontend ne dĂ©marre pas ```bash # Nettoyer node_modules rm -rf node_modules npm install # RĂ©essayer npm run dev ``` ### Erreur de connexion Frontend-Backend ```bash # VĂ©rifier que backend tourne sur http://localhost:8000 curl http://localhost:8000/api/health # VĂ©rifier la configuration frontend cat chartbastan/.env.local # Doit contenir: NEXT_PUBLIC_API_URL=http://localhost:8000 ``` ### Base de donnĂ©es vide ```bash cd backend # Appliquer les migrations alembic upgrade head # GĂ©nĂ©rer des donnĂ©es de test python scripts/generate_historical_matches.py ``` --- ## 📝 Commandes Utiles ### Backend ```bash cd backend # Linter flake8 . # Formatage black . # Tests pytest tests/ -v # Migrations alembic upgrade head ``` ### Frontend ```bash cd chartbastan # Linter npm run lint # Type checking npm run type-check # Tests npm run test # Build npm run build ``` --- ## 🎹 Personnalisation ### Changer le Port Frontend ```bash cd chartbastan npm run dev -- -p 3001 ``` Mettre Ă  jour `.env.local`: ```bash NEXT_PUBLIC_API_URL=http://localhost:8000 NEXT_PUBLIC_PORT=3001 ``` ### Changer le Port Backend ```bash cd backend python -m uvicorn app.main:app --reload --port 8001 ``` Mettre Ă  jour `chartbastan/.env.local`: ```bash NEXT_PUBLIC_API_URL=http://localhost:8001 ``` --- ## 📚 Documentation ComplĂšte Pour plus de dĂ©tails sur l'architecture et l'implĂ©mentation: - **Documentation complĂšte:** `docs/` (ce dossier) - **PRD:** `_bmad-output/planning-artifacts/prd.md` - **Architecture:** `_bmad-output/planning-artifacts/architecture.md` - **Artefacts d'implĂ©mentation:** `_bmad-output/implementation-artifacts/` (38 fichiers) --- ## ✅ Checklist Avant le Test - [ ] Node.js 20+ installĂ© - [ ] Python 3.11+ installĂ© - [ ] DĂ©pendances backend installĂ©es (`pip install -r requirements.txt`) - [ ] DĂ©pendances frontend installĂ©es (`npm install`) - [ ] Backend dĂ©marrĂ© sur le port 8000 - [ ] Frontend dĂ©marrĂ© sur le port 3000 - [ ] Navigateur ouvert sur http://localhost:3000 --- ## 🎉 Bon Testing! L'application est complĂšte et tous les epics sont implĂ©mentĂ©s. Profitez de l'expĂ©rience ChartBastan! **Pour des questions ou des problĂšmes:** - Consultez la documentation Swagger: http://localhost:8000/docs - VĂ©rifiez les logs dans les terminaux - Consultez les artefacts d'implĂ©mentation dans `_bmad-output/` --- **Date de crĂ©ation:** 2026-01-18 **Version:** 0.1.0 **Statut:** Tous les Ă©pics complĂ©tĂ©s âœ