Skip to content

feat(console): point /api at the BenzoNet L1 BFF#57

Merged
hitakshiA merged 1 commit into
mainfrom
codex/56-benzonet-bff
Jul 10, 2026
Merged

feat(console): point /api at the BenzoNet L1 BFF#57
hitakshiA merged 1 commit into
mainfrom
codex/56-benzonet-bff

Conversation

@hitakshiA

@hitakshiA hitakshiA commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Closes #56. Repoints the console's /api rewrite to https://benzonet-api.benzo.space — the BenzoNet BFF instance now live on our Azure VM (benzo-api-benzonet: CHAIN_ENV=benzonet, chain 68420, eERC 0xEE46418e…, own Postgres, funded ops key, dev zk-artifacts, L1 RPC via socat; API_DOMAIN=console.benzo.space so SIWE verifies; CORS allows console.benzo.space). Health: https://benzonet-api.benzo.space/healthz → 200. App-side BenzoNet config already matches the live manifest.

Summary by CodeRabbit

  • Bug Fixes
    • Updated API request routing to use the new backend endpoint, improving connectivity for console API calls.

Greptile Summary

This PR updates the Vercel rewrite rule in apps/console/vercel.json to point /api proxy traffic at the newly live BenzoNet BFF (benzonet-api.benzo.space) instead of the previous Cloud Run endpoint. The change is a single-line URL swap with no structural modifications.

  • The new destination is an Azure-hosted custom domain (benzonet-api.benzo.space) replacing the previous Google Cloud Run URL; HTTPS is preserved and the rewrite pattern is unchanged.
  • Because the URL is hardcoded, all Vercel deployments — including PR previews — will proxy to the production BenzoNet backend, and SIWE auth will reject requests from non-console.benzo.space origins.

Confidence Score: 4/5

Safe to merge for production; the one-line change correctly points the console at the live BenzoNet BFF with HTTPS intact.

The URL swap is correct and the rewrite pattern is untouched. The only notable trade-off is that every Vercel preview deployment will silently proxy to the live production backend, and SIWE domain-binding will block auth on those previews — but that is a pre-existing limitation of this deployment pattern rather than a regression introduced here.

No files require special attention; apps/console/vercel.json is the only changed file and the change is minimal.

Important Files Changed

Filename Overview
apps/console/vercel.json Single-line URL swap in the /api rewrite destination — from a Cloud Run URL to benzonet-api.benzo.space; no structural changes, but the hardcoded production URL means all Vercel preview deployments will proxy to the live BenzoNet backend.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Browser
    participant Vercel as Vercel Edge (console.benzo.space)
    participant BFF as BenzoNet BFF (benzonet-api.benzo.space)

    Browser->>Vercel: "GET /api/:path*"
    Note over Vercel: Rewrite rule matches /api/:path*
    Vercel->>BFF: "Proxy → https://benzonet-api.benzo.space/:path*"
    BFF-->>Vercel: Response (CORS allows console.benzo.space)
    Vercel-->>Browser: Forwarded response

    Browser->>Vercel: GET /(non-api path)
    Note over Vercel: SPA fallback rule
    Vercel-->>Browser: /index.html
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Browser
    participant Vercel as Vercel Edge (console.benzo.space)
    participant BFF as BenzoNet BFF (benzonet-api.benzo.space)

    Browser->>Vercel: "GET /api/:path*"
    Note over Vercel: Rewrite rule matches /api/:path*
    Vercel->>BFF: "Proxy → https://benzonet-api.benzo.space/:path*"
    BFF-->>Vercel: Response (CORS allows console.benzo.space)
    Vercel-->>Browser: Forwarded response

    Browser->>Vercel: GET /(non-api path)
    Note over Vercel: SPA fallback rule
    Vercel-->>Browser: /index.html
Loading

Fix All in Claude Code Fix All in Cursor Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/console/vercel.json:7
**Preview deployments will proxy to the live production backend**

The destination URL is hardcoded to `benzonet-api.benzo.space`, so every Vercel preview deployment (e.g. `benzo-console-git-feat-*.vercel.app`) will proxy `/api` to the same production BenzoNet BFF. Combined with `API_DOMAIN=console.benzo.space` on the backend, SIWE nonce verification and auth flows will fail for any origin that isn't `console.benzo.space`. This means PR preview links effectively can't be used for end-to-end testing of auth-gated flows.

Reviews (1): Last reviewed commit: "feat(console): point /api at the BenzoNe..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

…space)

The console is a thin client over the BFF; app-side BenzoNet config already matches
the live manifest (eERC 0xEE46418e…, Registrar 0x0B1f4e78…). This repoints the /api
rewrite from the Fuji-era Cloud Run backend to the BenzoNet API instance now live on
our Azure VM (its own DB, ops key, dev zk-artifacts, L1 RPC; API_DOMAIN=console.benzo.space).
@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The console’s Vercel configuration changes the /api/:path* rewrite destination from the previous Cloud Run backend to the BenzoNet API host.

Changes

API routing

Layer / File(s) Summary
Update API rewrite destination
apps/console/vercel.json
The /api/:path* rewrite now forwards requests to https://benzonet-api.benzo.space/:path*; other rewrite entries remain unchanged.

Estimated code review effort: 2 (Simple) | ~5 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The code change matches the core scope by repointing /api to the BenzoNet BFF; the rest is verification/context.
Out of Scope Changes check ✅ Passed The PR only changes the Vercel rewrite target and introduces no unrelated code paths.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: repointing the console /api rewrite to the BenzoNet BFF.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/56-benzonet-bff

Comment @coderabbitai help to get the list of available commands.

Comment thread apps/console/vercel.json
"framework": "vite",
"rewrites": [
{ "source": "/api/:path*", "destination": "https://benzo-api-dzv6bwbpba-ue.a.run.app/:path*" },
{ "source": "/api/:path*", "destination": "https://benzonet-api.benzo.space/:path*" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Preview deployments will proxy to the live production backend

The destination URL is hardcoded to benzonet-api.benzo.space, so every Vercel preview deployment (e.g. benzo-console-git-feat-*.vercel.app) will proxy /api to the same production BenzoNet BFF. Combined with API_DOMAIN=console.benzo.space on the backend, SIWE nonce verification and auth flows will fail for any origin that isn't console.benzo.space. This means PR preview links effectively can't be used for end-to-end testing of auth-gated flows.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/console/vercel.json
Line: 7

Comment:
**Preview deployments will proxy to the live production backend**

The destination URL is hardcoded to `benzonet-api.benzo.space`, so every Vercel preview deployment (e.g. `benzo-console-git-feat-*.vercel.app`) will proxy `/api` to the same production BenzoNet BFF. Combined with `API_DOMAIN=console.benzo.space` on the backend, SIWE nonce verification and auth flows will fail for any origin that isn't `console.benzo.space`. This means PR preview links effectively can't be used for end-to-end testing of auth-gated flows.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Claude Code Fix in Cursor Fix in Codex

@hitakshiA
hitakshiA merged commit 8486587 into main Jul 10, 2026
2 checks passed
@hitakshiA
hitakshiA deleted the codex/56-benzonet-bff branch July 10, 2026 17:05
@hitakshiA

Copy link
Copy Markdown
Contributor Author

Greptile note (preview→prod backend): acknowledged — the destination is a fixed URL like the previous Cloud Run one. For BenzoNet specifically this is low-risk (it's our own permissioned test L1, not real-money mainnet), so preview builds hitting the same BFF is acceptable for now. Worth parameterizing via a Vercel env + $VAR in a follow-up if we spin up mainnet/testnet console variants.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(console): point the BenzoNet console deploy at the BenzoNet L1 BFF + verify e2e

1 participant