- FastAPI backend with PostgreSQL database connection - Frontend dashboard with lightweight-charts - Technical indicators (SMA, EMA, RSI, MACD, Bollinger Bands, etc.) - Trading strategy simulation and backtesting - Database connection to NAS at 20.20.20.20:5433 - Development server setup and documentation
48 lines
1.3 KiB
Bash
48 lines
1.3 KiB
Bash
#!/bin/bash
|
|
|
|
echo "==================================="
|
|
echo " BTC Trading Dashboard - Development Server"
|
|
echo "==================================="
|
|
echo ""
|
|
|
|
# Check if venv exists
|
|
if [ ! -d "venv" ]; then
|
|
echo "[ERROR] Virtual environment not found!"
|
|
echo "Please run setup first to create the venv."
|
|
exit 1
|
|
fi
|
|
|
|
# Activate venv
|
|
source venv/bin/activate
|
|
|
|
# Check dependencies
|
|
echo "[1/3] Checking dependencies..."
|
|
if ! pip show fastapi > /dev/null 2>&1; then
|
|
echo "Installing dependencies..."
|
|
pip install -r requirements.txt
|
|
if [ $? -ne 0 ]; then
|
|
echo "[ERROR] Failed to install dependencies"
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "[2/3] Testing database connection..."
|
|
python test_db.py
|
|
if [ $? -ne 0 ]; then
|
|
echo "[WARNING] Database connection test failed"
|
|
read -p "Press Enter to continue or Ctrl+C to cancel..."
|
|
fi
|
|
|
|
echo "[3/3] Starting development server..."
|
|
echo ""
|
|
echo "==================================="
|
|
echo " Server will start at:"
|
|
echo " - API Docs: http://localhost:8000/docs"
|
|
echo " - Dashboard: http://localhost:8000/dashboard"
|
|
echo " - Health: http://localhost:8000/api/v1/health"
|
|
echo "==================================="
|
|
echo ""
|
|
echo "Press Ctrl+C to stop the server"
|
|
echo ""
|
|
|
|
uvicorn src.api.server:app --reload --host 0.0.0.0 --port 8000 |