#!/bin/bash
# Watchline - Stock Watchlist App launcher (macOS / Linux)
cd "$(dirname "$0")"

echo "============================================"
echo "  Watchline - Stock Watchlist App"
echo "============================================"
echo

if ! command -v python3 &> /dev/null; then
    echo "[ERROR] python3 not found. Please install Python from https://www.python.org/downloads/"
    read -p "Press Enter to close..."
    exit 1
fi

echo "Checking / installing required packages (first run may take a minute)..."
python3 -m pip install -r requirements.txt -q

echo
echo "Starting server... a browser window will open automatically."
echo "Keep this window open while using the app. Press Ctrl+C to stop."
echo

python3 app.py
