-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.ps1
More file actions
66 lines (49 loc) · 1.66 KB
/
start.ps1
File metadata and controls
66 lines (49 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Script de démarrage rapide pour GeoPrivacy
function Check-Prerequisites {
Write-Host "🔍 Vérification des prérequis..." -ForegroundColor Yellow
# Vérifier Node.js
if (!(Get-Command node -ErrorAction SilentlyContinue)) {
Write-Host "❌ Node.js non installé" -ForegroundColor Red
exit 1
}
# Vérifier npm
if (!(Get-Command npm -ErrorAction SilentlyContinue)) {
Write-Host "❌ npm non installé" -ForegroundColor Red
exit 1
}
# Version minimale de Node.js
$nodeVersion = (node --version).Trim('v')
$requiredVersion = [System.Version]"18.0.0"
if ([System.Version]$nodeVersion -lt $requiredVersion) {
Write-Host "⚠️ Version de Node.js recommandée : >= 18.x" -ForegroundColor Yellow
}
}
function Setup-Project {
Write-Host "🛠️ Configuration du projet..." -ForegroundColor Yellow
# Installer les dépendances
npm ci
# Configuration initiale
npm run project:setup
# Validation du projet
npm run project:validate
}
function Start-Services {
Write-Host "🚀 Démarrage des services..." -ForegroundColor Yellow
# Compiler les contrats
npm run contract:compile
# Démarrer le backend
Start-Process npm -ArgumentList "run backend:start" -PassThru
# Démarrer le frontend
Start-Process npm -ArgumentList "run frontend:start" -PassThru
# Attendre la fin des processus
Wait-Process
}
function Main {
Clear-Host
Write-Host "🌐 GeoPrivacy - Démarrage du projet" -ForegroundColor Green
Check-Prerequisites
Setup-Project
Start-Services
}
# Exécution
Main