-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·70 lines (58 loc) · 1.45 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·70 lines (58 loc) · 1.45 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
echo "Starting AIsiteBuilder..."
if ! command -v node &> /dev/null; then
echo "Node.js is not installed. Please install Node.js first."
exit 1
fi
if ! command -v npm &> /dev/null; then
echo "npm is not installed. Please install npm first."
exit 1
fi
check_dependencies() {
local dir=$1
if [ ! -d "$dir/node_modules" ]; then
echo "Installing dependencies in $dir..."
cd "$dir" && npm install
cd ..
fi
}
echo "Checking dependencies..."
check_dependencies "backend"
check_dependencies "frontend"
if [ ! -f "backend/.env" ]; then
echo " Backend .env file not found!"
echo "Please create backend/.env with your API keys:"
echo "E2B_API_KEY=your_e2b_api_key_here"
echo "GOOGLE_API_KEY=your_google_api_key_here"
echo "PORT=3003"
echo ""
echo "Get your E2B API key from: https://e2b.dev"
echo "Get your Google API key from: https://aistudio.google.com/app/apikey"
exit 1
fi
echo "Starting backend server..."
cd backend
npm run dev &
BACKEND_PID=$!
cd ..
sleep 3
echo "Starting frontend server..."
cd frontend
npm run dev &
FRONTEND_PID=$!
cd ..
echo ""
echo "Both servers are starting up!"
echo ""
echo "Backend: http://localhost:3003"
echo "Frontend: http://localhost:5173"
echo ""
echo "Press Ctrl+C to stop both servers"
cleanup() {
echo ""
echo "Stopping servers..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
exit 0
}
trap cleanup INT TERM
wait