KMH
Initial commit: FastVLM Screen Observer application
509a107
#!/bin/bash
echo "Starting FastVLM-7B Screen Observer..."
echo "======================================="
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "Error: Python 3 is not installed"
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "Error: Node.js is not installed"
exit 1
fi
# Install backend dependencies if needed
echo ""
echo "Setting up backend..."
cd backend
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
fi
echo "Activating virtual environment..."
source venv/bin/activate
echo "Installing Python dependencies..."
pip install -r requirements.txt
# Start backend in background
echo ""
echo "Starting FastAPI backend on http://localhost:8000..."
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload &
BACKEND_PID=$!
# Install frontend dependencies if needed
echo ""
echo "Setting up frontend..."
cd ../frontend
if [ ! -d "node_modules" ]; then
echo "Installing Node dependencies..."
npm install --cache /tmp/npm-cache
fi
# Start frontend
echo ""
echo "Starting React frontend on http://localhost:5173..."
npm run dev &
FRONTEND_PID=$!
echo ""
echo "======================================="
echo "Application started successfully!"
echo ""
echo "Frontend: http://localhost:5173"
echo "Backend API: http://localhost:8000"
echo "API Docs: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all services"
echo "======================================="
# Wait for Ctrl+C
trap "echo 'Shutting down...'; kill $BACKEND_PID $FRONTEND_PID; exit" INT
wait