#!/bin/bash
export SERVER_PORT=8082
export DB_HOST=localhost
export DB_PORT=5432
export DB_NAME=eventdb
export DB_USERNAME=eventuser
export DB_PASSWORD=eventpass
export DDL_AUTO=update
export REDIS_HOST=localhost
export REDIS_PORT=6379
export REDIS_PASSWORD=""
export KAFKA_BOOTSTRAP_SERVERS=localhost:9092
export JWT_SECRET="dev-jwt-secret-key-for-local-development-minimum-32-bytes"
export CONTENT_SERVICE_URL=http://localhost:8083
export DISTRIBUTION_SERVICE_URL=http://localhost:8086
export LOG_LEVEL=DEBUG
export SQL_LOG_LEVEL=DEBUG

echo "🚀 Starting Event Service on port 8082..."
./gradlew :event-service:bootRun --args='--spring.profiles.active=' > logs/event-service.log 2>&1 &
echo $! > .event-service.pid
echo "✅ Event Service started with PID: $(cat .event-service.pid)"
echo "📋 Check logs: tail -f logs/event-service.log"
