Version: 1.0.0
Base URL: http://192.168.5.30:5000
Status: ✅ Production Ready
L'API VortexFlow fournit une interface REST complète pour la gestion de graphiques DOT avec visualisation 3D et authentification multi-rôles. La simulation de flux est entièrement effectuée côté navigateur (Three.js / 3d-force-graph) — le backend n'expose plus d'endpoints /api/simulation ni de WebSocket dédié.
- Type: Sessions serveur avec cookies
- Store: Redis (persistant)
- Durée: 24h par défaut
- Rôles: viewer, editor, admin
GET /api/public/healthDescription: Status système et services
Réponse:
{
"status": "healthy",
"timestamp": "2025-07-07T20:40:00.000Z",
"services": {
"database": { "status": "healthy" },
"redis": { "status": "healthy", "store": "redis" }
}
}GET /api/public/dot-examplesDescription: Collection d'exemples de code DOT
Réponse:
{
"examples": [
{
"name": "Simple Graph",
"description": "Graphique basique avec 3 nœuds",
"code": "digraph G { A -> B -> C; }"
}
]
}POST /api/public/validate-dot
Content-Type: application/json
{
"code": "digraph G { A -> B; }"
}Description: Validation syntaxe et sémantique DOT
Réponse:
{
"valid": true,
"syntax": { "valid": true },
"semantic": { "valid": true },
"nodes": ["A", "B"],
"edges": [{"from": "A", "to": "B"}]
}POST /api/auth/login
Content-Type: application/json
{
"email": "admin@admin.com",
"password": "VortexFlow2024!"
}Réponse:
{
"success": true,
"message": "Login successful",
"user": {
"id": "uuid",
"email": "admin@admin.com",
"role": "admin",
"first_name": "Admin"
}
}POST /api/auth/logoutPOST /api/auth/register
Content-Type: application/json
{
"email": "user@example.com",
"password": "SecurePass123!",
"first_name": "John",
"last_name": "Doe"
}GET /api/users/profile
Cookie: connect.sid=...Réponse:
{
"id": "uuid",
"email": "admin@admin.com",
"role": "admin",
"first_name": "Admin",
"last_name": "User",
"last_login": "2025-07-07T20:30:00.000Z"
}PUT /api/users/profile
Content-Type: application/json
{
"first_name": "John Updated",
"preferences": {"theme": "dark"}
}GET /api/usersGET /api/graphsParamètres optionnels:
page(int): Page (défaut: 1)limit(int): Limite par page (défaut: 20)search(string): Recherche dans titre/description
Réponse:
{
"graphs": [
{
"id": "uuid",
"title": "Mon Graphique",
"description": "Description du graphique",
"dot_code": "digraph G { A -> B; }",
"is_public": false,
"created_by": "uuid",
"createdAt": "2025-07-07T20:00:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1,
"pages": 1
}
}POST /api/graphs
Content-Type: application/json
{
"title": "Nouveau Graphique",
"description": "Description optionnelle",
"dot_code": "digraph G { A -> B -> C; }",
"is_public": false
}GET /api/graphs/:idPUT /api/graphs/:id
Content-Type: application/json
{
"title": "Titre Modifié",
"dot_code": "digraph G { A -> B -> C -> D; }"
}DELETE /api/graphs/:idDésactivée côté serveur. La simulation est calculée et rendue entièrement dans le navigateur (Three.js + 3d-force-graph). Il n'existe plus d'endpoint
/api/simulation/*ni de WebSocket dédié. Le modèle SequelizeSimulationSessionest encore présent (les compteurs admin / dashboard l'interrogent et renvoient 0) mais aucun nouveau record n'est créé.
POST /api/import-export/upload
Content-Type: multipart/form-data
Form Data:
- file: fichier.dot
- title: "Titre du graphique"GET /api/import-export/download/:idParamètres:
format: dot, png, svg (défaut: dot)
GET /api/system/metricsRéponse:
{
"server": {
"uptime": 3600,
"memory": {"used": "150MB", "total": "8GB"},
"cpu": {"usage": "15%"}
},
"database": {
"connections": 5,
"queries_per_second": 2.5
},
"redis": {
"connected_clients": 3,
"memory_usage": "1.2MB"
}
}GET /api/system/logsParamètres:
level: debug, info, warn, errorlimit: nombre de logs (défaut: 100)
- 200 - OK
- 201 - Created
- 400 - Bad Request
- 401 - Unauthorized
- 403 - Forbidden
- 404 - Not Found
- 500 - Internal Server Error
{
"error": true,
"message": "Description de l'erreur",
"code": "ERROR_CODE",
"details": {}
}# Suite complète de tests
./run-final-tests.sh
# Test sanité rapide
curl -s http://192.168.5.30:5000/api/public/health | jq# Connexion avec session
curl -X POST http://192.168.5.30:5000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@admin.com","password":"VortexFlow2024!"}' \
-c cookies.txt
# Test endpoint protégé
curl -s http://192.168.5.30:5000/api/users/profile \
-b cookies.txt | jqconst headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};// Axios configuration pour cookies
axios.defaults.withCredentials = true;
// Fetch configuration
fetch('/api/endpoint', {
credentials: 'include'
});📋 Cette documentation est maintenue à jour avec l'état actuel de l'API.
VortexFlow Backend API v1.0.0 - Dernière mise à jour: 2025-07-07