-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_app.sh
More file actions
33 lines (28 loc) · 913 Bytes
/
start_app.sh
File metadata and controls
33 lines (28 loc) · 913 Bytes
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
#!/bin/bash
# Kill any existing processes on ports 8000 and 3000
echo "Cleaning up ports 8000 and 3000..."
lsof -t -i:8000 -i:3000 | xargs kill -9 2>/dev/null
echo "Starting VN-ResQ System..."
# Start Backend
echo "Starting Backend on port 8000..."
cd backend
# Ensure dependencies are installed (quietly)
python3 -m pip install -q -r requirements.txt
python3 -m uvicorn main:app --reload --host 0.0.0.0 --port 8000 &
BACKEND_PID=$!
# Start Frontend
echo "Starting Frontend on port 3000..."
cd ../frontend
npm run dev &
FRONTEND_PID=$!
echo "Systems started."
echo "Backend PID: $BACKEND_PID"
echo "Frontend PID: $FRONTEND_PID"
echo ""
echo "Access User Site: http://localhost:3000/user"
echo "Access Rescue Dashboard: http://localhost:3000/rescue/dashboard"
echo "Access API Docs: http://localhost:8000/docs"
echo ""
echo "Press CTRL+C to stop both servers."
trap "kill $BACKEND_PID $FRONTEND_PID" INT
wait