forked from senpai-on-fire/SACI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebdev.sh
More file actions
executable file
·41 lines (32 loc) · 1.06 KB
/
Copy pathwebdev.sh
File metadata and controls
executable file
·41 lines (32 loc) · 1.06 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
#!/bin/bash
# Kill any existing servers on exit
trap 'kill $(jobs -p)' EXIT
# Print helpful banner
echo "=============================================================="
echo "🚀 SACI Development Environment"
echo "=============================================================="
echo "📝 IMPORTANT: For development with Hot Module Replacement:"
echo " Access your app at: http://localhost:5173"
echo " (NOT at http://localhost:8000)"
echo "=============================================================="
# Start Vite dev server in web directory
cd web
# Check if node_modules exists, if not run npm install
echo "Installing npm dependencies..."
npm install
# Build static assets for FastAPI to serve
echo "Building static assets..."
npm run build
# Start FastAPI server
cd ..
echo "Starting FastAPI server on port 8000..."
fastapi dev saci/webui/web.py --host 127.0.0.1 --port 8000 &
FASTAPI_PID=$!
# Wait for FastAPI to start
sleep 2
# Start Vite dev server
cd web
echo "Starting Vite development server on port 5173..."
npm run dev
# Keep script running
wait $FASTAPI_PID