-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart_dashboard.sh
More file actions
executable file
·51 lines (41 loc) · 1.22 KB
/
Copy pathstart_dashboard.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.22 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
#!/bin/bash
# Starts the Signal Engine dashboard (API + frontend).
# Works on any machine — no hardcoded paths.
set -e
# Resolve the project root relative to this script's location,
# regardless of where the script is called from.
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$SCRIPT_DIR"
API_DIR="$PROJECT_ROOT/dashboard/api"
FRONTEND_DIR="$PROJECT_ROOT/dashboard/frontend"
# Load .env so API process inherits keys (XAI_API_KEY, ANTHROPIC_API_KEY, etc.)
if [ -f "$PROJECT_ROOT/.env" ]; then
set -a
# shellcheck disable=SC1091
source "$PROJECT_ROOT/.env"
set +a
fi
# Activate venv if present
VENV="$PROJECT_ROOT/venv/bin/activate"
if [ -f "$VENV" ]; then
source "$VENV"
fi
echo ""
echo "Project root: $PROJECT_ROOT"
echo ""
echo "Starting Signal Engine API..."
cd "$API_DIR"
uvicorn main:app --host 0.0.0.0 --port 8000 &
API_PID=$!
echo "Starting frontend dev server..."
cd "$FRONTEND_DIR"
npm run dev &
FRONTEND_PID=$!
echo ""
echo "Signal Engine dashboard running:"
echo " API: http://localhost:8000/docs"
echo " Dashboard: http://localhost:5173"
echo ""
echo "Press Ctrl+C to stop both servers."
trap "kill $API_PID $FRONTEND_PID 2>/dev/null; echo 'Servers stopped.'" EXIT
wait