CSAI — gated Hermes (BFF)
This app is a Next.js backend-for-frontend: it signs you in with a wallet, checks an ERC-20 balance when gating is on, then sends chat to your Hermes gateway using a server-only API key. Nothing secret goes to the browser.
New here? Follow this order
- Configure the app — from the monorepo root, copy
apps/web/.env.example→apps/web/.env.localand fill in values (see checklist below if something is missing). - Start Hermes on your machine or network so the API is reachable (e.g.
hermes gatewaywithAPI_SERVER_ENABLED=true). The BFF only talks to Hermes on the server — your browser never sees the Hermes key. - Run this app —
pnpm run dev:webfrom the monorepo root (opens port 3100 by default). - Token gate (if enabled) — connect your Base wallet, then Sign & verify balance so the server can check for at least 1,000 DFY and set a session cookie.
- Chat — type a message and send. If gating is on, you must complete step 4 first.
One-line copy: dev without token gating
In .env.local set GATING_ENABLED=false and a reachable HERMES_API_BASE_URL plus a long BFF_JWT_SECRET (needed if you use "Sign & verify" later). Start Hermes, then pnpm run dev:web.
More detail: apps/web/README.md in the repo.
Use the app
You must hold at least 1,000 DFY on Base and pass the token gate before chat.
Loading session…