#!/bin/bash

# Quick development setup script for translate.press.zone backend

echo "🚀 Starting translate.press.zone backend development environment..."

# Check if API server is running
if ! curl -s http://localhost:3000/health > /dev/null; then
    echo "❌ API server not running on port 3000"
    echo "💡 To start the API server:"
    echo "   cd press-zone-backend/api"
    echo "   npm install"
    echo "   cp .env.example .env"
    echo "   npm run dev"
    exit 1
fi

echo "✅ API server is running"

# Check if admin panel is running
if ! curl -s http://localhost:5173 > /dev/null; then
    echo "❌ Admin panel not running on port 5173"
    echo "💡 To start the admin panel:"
    echo "   cd press-zone-backend/admin-panel"
    echo "   npm install"
    echo "   npm run dev"
    exit 1
fi

echo "✅ Admin panel is running"
echo "🎉 Development environment is ready!"
echo ""
echo "📍 Services:"
echo "   API Server: http://localhost:3000"
echo "   Admin Panel: http://localhost:5173"
echo "   Health Check: http://localhost:3000/health"
