#!/bin/bash # run.sh - Start the development environment set -e echo "🚀 Starting Multi-Agent System..." # Activate virtual environment if [ ! -d "venv" ]; then echo "❌ Virtual environment not found. Run './scripts/setup.sh' first" exit 1 fi source venv/bin/activate # Load environment variables if [ -f ".env" ]; then export $(cat .env | xargs) else echo "⚠️ .env file not found. Using defaults." fi # Start Redis in background (requires redis-server installed) if command -v redis-server &> /dev/null; then echo "🔴 Starting Redis..." redis-server --daemonize yes fi # Start backend echo "🐍 Starting FastAPI backend on http://localhost:8000" uvicorn backend.api.main:app --host 0.0.0.0 --port 8000 --reload & BACKEND_PID=$! # Start frontend in background if [ -d "frontend" ]; then echo "🌐 Starting React frontend on http://localhost:3000" cd frontend npm run dev & FRONTEND_PID=$! cd .. fi echo "✨ System started!" echo "Backend: http://localhost:8000" echo "Frontend: http://localhost:3000" echo "API Docs: http://localhost:8000/docs" echo "" echo "Press Ctrl+C to stop" # Wait for processes wait $BACKEND_PID