# R2D2-Holocron — local development targets
#
# Production deploys to Kubernetes, not docker compose. See docs/plans/ for K8s.
#
# Profiles defined in docker-compose.yml:
#   local  → full stack in containers
#   dev    → backing services only; frontend on host (npm run start:dev)
#   demo   → synthetic MQTT publisher

.PHONY: up up-dev up-bare down logs rebuild clean ps config

COMPOSE := docker compose

# Default: full local stack with demo data
up:
	$(COMPOSE) --profile local --profile demo up --build -d

# Dev mode: backing services in docker, frontend on host
up-dev:
	$(COMPOSE) --profile dev --profile demo up --build -d
	@echo ""
	@echo "Now start the frontend on the host:"
	@echo "  cd holocron-frontend && npm run start:dev"

# Local stack without synthetic data (for real MQTT feeds)
up-bare:
	$(COMPOSE) --profile local up --build -d

down:
	$(COMPOSE) --profile local --profile dev --profile demo down

logs:
	$(COMPOSE) logs -f

rebuild: down up

clean:
	$(COMPOSE) --profile local --profile dev --profile demo down -v

ps:
	$(COMPOSE) ps

config:
	$(COMPOSE) --profile local --profile demo config
