version: '3' vars: BINARY: walkies WEB_DIR: web STATIC_DIR: "{{.WEB_DIR}}/build" tasks: default: desc: List available tasks cmd: task --list # ── Frontend ──────────────────────────────────────────────────────────────── web:install: desc: Install frontend dependencies dir: "{{.WEB_DIR}}" cmd: npm install sources: - package.json generates: - node_modules/.package-lock.json web:build: desc: Build frontend for production dir: "{{.WEB_DIR}}" deps: [web:install] cmd: npm run build sources: - src/**/* - public/**/* - package.json - tsconfig.json generates: - build/**/* web:dev: desc: Start frontend dev server (hot reload on :3000) dir: "{{.WEB_DIR}}" deps: [web:install] cmd: npm start web:test: desc: Run frontend tests dir: "{{.WEB_DIR}}" deps: [web:install] cmd: npm test -- --watchAll=false # ── Backend ───────────────────────────────────────────────────────────────── go:build: desc: Build Go binary cmd: go build -o {{.BINARY}} ./cmd/server sources: - "**/*.go" - go.mod - go.sum generates: - "{{.BINARY}}" go:run: desc: Run Go server (requires built frontend) deps: [web:build] cmd: go run ./cmd/server env: STATIC_DIR: "{{.STATIC_DIR}}" go:test: desc: Run all Go tests cmd: go test ./... go:test:verbose: desc: Run Go tests with verbose output cmd: go test -v ./... go:lint: desc: Run go vet cmd: go vet ./... # ── Dev workflow ───────────────────────────────────────────────────────────── dev:backend: desc: Run backend with live reload via 'air' (install with 'go install github.com/air-verse/air@latest') cmd: air env: STATIC_DIR: "{{.STATIC_DIR}}" dev: desc: Start both frontend and backend dev servers concurrently deps: [web:build] cmds: - echo "Starting backend on :8080 and frontend dev server on :3000" # Run backend and frontend in parallel # Use 'task dev:backend' and 'task web:dev' in separate terminals for full hot reload # ── Build & Docker ─────────────────────────────────────────────────────────── build: desc: Build frontend and backend deps: [web:build, go:build] docker:build: desc: Build Docker image cmd: docker build -t walkies . docker:up: desc: Build and start with docker-compose cmd: docker-compose up --build docker:down: desc: Stop docker-compose services cmd: docker-compose down docker:logs: desc: Tail docker-compose logs cmd: docker-compose logs -f # ── Utilities ──────────────────────────────────────────────────────────────── clean: desc: Remove build artifacts cmds: - rm -f {{.BINARY}} - rm -rf {{.WEB_DIR}}/build tidy: desc: Tidy Go modules cmd: go mod tidy