refactor(docs): réorganiser la documentation selon principes DDD
Réorganise la documentation du projet selon les principes du Domain-Driven Design (DDD) pour améliorer la cohésion, la maintenabilité et l'alignement avec l'architecture modulaire du backend. **Structure cible:** ``` docs/domains/ ├── README.md (Context Map) ├── _shared/ (Core Domain) ├── recommendation/ (Supporting Subdomain) ├── content/ (Supporting Subdomain) ├── moderation/ (Supporting Subdomain) ├── advertising/ (Generic Subdomain) ├── premium/ (Generic Subdomain) └── monetization/ (Generic Subdomain) ``` **Changements effectués:** Phase 1: Création de l'arborescence des 7 bounded contexts Phase 2: Déplacement des règles métier (01-19) vers domains/*/rules/ Phase 3: Déplacement des diagrammes d'entités vers domains/*/entities/ Phase 4: Déplacement des diagrammes flux/états/séquences vers domains/*/ Phase 5: Création des README.md pour chaque domaine Phase 6: Déplacement des features Gherkin vers domains/*/features/ Phase 7: Création du Context Map (domains/README.md) Phase 8: Mise à jour de mkdocs.yml pour la nouvelle navigation Phase 9: Correction automatique des liens internes (script fix-markdown-links.sh) Phase 10: Nettoyage de l'ancienne structure (regles-metier/, diagrammes/, features/) **Configuration des tests:** - Makefile: godog run docs/domains/*/features/ - scripts/generate-bdd-docs.py: features_dir → docs/domains **Avantages:** ✅ Cohésion forte: toute la doc d'un domaine au même endroit ✅ Couplage faible: domaines indépendants, dépendances explicites ✅ Navigabilité améliorée: README par domaine = entrée claire ✅ Alignement code/docs: miroir de backend/internal/ ✅ Onboarding facilité: exploration domaine par domaine ✅ Tests BDD intégrés: features au plus près des règles métier Voir docs/REFACTOR-DDD.md pour le plan complet.
This commit is contained in:
69
docs/domains/content/entities/modele-audio-guides.md
Normal file
69
docs/domains/content/entities/modele-audio-guides.md
Normal file
@@ -0,0 +1,69 @@
|
||||
# Modèle de données - Audio-guides
|
||||
|
||||
📖 Voir [Règles métier - Section 06 : Audio-guides multi-séquences](../rules/audio-guides.md) | [Entités globales](../../_shared/entities/modele-global.md)
|
||||
|
||||
## Diagramme
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
AUDIO_GUIDES }o--|| USERS : "créé par"
|
||||
AUDIO_GUIDES ||--o{ GUIDE_SEQUENCES : "contient"
|
||||
AUDIO_GUIDES ||--o{ USER_GUIDE_PROGRESS : "progression"
|
||||
|
||||
GUIDE_SEQUENCES }o--|| AUDIO_GUIDES : "appartient à"
|
||||
|
||||
USER_GUIDE_PROGRESS }o--|| USERS : "utilisateur"
|
||||
USER_GUIDE_PROGRESS }o--|| AUDIO_GUIDES : "guide"
|
||||
USER_GUIDE_PROGRESS }o--|| GUIDE_SEQUENCES : "séquence actuelle"
|
||||
|
||||
AUDIO_GUIDES {
|
||||
uuid id PK
|
||||
uuid creator_id FK
|
||||
string title
|
||||
text description
|
||||
string travel_mode
|
||||
int recommended_speed_min_kmh
|
||||
int recommended_speed_max_kmh
|
||||
int sequences_count
|
||||
int total_duration_seconds
|
||||
decimal total_distance_meters
|
||||
polygon diffusion_zone
|
||||
string[] tags
|
||||
string age_rating
|
||||
string status
|
||||
timestamp published_at
|
||||
}
|
||||
|
||||
GUIDE_SEQUENCES {
|
||||
uuid id PK
|
||||
uuid guide_id FK
|
||||
int sequence_order
|
||||
string title
|
||||
string audio_url
|
||||
int duration_seconds
|
||||
point gps_location
|
||||
int trigger_radius_meters
|
||||
boolean requires_manual_trigger
|
||||
timestamp created_at
|
||||
}
|
||||
|
||||
USER_GUIDE_PROGRESS {
|
||||
uuid id PK
|
||||
uuid user_id FK
|
||||
uuid guide_id FK
|
||||
uuid current_sequence_id FK
|
||||
int sequences_completed_count
|
||||
decimal completion_percentage
|
||||
timestamp started_at
|
||||
timestamp last_updated
|
||||
timestamp completed_at
|
||||
}
|
||||
```
|
||||
|
||||
## Légende
|
||||
|
||||
**Entités audio-guides** :
|
||||
|
||||
- **AUDIO_GUIDES** : Audio-guides multi-séquences - Travel_mode : `pedestrian` (manuel), `car` (auto GPS + manuel), `bicycle` (auto GPS + manuel), `transport` (auto GPS + manuel) - Sequences_count : Min 2, Max 50 séquences - Status : `draft`, `pending_review`, `published`, `archived` - Diffusion_zone : Polygon géographique (où l'audio-guide est recommandé)
|
||||
- **GUIDE_SEQUENCES** : Séquences audio géolocalisées - Sequence_order : Ordre lecture 1, 2, 3... - Trigger_radius : 10-100m selon mode (piéton 10m, voiture 50m) - Requires_manual_trigger : true si mode piéton (bouton "Suivant"), false si auto GPS - GPS_location : Point WGS84 (latitude, longitude) sauf mode piéton
|
||||
- **USER_GUIDE_PROGRESS** : Progression utilisateur - Completion_percentage : 0-100% (nb séquences complétées / total) - Current_sequence_id : Dernière séquence écoutée (pour reprise) - Started_at : Date démarrage parcours - Completed_at : NULL si en cours, timestamp si terminé
|
||||
63
docs/domains/content/entities/modele-radio-live.md
Normal file
63
docs/domains/content/entities/modele-radio-live.md
Normal file
@@ -0,0 +1,63 @@
|
||||
# Modèle de données - Radio Live
|
||||
|
||||
📖 Voir [Règles métier - Section 12 : Radio Live](../rules/radio-live.md) | [Entités globales](../../_shared/entities/modele-global.md)
|
||||
|
||||
## Diagramme
|
||||
|
||||
```mermaid
|
||||
erDiagram
|
||||
LIVE_STREAMS }o--|| USERS : "diffusé par"
|
||||
LIVE_STREAMS ||--o{ LIVE_RECORDINGS : "enregistrement"
|
||||
LIVE_STREAMS ||--o{ LIVE_LISTENERS : "auditeurs"
|
||||
|
||||
LIVE_LISTENERS }o--|| USERS : "écoute"
|
||||
LIVE_LISTENERS }o--|| LIVE_STREAMS : "stream"
|
||||
|
||||
LIVE_STREAMS {
|
||||
uuid id PK
|
||||
uuid creator_id FK
|
||||
string title
|
||||
string[] tags
|
||||
string age_rating
|
||||
string geo_type
|
||||
jsonb geo_data
|
||||
string status
|
||||
string stream_key
|
||||
string playback_url
|
||||
int current_listeners_count
|
||||
int peak_listeners_count
|
||||
timestamp started_at
|
||||
timestamp ended_at
|
||||
int duration_seconds
|
||||
}
|
||||
|
||||
LIVE_RECORDINGS {
|
||||
uuid id PK
|
||||
uuid stream_id FK
|
||||
string audio_url
|
||||
int duration_seconds
|
||||
int file_size_bytes
|
||||
string status
|
||||
boolean auto_publish
|
||||
timestamp recorded_at
|
||||
timestamp processed_at
|
||||
}
|
||||
|
||||
LIVE_LISTENERS {
|
||||
uuid id PK
|
||||
uuid stream_id FK
|
||||
uuid user_id FK
|
||||
int listen_duration_seconds
|
||||
boolean was_notified
|
||||
timestamp joined_at
|
||||
timestamp left_at
|
||||
}
|
||||
```
|
||||
|
||||
## Légende
|
||||
|
||||
**Entités radio live** :
|
||||
|
||||
- **LIVE_STREAMS** : Streams audio temps réel - Status : `preparing` (buffer 15s initial), `live` (diffusion publique), `ended`, `interrupted` - Stream_key : WebRTC ingestion unique par créateur - Playback_url : HLS m3u8 pour diffusion clients - Geo_type : `city`, `department`, `region`, `national` (zone diffusion) - Durée max 8h par session - Déconnexion <60s : reconnexion auto, ≥60s : arrêt auto - Notification push abonnés dans zone géo au démarrage
|
||||
- **LIVE_RECORDINGS** : Enregistrements replay auto - Enregistrement obligatoire et automatique pendant live - Status : `recording`, `processing` (transcode HLS), `published`, `deleted` - Auto_publish : true par défaut (créateur peut désactiver) - Processing : Job asynchrone FFmpeg (Opus → HLS segments) - Replay disponible sous 5-15 min après fin live
|
||||
- **LIVE_LISTENERS** : Auditeurs live - Join/leave tracking temps réel - Was_notified : true si reçu push notification (analyse efficacité) - Listen_duration : Temps écoute effectif (pour stats créateur) - Peak listeners : Maximum simultané (métrique clé engagement)
|
||||
Reference in New Issue
Block a user