forked from fspecii/ace-step-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-all.sh
More file actions
executable file
·151 lines (127 loc) · 3.71 KB
/
start-all.sh
File metadata and controls
executable file
·151 lines (127 loc) · 3.71 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
#!/bin/bash
# ACE-Step UI Complete Startup Script for Linux/macOS
# Starts ACE-Step API + Backend + Frontend
set -e
echo "=================================="
echo " ACE-Step Complete Startup"
echo "=================================="
echo
# Check if node_modules exists
if [ ! -d "node_modules" ]; then
echo "Error: UI dependencies not installed!"
echo "Please run ./setup.sh first."
exit 1
fi
if [ ! -d "server/node_modules" ]; then
echo "Error: Server dependencies not installed!"
echo "Please run ./setup.sh first."
exit 1
fi
# Get ACE-Step path from environment or use default
ACESTEP_PATH="${ACESTEP_PATH:-../ACE-Step-1.5}"
# Check if ACE-Step exists
if [ ! -d "$ACESTEP_PATH" ]; then
echo
echo "Warning: ACE-Step not found at $ACESTEP_PATH"
echo
echo "Please set ACESTEP_PATH or place ACE-Step-1.5 next to ace-step-ui"
echo "Example: export ACESTEP_PATH=/path/to/ACE-Step-1.5"
echo
exit 1
fi
# Get local IP for LAN access
if command -v ip &> /dev/null; then
LOCAL_IP=$(ip route get 1.1.1.1 2>/dev/null | grep -oP 'src \K\S+' || echo "")
elif command -v ifconfig &> /dev/null; then
LOCAL_IP=$(ifconfig | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}' | head -n1)
fi
echo
echo "=================================="
echo " Starting All Services..."
echo "=================================="
echo
# Create log directory
mkdir -p logs
# Start ACE-Step API in background
echo "[1/3] Starting ACE-Step API server..."
cd "$ACESTEP_PATH"
uv run acestep-api --port 8001 > "../ace-step-ui/logs/api.log" 2>&1 &
API_PID=$!
cd - > /dev/null
# Wait for API to start
echo "Waiting for API to initialize..."
sleep 5
# Check if API started successfully
if ! kill -0 $API_PID 2>/dev/null; then
echo "Error: API failed to start. Check logs/api.log"
exit 1
fi
# Start backend in background
echo "[2/3] Starting backend server..."
cd server
npm run dev > ../logs/backend.log 2>&1 &
BACKEND_PID=$!
cd ..
# Wait for backend to start
echo "Waiting for backend to start..."
sleep 3
# Check if backend started successfully
if ! kill -0 $BACKEND_PID 2>/dev/null; then
echo "Error: Backend failed to start. Check logs/backend.log"
kill $API_PID 2>/dev/null
exit 1
fi
# Start frontend in background
echo "[3/3] Starting frontend..."
npm run dev > logs/frontend.log 2>&1 &
FRONTEND_PID=$!
# Wait a moment
sleep 2
# Check if frontend started successfully
if ! kill -0 $FRONTEND_PID 2>/dev/null; then
echo "Error: Frontend failed to start. Check logs/frontend.log"
kill $API_PID $BACKEND_PID 2>/dev/null
exit 1
fi
echo
echo "=================================="
echo " All Services Running!"
echo "=================================="
echo
echo " ACE-Step API: http://localhost:8001"
echo " Backend: http://localhost:3001"
echo " Frontend: http://localhost:3000"
echo
if [ -n "$LOCAL_IP" ]; then
echo " LAN Access: http://$LOCAL_IP:3000"
echo
fi
echo " Logs: ./logs/"
echo
echo " PIDs:"
echo " API: $API_PID"
echo " Backend: $BACKEND_PID"
echo " Frontend: $FRONTEND_PID"
echo
echo "=================================="
echo
# Save PIDs for stop script
echo "$API_PID" > logs/api.pid
echo "$BACKEND_PID" > logs/backend.pid
echo "$FRONTEND_PID" > logs/frontend.pid
echo "Opening browser..."
sleep 3
# Open browser based on OS
if command -v xdg-open &> /dev/null; then
xdg-open http://localhost:3000 &
elif command -v open &> /dev/null; then
open http://localhost:3000 &
fi
echo
echo "Services are running in background."
echo "To stop all services, run: ./stop-all.sh"
echo "Or press Ctrl+C and they will continue running."
echo
# Wait for user interrupt
trap 'echo; echo "Services still running. Use ./stop-all.sh to stop them."; exit 0' INT
wait