.PHONY: build build-web build-go dev test clean # Build the production single binary (embeds the Svelte SPA) build: build-web build-go build-web: @echo "==> Building Svelte frontend..." cd web && npm run build build-go: @echo "==> Building Go binary (production, embeds web/build)..." go build -tags production -o wotra ./cmd/wotra # Development mode: run Go server + Vite dev server concurrently dev: @echo "==> Starting development servers..." @echo " Go API: http://localhost:8080" @echo " Vite UI: http://localhost:5173" @trap 'kill 0' INT; \ AUTH_TOKEN=$${AUTH_TOKEN:-devtoken} go run ./cmd/wotra & \ cd web && npm run dev # Run all Go tests test: go test ./... # Install frontend dependencies web/node_modules: cd web && npm install # Remove build artifacts clean: rm -f wotra rm -rf web/build web/.svelte-kit