2026-08-23 20:49:40 +02:00
|
|
|
.PHONY: up down api worker backend web migrate sqlc test test-api check-web vet seed seed-woo mock-woo health setup cutover-rehearsal build seed-defaults check-defaults formula-e2e
|
2026-08-09 22:47:43 +02:00
|
|
|
|
|
|
|
|
# Start local Postgres only (:5433 — pairs with host npm run setup / npm run dev)
|
|
|
|
|
up:
|
|
|
|
|
docker compose up -d
|
|
|
|
|
|
|
|
|
|
# Stop local Postgres
|
|
|
|
|
down:
|
|
|
|
|
docker compose down
|
|
|
|
|
|
|
|
|
|
# One-shot: .env + Postgres + goose migrate (cross-platform via Node)
|
|
|
|
|
setup:
|
|
|
|
|
node scripts/setup.mjs
|
|
|
|
|
|
|
|
|
|
# Run Go API (config.Load reads monorepo-root .env; or: .\scripts\run-api.ps1)
|
|
|
|
|
api:
|
|
|
|
|
cd apps/api && go run ./cmd/api
|
|
|
|
|
|
|
|
|
|
# Background job worker (processing + Woo claim + billing; required for GET /readyz)
|
|
|
|
|
worker:
|
|
|
|
|
cd apps/api && go run ./cmd/worker
|
|
|
|
|
|
|
|
|
|
# API + worker together (readyz/jobs). Prefer: npm run dev:backend (or npm run dev for +web)
|
|
|
|
|
backend:
|
|
|
|
|
npm run dev:backend
|
|
|
|
|
|
|
|
|
|
# Run SvelteKit web (Vite proxies /api → :28471; port 28472)
|
|
|
|
|
web:
|
|
|
|
|
cd apps/web && npm install && npm run dev
|
|
|
|
|
|
|
|
|
|
# Apply goose migrations and regenerate sqlc (any OS: npm run migrate)
|
|
|
|
|
migrate:
|
|
|
|
|
node scripts/migrate.mjs
|
|
|
|
|
|
|
|
|
|
# Seed local demo user (any OS: npm run seed)
|
|
|
|
|
seed:
|
|
|
|
|
node scripts/seed-local.mjs
|
|
|
|
|
|
|
|
|
|
# Seed WooCommerce demo orders/reviews/audience campaign (no live Woo required)
|
|
|
|
|
seed-woo:
|
|
|
|
|
cd apps/api && go run ./cmd/seed-woo-demo
|
|
|
|
|
|
|
|
|
|
# Local WooCommerce REST fixtures for live client proofs (see docs/live-woo-test.md)
|
|
|
|
|
mock-woo:
|
|
|
|
|
cd apps/api && go run ./cmd/mock-woo -addr 127.0.0.1:19090
|
|
|
|
|
|
|
|
|
|
# Quick health probes (API :28471; /readyz needs worker)
|
|
|
|
|
health:
|
|
|
|
|
node scripts/health.mjs
|
|
|
|
|
|
|
|
|
|
# Local cutover rehearsal: deploy-check + list-* + orphan dry-run (no Clerk/SMTP/Stripe/-confirm)
|
|
|
|
|
cutover-rehearsal:
|
|
|
|
|
node scripts/cutover-local-rehearsal.mjs
|
|
|
|
|
|
|
|
|
|
# Regenerate sqlc only
|
|
|
|
|
sqlc:
|
|
|
|
|
cd apps/api && sqlc generate
|
|
|
|
|
|
|
|
|
|
# Unit tests (API) — no live DB required for default suite
|
|
|
|
|
test: test-api
|
|
|
|
|
|
|
|
|
|
test-api:
|
|
|
|
|
cd apps/api && go test ./...
|
|
|
|
|
|
|
|
|
|
vet:
|
|
|
|
|
cd apps/api && go vet ./...
|
|
|
|
|
|
|
|
|
|
# Type-check SvelteKit (install deps first if needed)
|
|
|
|
|
check-web:
|
|
|
|
|
cd apps/web && npm run check
|
2026-08-10 02:04:45 +02:00
|
|
|
|
|
|
|
|
# Low-memory production build (web then Go api+worker binaries; ~4GB-safe defaults)
|
|
|
|
|
build:
|
|
|
|
|
node scripts/build.mjs
|
2026-08-23 20:49:40 +02:00
|
|
|
|
|
|
|
|
# Regenerate the English platform-default category formulas from the A1 seed
|
|
|
|
|
# (writes apps/api/internal/aiprompts/defaults/default-category-prompts.json).
|
|
|
|
|
seed-defaults:
|
|
|
|
|
node scripts/seed/build-default-category-prompts.mjs
|
|
|
|
|
|
|
|
|
|
# Fail if the embedded English defaults drift from the A1 seed + translation table.
|
|
|
|
|
check-defaults:
|
|
|
|
|
node scripts/seed/build-default-category-prompts.mjs --check
|
|
|
|
|
|
|
|
|
|
# Local proof that category formulas drive generation (needs Postgres + mock-llm):
|
|
|
|
|
# make up && go run ./cmd/mock-llm &
|
|
|
|
|
# make formula-e2e
|
|
|
|
|
formula-e2e:
|
|
|
|
|
cd apps/api && go run ./cmd/formula-e2e -company "A1 Slovenija" -limit 5 -llm-base http://127.0.0.1:18767/v1
|
|
|
|
|
cd apps/api && go run ./cmd/formula-e2e -new-tenant -llm-base http://127.0.0.1:18767/v1
|