#!/bin/bash # EvoTraders Development Startup Script # Single-process FastAPI with auto-reload set -e echo "==========================================" echo "EvoTraders Development Environment" echo "==========================================" # Colors for output RED='\033[0;31m' GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color # Check virtual environment if [ -z "$VIRTUAL_ENV" ]; then echo -e "${YELLOW}Warning: Virtual environment not activated${NC}" echo "Activating .venv..." source .venv/bin/activate fi # Load environment variables if [ -f .env ]; then echo -e "${GREEN}Loading environment from .env${NC}" export $(grep -v '^#' .env | xargs) else echo -e "${YELLOW}Warning: .env file not found${NC}" fi # Check required environment variables if [ -z "$OPENAI_API_KEY" ]; then echo -e "${RED}Error: OPENAI_API_KEY not set${NC}" echo "Please set it in .env file or environment" exit 1 fi echo "" echo "Starting EvoTraders API (FastAPI) on port 8000..." echo "API Endpoints: http://localhost:8000/docs" echo "" # Start FastAPI with auto-reload for development cd /Users/cillin/workspeace/evotraders python -m uvicorn backend.app:app \ --host 0.0.0.0 \ --port 8000 \ --reload \ --reload-dir backend \ --log-level info