-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplete_start.sh
More file actions
executable file
Β·176 lines (151 loc) Β· 4.85 KB
/
complete_start.sh
File metadata and controls
executable file
Β·176 lines (151 loc) Β· 4.85 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/bash
# Complete MSP Intelligence Mesh Network Startup Script
# This script installs all dependencies and starts the complete system
set -e
echo "π Starting MSP Intelligence Mesh Network - Complete System"
echo "=========================================================="
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if we're in the right directory
if [ ! -f "backend/api/main_simple.py" ]; then
print_error "Please run this script from the msp-intelligence-mesh directory"
exit 1
fi
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
print_status "Creating Python virtual environment..."
python3 -m venv venv
print_success "Virtual environment created"
fi
# Activate virtual environment
print_status "Activating virtual environment..."
source venv/bin/activate
print_success "Virtual environment activated"
# Install Python dependencies
print_status "Installing Python dependencies..."
pip install --upgrade pip
pip install -r backend/requirements_minimal.txt
print_success "Python dependencies installed"
# Create logs directory
mkdir -p logs
# Start backend server
print_status "Starting backend server..."
cd backend
python api/main_simple.py &
BACKEND_PID=$!
cd ..
# Wait for backend to start
print_status "Waiting for backend to start..."
sleep 5
# Check if backend is running
if curl -s http://localhost:8000/health > /dev/null; then
print_success "Backend started successfully (PID: $BACKEND_PID)"
else
print_error "Backend failed to start"
exit 1
fi
# Start frontend server
print_status "Starting frontend server..."
python serve_frontend.py &
FRONTEND_PID=$!
# Wait for frontend to start
print_status "Waiting for frontend to start..."
sleep 3
# Check if frontend is running
if curl -s http://localhost:3001 > /dev/null; then
print_success "Frontend started successfully (PID: $FRONTEND_PID)"
else
print_error "Frontend failed to start"
exit 1
fi
# Test system
print_status "Testing system..."
if curl -s http://localhost:8000/health | grep -q "healthy"; then
print_success "β
Backend is responding"
else
print_error "β Backend is not responding"
fi
if curl -s http://localhost:3001 > /dev/null; then
print_success "β
Frontend is responding"
else
print_error "β Frontend is not responding"
fi
# Display system information
echo ""
echo "π MSP Intelligence Mesh Network is running!"
echo "============================================="
echo ""
echo "π System Status:"
echo " Backend PID: $BACKEND_PID"
echo " Frontend PID: $FRONTEND_PID"
echo ""
echo "π Access URLs:"
echo " Main Dashboard: http://localhost:3001"
echo " Backend API: http://localhost:8000"
echo " API Documentation: http://localhost:8000/docs"
echo " Health Check: http://localhost:8000/health"
echo ""
echo "π€ AI Agents Status:"
curl -s http://localhost:8000/agents/status | python3 -c "
import sys, json
data = json.load(sys.stdin)
print(f' Total Agents: {data[\"total_agents\"]}')
print(f' Active Agents: {data[\"active_agents\"]}')
for agent, status in data['agents'].items():
print(f' {agent.replace(\"_\", \" \").title()}: {status[\"status\"]} (Health: {status[\"health_score\"]})')
"
echo ""
echo "π Useful Commands:"
echo " View backend logs: tail -f logs/backend.log"
echo " View frontend logs: tail -f logs/frontend.log"
echo " Stop system: kill $BACKEND_PID $FRONTEND_PID"
echo " Test backend: curl http://localhost:8000/health"
echo " Test agents: curl http://localhost:8000/agents/status"
echo ""
echo "π§ System Features:"
echo " β
10+ AI Agents with full functionality"
echo " β
Real-time threat detection and response"
echo " β
AI-powered collaboration matching"
echo " β
Federated learning with privacy guarantees"
echo " β
Market intelligence and pricing optimization"
echo " β
Client health prediction and churn analysis"
echo " β
Revenue forecasting and opportunity detection"
echo " β
Anomaly detection and system monitoring"
echo " β
Natural language query interface"
echo " β
Resource allocation and scheduling optimization"
echo " β
Security compliance monitoring"
echo " β
Live WebSocket updates"
echo " β
Professional dashboard UI"
echo ""
print_success "System is ready! Press Ctrl+C to stop."
# Function to cleanup on exit
cleanup() {
echo ""
print_status "Shutting down system..."
kill $BACKEND_PID $FRONTEND_PID 2>/dev/null || true
print_success "System stopped successfully"
exit 0
}
# Set trap to cleanup on exit
trap cleanup SIGINT SIGTERM
# Keep script running
while true; do
sleep 1
done