.PHONY: help help: ## Show this help message @echo 'Usage: make [target]' @echo '' @echo 'Targets:' @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) .PHONY: install install: ## Install dependencies @echo "Setting up private module configuration..." go env -w GOPRIVATE=code.springupsoftware.com go mod download go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest .PHONY: sqlc sqlc: ## Generate Go code from SQL queries sqlc generate .PHONY: build build: sqlc ## Build the application go build -o bin/server cmd/server/main.go .PHONY: run run: ## Run the application go run cmd/server/main.go .PHONY: dev dev: sqlc ## Run the application with hot reload (requires air) air .PHONY: test test: ## Run tests go test -v ./... .PHONY: clean clean: ## Clean build artifacts rm -rf bin/ rm -rf internal/cmc/db/*.go .PHONY: docker-build docker-build: ## Build Docker image docker build -t cmc-go:latest -f Dockerfile.go . .PHONY: docker-run docker-run: ## Run application in Docker docker run --rm -p 8080:8080 --network=host cmc-go:latest .PHONY: dbshell dbshell: ## Connect to MariaDB database interactively @echo "Connecting to MariaDB..." @if [ -z "$$DB_PASSWORD" ]; then \ echo "Reading password from docker-compose environment..."; \ docker compose exec db mariadb -u cmc -p cmc; \ else \ docker compose exec -e MYSQL_PWD="$$DB_PASSWORD" db mariadb -u cmc cmc; \ fi .PHONY: dbshell-root dbshell-root: ## Connect to MariaDB as root user @echo "Connecting to MariaDB as root..." @if [ -z "$$DB_ROOT_PASSWORD" ]; then \ echo "Please set DB_ROOT_PASSWORD environment variable"; \ exit 1; \ else \ docker compose exec -e MYSQL_PWD="$$DB_ROOT_PASSWORD" db mariadb -u root; \ fi