#!/usr/bin/env bash set -euo pipefail DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ROOT="$DIR/.." echo "=== Building YAUM single binary ===" echo "" echo "1. Building frontend..." cd "$ROOT/frontend" npm ci npm run build echo "" echo "2. Copying frontend build to Go embed directory..." rm -rf "$ROOT/backend/internal/static/build" cp -r "$ROOT/frontend/build" "$ROOT/backend/internal/static/build" echo "" echo "3. Building Go binary..." cd "$ROOT/backend" go build -o yaum ./cmd/server/ echo "" echo "=== Done! Binary at backend/yaum ===" echo "" echo "Run with:" echo " cd backend && ./yaum"