-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
76 lines (57 loc) · 1.63 KB
/
start.sh
File metadata and controls
76 lines (57 loc) · 1.63 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
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Script de démarrage rapide pour GeoPrivacy
# Couleurs
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Fonction de vérification des prérequis
check_prerequisites() {
echo -e "${YELLOW}🔍 Vérification des prérequis...${NC}"
# Vérifier Node.js
if ! command -v node &> /dev/null; then
echo -e "${RED}❌ Node.js non installé${NC}"
exit 1
fi
# Vérifier npm
if ! command -v npm &> /dev/null; then
echo -e "${RED}❌ npm non installé${NC}"
exit 1
fi
# Version minimale de Node.js
NODE_VERSION=$(node --version | cut -d'v' -f2)
REQUIRED_VERSION="18.0.0"
if [ "$(printf '%s\n' "$REQUIRED_VERSION" "$NODE_VERSION" | sort -V | head -n1)" != "$REQUIRED_VERSION" ]; then
echo -e "${YELLOW}⚠️ Version de Node.js recommandée : >= 18.x${NC}"
fi
}
# Configuration initiale
setup_project() {
echo -e "${YELLOW}🛠️ Configuration du projet...${NC}"
# Installer les dépendances
npm ci
# Configuration initiale
npm run project:setup
# Validation du projet
npm run project:validate
}
# Démarrage des services
start_services() {
echo -e "${YELLOW}🚀 Démarrage des services...${NC}"
# Compiler les contrats
npm run contract:compile
# Démarrer le backend
npm run backend:start &
# Démarrer le frontend
npm run frontend:start &
wait
}
# Fonction principale
main() {
clear
echo -e "${GREEN}🌐 GeoPrivacy - Démarrage du projet${NC}"
check_prerequisites
setup_project
start_services
}
# Exécution
main