fix: integrate AI cross-platform start scripts

Former-commit-id: 2054b6036d
This commit is contained in:
anoracleofra-code
2026-03-08 14:55:11 -06:00
parent c8f3812fbf
commit 9c85e08839
3 changed files with 44 additions and 18 deletions
+23 -17
View File
@@ -10,31 +10,38 @@ if ! command -v npm &> /dev/null; then
exit 1
fi
# Check for Python
if ! command -v python3 &> /dev/null; then
# Check for Python 3
PYTHON_CMD=""
if command -v python3 &> /dev/null; then
PYTHON_CMD="python3"
elif command -v python &> /dev/null; then
PYTHON_CMD="python"
else
echo "[!] ERROR: python3 is not installed. Please install Python 3.10+ (https://python.org/)"
exit 1
fi
echo "[*] Using Python: $PYTHON_CMD ($($PYTHON_CMD --version 2>&1))"
# Get the directory where this script lives (handles running from any location)
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
echo "[*] Setting up Backend Environment..."
cd backend
cd "$SCRIPT_DIR/backend"
if [ ! -d "venv" ]; then
echo "[*] Creating Python Virtual Environment..."
python3 -m venv venv
$PYTHON_CMD -m venv venv
fi
echo "[*] Installing Backend dependencies..."
if [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
# In case someone runs this in Git Bash on Windows
source venv/Scripts/activate
else
source venv/bin/activate
fi
pip install -r requirements.txt
cd ..
source venv/bin/activate
pip install -q -r requirements.txt
deactivate
cd "$SCRIPT_DIR"
echo "[*] Setting up Frontend Environment..."
cd frontend
cd "$SCRIPT_DIR/frontend"
if [ ! -d "node_modules" ]; then
echo "[*] Installing Frontend dependencies..."
npm install
@@ -42,11 +49,10 @@ fi
echo ""
echo "======================================================="
echo " 🚀 Starting Services... "
echo " Dashboard will be available at: http://localhost:3000"
echo " Keep this window open! Note: Initial load takes ~10s "
echo " Starting Services... "
echo " Dashboard will be available at: http://localhost:3000 "
echo " Keep this window open! Initial load takes ~10s "
echo "======================================================="
echo ""
# Start both services (npm run dev automatically calls the python backend on Mac/Linux if scripts are configured cross-platform)
npm run dev