362 lines
10 KiB
Markdown
362 lines
10 KiB
Markdown
# Documentation ChartBastan
|
|
|
|
đŻ **Plateforme de prĂ©diction sportive basĂ©e sur l'analyse de l'Ă©nergie collective des rĂ©seaux sociaux**
|
|
|
|
---
|
|
|
|
## đ Vue d'ensemble
|
|
|
|
**Type de référentiel:** Multi-part (Frontend + Backend séparés)
|
|
|
|
**Parties du projet:**
|
|
- **Partie 1:** Frontend Next.js (chartbastan/)
|
|
- **Partie 2:** Backend FastAPI (backend/)
|
|
|
|
**Langage principal:**
|
|
- Frontend: TypeScript (Next.js 16.1.3)
|
|
- Backend: Python (FastAPI 0.128.0)
|
|
|
|
**Architecture:** Client-serveur avec REST API
|
|
|
|
---
|
|
|
|
## đ DĂ©marrage Rapide
|
|
|
|
### Pour Tester l'Application
|
|
|
|
đ **[README de Test Rapide](./README-TEST.md)** - Guide en 3 Ă©tapes pour dĂ©marrer l'application
|
|
|
|
**Démarrage rapide:**
|
|
|
|
```bash
|
|
# Terminal 1 - Backend
|
|
cd backend
|
|
pip install -r requirements.txt
|
|
python -m uvicorn app.main:app --reload --port 8000
|
|
|
|
# Terminal 2 - Frontend
|
|
cd chartbastan
|
|
npm install
|
|
npm run dev
|
|
```
|
|
|
|
Accéder à : http://localhost:3000
|
|
|
|
---
|
|
|
|
## đ Documentation GĂ©nĂ©rĂ©e
|
|
|
|
### Documentation Principale
|
|
|
|
- đ **[Structure du Projet](./project-structure.md)** - Vue d'ensemble de l'architecture
|
|
- đ§ **[MĂ©tadonnĂ©es des Parties](./project-parts-metadata.md)** - DĂ©tails techniques de chaque partie
|
|
- đ» **[Stack Technologique](./technology-stack.md)** - Technologies utilisĂ©es
|
|
- đïž **[Patterns d'Architecture](./architecture-patterns.md)** - Patterns de conception
|
|
- đł **[Analyse de l'Arbre Source](./source-tree-analysis.md)** - Structure dĂ©taillĂ©e des fichiers
|
|
- đ ïž **[Guide de DĂ©veloppement](./development-guide.md)** - Guide complet de dĂ©veloppement
|
|
- đ§Ș **[README de Test Rapide](./README-TEST.md)** - Guide de testing
|
|
|
|
### Documentation Existante
|
|
|
|
- đ **[Inventaire de Documentation Existante](./existing-documentation-inventory.md)** - 50+ fichiers trouvĂ©s
|
|
- đ€ **[Contexte Utilisateur](./user-provided-context.md)** - Objectifs et prioritĂ©s
|
|
|
|
---
|
|
|
|
## đŻ Parties du Projet
|
|
|
|
### Part 1: Frontend (chartbastan/)
|
|
|
|
**Type:** Web Application (Next.js 16.1.3)
|
|
|
|
**Technologie principale:**
|
|
- Framework: Next.js 16.1.3 + TypeScript 5
|
|
- UI: Tailwind CSS v4 + shadcn/ui
|
|
- State: Zustand 5.0.10 + React Query 5.90.18
|
|
- Database: Drizzle ORM 0.44.7 + SQLite
|
|
- Visualization: D3.js 7.9.0 + Recharts 3.6.0
|
|
|
|
**Points d'entrée:**
|
|
- Page d'accueil: `src/app/page.tsx`
|
|
- Layout racine: `src/app/layout.tsx`
|
|
- Configuration: `package.json`, `tsconfig.json`
|
|
|
|
**Port:** 3000
|
|
|
|
**Documentation spécifique:**
|
|
- đ [README Frontend](../chartbastan/README.md)
|
|
|
|
---
|
|
|
|
### Part 2: Backend (backend/)
|
|
|
|
**Type:** API REST (FastAPI 0.128.0)
|
|
|
|
**Technologie principale:**
|
|
- Framework: FastAPI 0.128.0 + Python 3.11+
|
|
- ORM: SQLAlchemy 2.0.45 + Alembic 1.13.0
|
|
- Scraping: tweepy 4.14.0 + praw 7.8.1 + feedparser 6.0.11
|
|
- ML: vaderSentiment 3.3.2 + textblob 0.17.1
|
|
- Queue: pika 1.3.2 (RabbitMQ)
|
|
|
|
**Points d'entrée:**
|
|
- Application: `app/main.py`
|
|
- API Endpoints: `app/api/`
|
|
- Configuration: `requirements.txt`, `alembic.ini`
|
|
|
|
**Port:** 8000
|
|
|
|
**API Documentation:**
|
|
- Swagger: http://localhost:8000/docs
|
|
- ReDoc: http://localhost:8000/redoc
|
|
|
|
---
|
|
|
|
## đ IntĂ©gration entre Parties
|
|
|
|
**Communication:** REST API (HTTP/HTTPS)
|
|
**Format de données:** JSON
|
|
**Base URL:** `http://localhost:8000` (développement)
|
|
|
|
**Points d'intégration:**
|
|
1. **Authentification** - better-auth (frontend) â JWT (backend)
|
|
2. **DonnĂ©es de Matchs** - `src/services/matches.ts` â `app/api/matches.py`
|
|
3. **PrĂ©dictions** - `src/services/predictions.ts` â `app/api/predictions.py`
|
|
4. **Notifications** - Workers RabbitMQ â Web Push
|
|
|
|
---
|
|
|
|
## đ Structure du Projet
|
|
|
|
```
|
|
chartbastan/
|
|
âââ chartbastan/ # Frontend Next.js
|
|
â âââ src/
|
|
â â âââ app/ # App Router (pages, layouts)
|
|
â â âââ components/ # Composants React (72+)
|
|
â â âââ services/ # Services API (27)
|
|
â â âââ stores/ # Zustand stores (2)
|
|
â â âââ hooks/ # React Hooks (9)
|
|
â â âââ lib/ # Utilitaires (7)
|
|
â âââ package.json
|
|
â
|
|
âââ backend/ # Backend FastAPI
|
|
â âââ app/
|
|
â â âââ api/ # Endpoints REST
|
|
â â âââ models/ # ModĂšles SQLAlchemy (12)
|
|
â â âââ schemas/ # SchĂ©mas Pydantic (14)
|
|
â â âââ services/ # Services mĂ©tier (8)
|
|
â â âââ scrapers/ # Scrapers (Twitter, Reddit, RSS)
|
|
â â âââ ml/ # Services ML (sentiment, prĂ©dictions)
|
|
â â âââ workers/ # Workers asynchrones (4)
|
|
â â âââ main.py # Application FastAPI
|
|
â âââ alembic/ # Migrations
|
|
â âââ requirements.txt
|
|
â
|
|
âââ _bmad-output/ # Documentation de planification
|
|
â âââ planning-artifacts/ # PRD, Architecture, Epics
|
|
â âââ implementation-artifacts/ # 38 fichiers d'implĂ©mentation
|
|
â
|
|
âââ docs/ # Documentation (ce dossier)
|
|
```
|
|
|
|
---
|
|
|
|
## đ Documentation de Planification et ImplĂ©mentation
|
|
|
|
### Artefacts de Planification
|
|
|
|
- đ **[PRD Complet](../_bmad-output/planning-artifacts/prd.md)** - Product Requirements Document
|
|
- đïž **[Architecture](../_bmad-output/planning-artifacts/architecture.md)** - Documentation architecturale
|
|
- đ **[Epics](../_bmad-output/planning-artifacts/epics.md)** - 9 Ă©pics complĂ©tĂ©s
|
|
- đš **[UX Design Directions](../_bmad-output/planning-artifacts/ux-design-directions.html)**
|
|
- đš **[UX Design Specification](../_bmad-output/planning-artifacts/ux-design-specification.md)**
|
|
|
|
### Artefacts d'Implémentation
|
|
|
|
đ ïž **[Dossier d'Artefacts](../_bmad-output/implementation-artifacts/)** - 38 fichiers de documentation d'implĂ©mentation dĂ©taillĂ©e
|
|
|
|
**Ăpics complĂ©tĂ©s:**
|
|
1. Authentification des utilisateurs
|
|
2. Collecte de données (Twitter, Reddit, RSS)
|
|
3. Analyse de sentiment et énergie collective
|
|
4. SystÚme de prédictions ML
|
|
5. Dashboard principal en temps réel
|
|
6. SystÚme de paris et prédictions utilisateurs
|
|
7. Gamification (badges, classements, parrainage)
|
|
8. Notifications push et alertes
|
|
9. API publique et calendrier énergétique
|
|
|
|
---
|
|
|
|
## đ Getting Started
|
|
|
|
### 1. Pour Tester l'Application
|
|
|
|
đ **[README de Test Rapide](./README-TEST.md)** - Guide en 3 Ă©tapes
|
|
|
|
### 2. Pour le Développement
|
|
|
|
đ **[Guide de DĂ©veloppement](./development-guide.md)** - Guide complet de dĂ©veloppement
|
|
|
|
**Ătapes rapides:**
|
|
1. Installer les dépendances: `pip install -r requirements.txt` et `npm install`
|
|
2. Configurer les variables d'environnement (.env et .env.local)
|
|
3. Démarrer le backend: `python -m uvicorn app.main:app --reload --port 8000`
|
|
4. Démarrer le frontend: `npm run dev`
|
|
5. Ouvrir http://localhost:3000
|
|
|
|
### 3. Pour Comprendre l'Architecture
|
|
|
|
đ **[Patterns d'Architecture](./architecture-patterns.md)** - Patterns de conception dĂ©taillĂ©s
|
|
|
|
đ **[Stack Technologique](./technology-stack.md)** - Technologies utilisĂ©es
|
|
|
|
### 4. Pour Explorer le Code
|
|
|
|
đ **[Analyse de l'Arbre Source](./source-tree-analysis.md)** - Structure dĂ©taillĂ©e des fichiers
|
|
|
|
đ **[Structure du Projet](./project-structure.md)** - Vue d'organisation
|
|
|
|
---
|
|
|
|
## đ§Ș Testing
|
|
|
|
### Fonctionnalités à Tester
|
|
|
|
Voir le **[README de Test Rapide](./README-TEST.md)** pour la checklist complĂšte:
|
|
|
|
- â
Authentification (inscription, login, déconnexion)
|
|
- â
Dashboard principal (matchs, graphiques)
|
|
- â
Prédictions (faire une prédiction, voir l'énergie)
|
|
- â
Classement (Top 100, rang personnel)
|
|
- â
Badges et gamification
|
|
- â
Notifications
|
|
- â
Historique des prédictions
|
|
- â
Parrainage
|
|
- â
Comparaison énergie vs stats
|
|
- â
Calendrier énergétique
|
|
|
|
### Tests Automatisés
|
|
|
|
**Frontend:**
|
|
```bash
|
|
cd chartbastan
|
|
npm run test
|
|
```
|
|
|
|
**Backend:**
|
|
```bash
|
|
cd backend
|
|
pytest tests/ -v
|
|
```
|
|
|
|
---
|
|
|
|
## đ ïž Scripts et Commandes
|
|
|
|
### Frontend (chartbastan/)
|
|
|
|
| Commande | Description |
|
|
|----------|-------------|
|
|
| `npm run dev` | Démarrer le serveur de développement (port 3000) |
|
|
| `npm run build` | Build de production |
|
|
| `npm run start` | Démarrer le serveur de production |
|
|
| `npm run lint` | Exécuter ESLint |
|
|
| `npm run type-check` | Vérifier les types TypeScript |
|
|
| `npm run test` | Exécuter les tests Vitest |
|
|
|
|
### Backend (backend/)
|
|
|
|
| Commande | Description |
|
|
|----------|-------------|
|
|
| `python -m uvicorn app.main:app --reload --port 8000` | Démarrer le serveur FastAPI |
|
|
| `flake8 .` | Linting du code Python |
|
|
| `black .` | Formatage du code Python |
|
|
| `pytest tests/` | Exécuter les tests unitaires |
|
|
| `alembic upgrade head` | Appliquer toutes les migrations |
|
|
|
|
---
|
|
|
|
## đ Ressources de RĂ©fĂ©rence
|
|
|
|
### Documentation API
|
|
|
|
- **Swagger UI:** http://localhost:8000/docs
|
|
- **ReDoc:** http://localhost:8000/redoc
|
|
|
|
### Documentation Externe
|
|
|
|
- **Next.js:** https://nextjs.org/docs
|
|
- **FastAPI:** https://fastapi.tiangolo.com/
|
|
- **React:** https://react.dev/
|
|
- **Tailwind CSS:** https://tailwindcss.com/docs
|
|
- **Drizzle ORM:** https://orm.drizzle.team/
|
|
- **SQLAlchemy:** https://docs.sqlalchemy.org/
|
|
|
|
---
|
|
|
|
## đ Statut du Projet
|
|
|
|
**Phase:** Testing (tous les épics complétés)
|
|
|
|
- â
PRD complet
|
|
- â
Architecture implémentée
|
|
- â
9 épics complétés
|
|
- â
Frontend et Backend prĂȘts
|
|
- đ Testing en cours
|
|
|
|
**Technologie:**
|
|
- Frontend: Next.js 16.1.3 + TypeScript 5
|
|
- Backend: FastAPI 0.128.0 + Python 3.11+
|
|
- Database: SQLite (Phase 1) â PostgreSQL (Phase 2+)
|
|
- API: REST + Swagger documentation
|
|
|
|
---
|
|
|
|
## đ DĂ©pannage
|
|
|
|
Pour les problĂšmes courants, consulter:
|
|
|
|
- **[Guide de Développement - Dépannage](./development-guide.md#dépannage)**
|
|
- **[README de Test Rapide - Dépannage](./README-TEST.md#-dépannage)**
|
|
|
|
**ProblÚmes fréquents:**
|
|
- Backend ne dĂ©marre pas â VĂ©rifier le port 8000
|
|
- Frontend ne dĂ©marre pas â Nettoyer node_modules et rĂ©installer
|
|
- Erreur de connexion â VĂ©rifier que backend tourne et .env.local est configurĂ©
|
|
- Base de donnĂ©es vide â ExĂ©cuter `alembic upgrade head`
|
|
|
|
---
|
|
|
|
## đ€ Contribution
|
|
|
|
Le projet est complet et en phase de testing. Pour contribuer:
|
|
|
|
1. Fork le repository
|
|
2. Créer une branche `feature/nouvelle-fonctionnalité`
|
|
3. Développer la fonctionnalité
|
|
4. Commit avec des messages clairs
|
|
5. Push et créer une Pull Request
|
|
|
|
---
|
|
|
|
## đ Licence
|
|
|
|
Ce projet est sous license MIT.
|
|
|
|
---
|
|
|
|
## đ Contact
|
|
|
|
Pour toute question:
|
|
- Consulter les artefacts d'implémentation: `_bmad-output/implementation-artifacts/`
|
|
- Vérifier la documentation API: http://localhost:8000/docs
|
|
- Consulter le README principal: `chartbastan/README.md`
|
|
|
|
---
|
|
|
|
**Date de création:** 2026-01-18
|
|
**Version:** 0.1.0
|
|
**Statut:** Testing (tous les Ă©pics complĂ©tĂ©s) â
|