#!/usr/bin/env bash
set -euo pipefail

REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$REPO_ROOT"

if [[ ! -f .env ]]; then
  echo "Missing .env in $REPO_ROOT"
  echo "Run: cp .env.example .env"
  exit 1
fi

"$REPO_ROOT/scripts/check-prototype-env.sh" "$REPO_ROOT/.env"

echo "Starting prototype stack with Docker Compose..."
docker compose up -d --build

echo ""
echo "Prototype stack started."
echo "Useful commands:"
echo "  docker compose ps"
echo "  docker compose logs -f platform-service"
echo "  docker compose logs -f extraction-service"
echo "  docker compose logs -f mcp-server"
