#!/bin/bash
# Development helper script

set -e

case "$1" in
  start)
    echo "Starting development environment..."
    docker-compose up -d
    echo "Waiting for services to be ready..."
    sleep 5
    pnpm dev
    ;;
  stop)
    echo "Stopping development environment..."
    docker-compose down
    ;;
  restart)
    echo "Restarting development environment..."
    docker-compose restart
    ;;
  logs)
    docker-compose logs -f
    ;;
  clean)
    echo "Cleaning development environment..."
    docker-compose down -v
    pnpm clean
    ;;
  *)
    echo "Usage: $0 {start|stop|restart|logs|clean}"
    echo ""
    echo "  start   - Start Docker services and run dev servers"
    echo "  stop    - Stop Docker services"
    echo "  restart - Restart Docker services"
    echo "  logs    - Show Docker logs"
    echo "  clean   - Stop services and remove volumes"
    exit 1
    ;;
esac

