-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstart_app.sh
More file actions
executable file
·44 lines (36 loc) · 1.01 KB
/
Copy pathstart_app.sh
File metadata and controls
executable file
·44 lines (36 loc) · 1.01 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
#!/bin/bash
# Game Assistant Startup Script
echo "🎮 Starting Game Assistant..."
# Check if OPENAI_API_KEY is set
if [ -z "$OPENAI_API_KEY" ]; then
echo "⚠️ WARNING: OPENAI_API_KEY not set"
echo " AI features will be disabled"
echo " Set it with: export OPENAI_API_KEY='your-key-here'"
echo ""
fi
# Start Python backend in background
echo "🚀 Starting Python backend..."
python3 src/backend/backend_server.py &
BACKEND_PID=$!
# Wait a moment for backend to start
sleep 2
# Check if backend is running
if ! curl -s http://localhost:8080/health > /dev/null; then
echo "❌ Backend failed to start"
kill $BACKEND_PID 2>/dev/null
exit 1
fi
echo "✅ Backend started successfully"
# Start Electron app
echo "🖥️ Starting Electron app..."
cd src/frontend
if ! npm start; then
echo "❌ Electron app failed to start"
kill $BACKEND_PID 2>/dev/null
exit 1
fi
cd ../..
# Cleanup on exit
echo "🛑 Shutting down..."
kill $BACKEND_PID 2>/dev/null
echo "✅ Game Assistant stopped"