-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·63 lines (53 loc) · 1.53 KB
/
Copy pathstart.sh
File metadata and controls
executable file
·63 lines (53 loc) · 1.53 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
#!/bin/bash
# RedisVL Playground — start all services
set -e
ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT"
echo "===== RedisVL Playground ====="
echo ""
# Check Redis
echo "[1/3] Checking Redis..."
if redis-cli ping &>/dev/null; then
echo " ✅ Redis is running"
else
echo " ⚠️ Redis not running. Start with 'make redis-start' or docker run redis."
echo " Attempting: make redis-start"
make redis-start 2>/dev/null || echo " ❌ Could not start Redis. Please start manually."
fi
# Install backend deps if needed
echo "[2/3] Starting backend (port 8000)..."
pip install -e ".[sentence-transformers]" fastapi "uvicorn[standard]" openai python-dotenv -q 2>/dev/null || true
# Start backend in background
cd "$ROOT"
python -m backend.main &
BACKEND_PID=$!
echo " ✅ Backend PID: $BACKEND_PID (port 8000)"
# Wait briefly for backend
sleep 2
# Install frontend deps if needed
echo "[3/3] Starting frontend (port 5173)..."
cd "$ROOT/frontend"
if [ ! -d "node_modules" ]; then
npm install --silent
fi
npx vite --port 5173 &
FRONTEND_PID=$!
echo " ✅ Frontend PID: $FRONTEND_PID (port 5173)"
echo ""
echo "===== All services running ====="
echo " Frontend: http://localhost:5173"
echo " Backend: http://localhost:8000"
echo " API docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all services."
# Cleanup on exit
cleanup() {
echo ""
echo "Shutting down..."
kill $BACKEND_PID 2>/dev/null || true
kill $FRONTEND_PID 2>/dev/null || true
echo "Done."
}
trap cleanup EXIT
# Wait for both
wait