Added detailed documentation files, including project overview, current status, specifications, implementation guide, and README structure. Organized content to improve navigation and streamline project understanding.
148 lines
5.3 KiB
Markdown
148 lines
5.3 KiB
Markdown
# Business Flow Diagrams
|
|
|
|
This document contains diagrams illustrating the main business flows of the "Application de Création de Groupes" project.
|
|
|
|
## Authentication Flow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User as Utilisateur
|
|
participant Frontend as Frontend (Next.js)
|
|
participant Backend as Backend (NestJS)
|
|
participant GitHub as GitHub OAuth
|
|
|
|
User->>Frontend: Clic sur "Se connecter avec GitHub"
|
|
Frontend->>Backend: Redirection vers /auth/github
|
|
Backend->>GitHub: Redirection vers GitHub OAuth
|
|
GitHub->>User: Demande d'autorisation
|
|
User->>GitHub: Accepte l'autorisation
|
|
GitHub->>Backend: Redirection avec code d'autorisation
|
|
Backend->>GitHub: Échange code contre token d'accès
|
|
GitHub->>Backend: Retourne token d'accès
|
|
Backend->>GitHub: Requête informations utilisateur
|
|
GitHub->>Backend: Retourne informations utilisateur
|
|
Backend->>Backend: Crée/Met à jour l'utilisateur en BDD
|
|
Backend->>Backend: Génère JWT (access + refresh tokens)
|
|
Backend->>Frontend: Redirection avec tokens JWT
|
|
Frontend->>Frontend: Stocke les tokens
|
|
Frontend->>User: Affiche interface authentifiée
|
|
```
|
|
|
|
## Project Creation Flow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User as Utilisateur
|
|
participant Frontend as Frontend (Next.js)
|
|
participant Backend as Backend (NestJS)
|
|
participant DB as Base de données
|
|
|
|
User->>Frontend: Crée un nouveau projet
|
|
Frontend->>Backend: POST /api/projects
|
|
Backend->>Backend: Valide les données
|
|
Backend->>DB: Insère le projet
|
|
DB->>Backend: Confirme l'insertion
|
|
Backend->>Frontend: Retourne le projet créé
|
|
Frontend->>User: Affiche le projet créé
|
|
```
|
|
|
|
## Person Management Flow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User as Utilisateur
|
|
participant Frontend as Frontend (Next.js)
|
|
participant Backend as Backend (NestJS)
|
|
participant DB as Base de données
|
|
|
|
User->>Frontend: Ajoute une personne au projet
|
|
Frontend->>Backend: POST /api/projects/{id}/persons
|
|
Backend->>Backend: Valide les données
|
|
Backend->>DB: Insère la personne
|
|
DB->>Backend: Confirme l'insertion
|
|
Backend->>Frontend: Retourne la personne créée
|
|
Frontend->>User: Affiche la personne dans le projet
|
|
|
|
User->>Frontend: Modifie les attributs d'une personne
|
|
Frontend->>Backend: PATCH /api/persons/{id}
|
|
Backend->>Backend: Valide les données
|
|
Backend->>DB: Met à jour la personne
|
|
DB->>Backend: Confirme la mise à jour
|
|
Backend->>Frontend: Retourne la personne mise à jour
|
|
Frontend->>User: Affiche la personne mise à jour
|
|
```
|
|
|
|
## Group Creation Flow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User as Utilisateur
|
|
participant Frontend as Frontend (Next.js)
|
|
participant Backend as Backend (NestJS)
|
|
participant DB as Base de données
|
|
|
|
alt Création manuelle
|
|
User->>Frontend: Crée un groupe manuellement
|
|
Frontend->>Backend: POST /api/projects/{id}/groups
|
|
Backend->>Backend: Valide les données
|
|
Backend->>DB: Insère le groupe
|
|
DB->>Backend: Confirme l'insertion
|
|
Backend->>Frontend: Retourne le groupe créé
|
|
Frontend->>User: Affiche le groupe créé
|
|
|
|
User->>Frontend: Ajoute des personnes au groupe (drag & drop)
|
|
Frontend->>Backend: PATCH /api/groups/{id}/persons
|
|
Backend->>Backend: Valide les données
|
|
Backend->>DB: Met à jour les relations groupe-personnes
|
|
DB->>Backend: Confirme la mise à jour
|
|
Backend->>Frontend: Retourne le groupe mis à jour
|
|
Frontend->>User: Affiche le groupe mis à jour
|
|
else Création automatique
|
|
User->>Frontend: Demande la création automatique de groupes
|
|
Frontend->>Backend: POST /api/projects/{id}/auto-groups
|
|
Backend->>Backend: Exécute l'algorithme de création de groupes
|
|
Backend->>DB: Insère les groupes générés
|
|
DB->>Backend: Confirme l'insertion
|
|
Backend->>Frontend: Retourne les groupes créés
|
|
Frontend->>User: Affiche les groupes créés
|
|
end
|
|
```
|
|
|
|
## Real-time Collaboration Flow
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User1 as Utilisateur 1
|
|
participant User2 as Utilisateur 2
|
|
participant Frontend1 as Frontend (User 1)
|
|
participant Frontend2 as Frontend (User 2)
|
|
participant Backend as Backend (NestJS)
|
|
participant WebSocket as WebSocket Server
|
|
participant DB as Base de données
|
|
|
|
User1->>Frontend1: Modifie un projet
|
|
Frontend1->>Backend: PATCH /api/projects/{id}
|
|
Backend->>DB: Met à jour le projet
|
|
DB->>Backend: Confirme la mise à jour
|
|
Backend->>WebSocket: Émet événement "project:updated"
|
|
WebSocket->>Frontend2: Transmet événement "project:updated"
|
|
Frontend2->>User2: Affiche les modifications en temps réel
|
|
```
|
|
|
|
## Export Data Flow (GDPR)
|
|
|
|
```mermaid
|
|
sequenceDiagram
|
|
participant User as Utilisateur
|
|
participant Frontend as Frontend (Next.js)
|
|
participant Backend as Backend (NestJS)
|
|
participant DB as Base de données
|
|
|
|
User->>Frontend: Demande l'export de ses données
|
|
Frontend->>Backend: GET /api/users/me/export
|
|
Backend->>DB: Récupère toutes les données de l'utilisateur
|
|
DB->>Backend: Retourne les données
|
|
Backend->>Backend: Formate les données en JSON
|
|
Backend->>Frontend: Retourne le fichier JSON
|
|
Frontend->>User: Télécharge le fichier de données
|
|
``` |