File size: 717 Bytes
c89a139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

# Kill any existing processes on ports 8000 or 5173 to avoid conflicts
lsof -ti:8000 | xargs kill -9 2>/dev/null
lsof -ti:5173 | xargs kill -9 2>/dev/null

echo "πŸš€ Regenerating Data..."
python3 -c "from update_data import update_dataset; update_dataset()"

echo "πŸš€ Starting Local Backend (FastAPI)..."
# Start uvicorn in the background
# Start uvicorn in the background with LOCAL_DEV flag
LOCAL_DEV=true uvicorn app:app --host 127.0.0.1 --port 8000 &
BACKEND_PID=$!

echo "πŸš€ Starting Local Frontend (Vite)..."
cd frontend
# Overwrite the API URL to point to localhost for this session
export VITE_API_URL=http://127.0.0.1:8000
npm run dev

# When frontend stops, kill backend
kill $BACKEND_PID