
.PHONY: frontend-dev backend/run generate/openapi bugsink

frontend/run:
	cd frontend/apps/cli && node --env-file=../../../.env --import tsx src/index.tsx

backend/run:
	cd backend && SENTRY_DSN=$$(grep '^SENTRY_DSN=' ../.env 2>/dev/null | cut -d= -f2-) mvn spring-boot:run

generate/openapi:
	./scripts/generate-openapi.sh

bugsink:
	@. ./.env 2>/dev/null || true; \
	docker start bugsink 2>/dev/null || \
	docker run \
		--name bugsink \
		-p 8000:8000 \
		-e SECRET_KEY=$${BUGSINK_SECRET_KEY:?BUGSINK_SECRET_KEY muss gesetzt sein} \
		-e CREATE_SUPERUSER=admin:admin \
		bugsink/bugsink:latest
	@echo "Bugsink: http://localhost:8000 (admin/admin)"
