-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathstartup.sh
More file actions
44 lines (35 loc) Β· 1.1 KB
/
startup.sh
File metadata and controls
44 lines (35 loc) Β· 1.1 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
# startup.sh - Script to run OpenExchange frontend and backend
echo "π Starting OpenExchange Setup..."
# Navigate to client directory and install dependencies
echo "π¦ Setting up frontend..."
cd client
echo "Installing frontend dependencies..."
npm i --legacy-peer-deps
echo "β
Frontend dependencies installed"
# Start frontend in background
echo "π Starting frontend server..."
npm run dev &
FRONTEND_PID=$!
echo "Frontend server started with PID: $FRONTEND_PID"
# Return to root directory
cd ..
# Navigate to backend directory
echo "π¦ Setting up backend..."
cd OpenEx-Backend
echo "Updating Go dependencies..."
go mod tidy
echo "β
Backend dependencies updated"
# Start backend
echo "π Starting backend server..."
echo "Backend logs will appear below:"
echo "--------------------------------------"
go run cmd/api/main.go
# This part will only execute if the backend server stops
echo "Backend server stopped"
# Kill frontend server if it's still running
if ps -p $FRONTEND_PID > /dev/null; then
echo "Stopping frontend server..."
kill $FRONTEND_PID
fi
echo "π£ All servers stopped"