verex

2026-06-24

Verex Task 1: basic prediction-market web UI (DB-only)

Implemented the Polymarket-style web UI per docs/tasks/jun-19-verex-design.md, on branch claude/jun-19-verex. DB-only — no smart-contract integration yet (per spec).

Verex Task 2 prep: deploy scaffolding

Added env templates (scripts/deploy.env.example, packages/api/.env.example, packages/web/.env.example + NEXT_PUBLIC_API_URL) and a DRAFT scripts/deploy.sh (two Cloud Run services + Cloud SQL, modeled on rabbit). The live deploy is held for review — it creates billable resources and needs the DNS record + domain verification + migrate/seed against Cloud SQL. scripts/deploy.env (project ID + REGION=asia-northeast3) is gitignored.

Opened as a PR for review (not merged) — the live GCP deploy will be done together.

Local dev tooling + learning docs

Added scripts/dev-local.sh — one command for local setup (Docker Postgres → prisma db push → seed 10 markets → write local .env files), plus a “Run the web UI locally / Deploy” section in the README and an educational scripts/README.md explaining every Docker / Postgres / GCP command.

Bug fix: API 500 — Environment variable not found: DATABASE_URL

Running pnpm --filter @verex/api dev returned 500 on every request with PrismaClientInitializationError: Environment variable not found: DATABASE_URL.

These (local tooling + the bug fix) are uncommitted on claude/jun-19-verex — to fold into PR #7.

Deploy hardening — made deploy.sh actually runnable

Reviewed deploy.sh and fixed the blockers that would have made it fail / leave half-built billable resources:

Still uncommitted on claude/jun-19-verex — to fold into PR #7.

Deploy prerequisites — quick check (before the first run)

deploy.sh is now runnable; before the first run, confirm:

Need Status
scripts/deploy.env filled (PROJECT_ID, REGION) ✅ set (gitignored)
GCP budget cap ✅ set
gcloud auth login likely ✅ (rabbit was deployed from this machine)
gcloud auth application-default login ⚠️ needed for the Cloud SQL Auth Proxy (migrate/seed) — run once if not done

First run is a fix-as-you-go on the *.run.app URL; do not map verex.jaylabs.xyz until that URL works. Run it watched, not unattended.

Deploy run #1 — fixes as they surfaced

First ./deploy.sh run; cloud-specific issues fixed on the fly:

✅ Deploy succeeded

After the three fixes, ./deploy.sh ran end-to-end: Cloud SQL (verex-db, Enterprise/db-f1-micro) → Secret Manager (DATABASE_URL) → migrate + seed (10 markets via the proxy) → verex-api and verex-web deployed to Cloud Run. Site reachable at the *.run.app URL.

Pending — go-live: map verex.jaylabs.xyz (domain mapping + DNS record at the registrar + SSL). Deliberately the last step, after the *.run.app URL is confirmed working.

Post-merge fix — next-env.d.ts blocked git pull

After merging PR #7, git pull on main aborted: “untracked working tree files would be overwritten by merge: packages/web/next-env.d.ts.”