# KROW Workforce Project Makefile
# -------------------------------
# This is the main entry point. It includes modular Makefiles from the 'makefiles/' directory.

# The default command to run if no target is specified.
.DEFAULT_GOAL := help

# --- Include Modules ---
include makefiles/common.mk
include makefiles/web.mk
include makefiles/launchpad.mk
include makefiles/mobile.mk
include makefiles/dataconnect.mk
include makefiles/tools.mk

# --- Main Help Command ---
.PHONY: help

help:
	@echo "--------------------------------------------------"
	@echo " KROW Workforce - Available Makefile Commands"
	@echo "--------------------------------------------------"
	@echo ""
	@echo "  --- CORE DEVELOPMENT ---"
	@echo "  make install          - Installs web frontend dependencies."
	@echo "  make dev              - Starts the local web frontend server."
	@echo "  make build            - Builds the web frontend for production."
	@echo "  make launchpad-dev    - Starts the local launchpad server (Firebase Hosting emulator)."
	@echo ""
	@echo "  --- MOBILE APP DEVELOPMENT ---"
	@echo "  make mobile-install               - Bootstrap the mobile workspace (Melos)."
	@echo "  make mobile-info                  - List custom mobile development commands."
	@echo "  make mobile-client-dev-android    - Run client app in dev mode (Android)."
	@echo "  make mobile-client-build PLATFORM=apk - Build client app for specified platform."
	@echo "  make mobile-staff-dev-android     - Run staff app in dev mode (Android)."
	@echo "  make mobile-staff-build PLATFORM=apk  - Build staff app for specified platform."
	@echo ""
	@echo "  --- DEPLOYMENT ---"
	@echo "  make deploy-launchpad-hosting - Deploys internal launchpad to Firebase Hosting."
	@echo "  make deploy-app [ENV=staging] - Builds and deploys the main web app (default: dev)."
	@echo ""
	@echo "  --- DEVELOPMENT TOOLS ---"
	@echo "  make install-melos     - Installs Melos globally if not already present."
	@echo "  make install-git-hooks - Installs git pre-push hook to protect main/dev branches."
	@echo "  make sync-prototypes   - Builds and copies prototypes from adjacent 'client-krow-poc' repo."
	@echo ""
	@echo "  --- DATA CONNECT MANAGEMENT ---"
	@echo "  make dataconnect-init         - Initializes Firebase Data Connect."
	@echo "  make dataconnect-deploy       - Deploys Data Connect schemas."
	@echo "  make dataconnect-sql-migrate  - Applies SQL migrations."
	@echo "  make dataconnect-generate-sdk - Regenerates the Data Connect SDK."
	@echo "  make dataconnect-sync         - Runs migrate + deploy + generate-sdk."
	@echo "  make dataconnect-bootstrap-db - ONE-TIME: Full Cloud SQL + Data Connect setup."
	@echo ""
	@echo "  make help             - Shows this help message."
	@echo "--------------------------------------------------"