#!/bin/bash # BatchMind OS — Startup Script for Docker # Starts both backend API and frontend dev server echo "============================================" echo " BatchMind OS — Starting Services..." echo "============================================" # Get the directory where the script is running ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Start frontend (serve built files with a simple Python HTTP server) cd "$ROOT_DIR/batchmind_os/frontend" if [ -d "dist" ]; then echo "✅ Serving frontend from built files on port 5173..." python -m http.server 5173 --directory dist & else echo "⚠️ Frontend not built, starting dev server..." npm run dev -- --host 0.0.0.0 & fi # Start backend cd "$ROOT_DIR" echo "✅ Starting FastAPI backend on port 7860..." python -m uvicorn batchmind_os.api.main:app --host 0.0.0.0 --port 7860