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.

↓ Skip to step-by-step guide

New here? Follow this order

  1. Configure the app — from the monorepo root, copy apps/web/.env.example apps/web/.env.local and fill in values (see checklist below if something is missing).
  2. Start Hermes on your machine or network so the API is reachable (e.g. hermes gateway with API_SERVER_ENABLED=true). The BFF only talks to Hermes on the server — your browser never sees the Hermes key.
  3. Run this apppnpm run dev:web from the monorepo root (opens port 3100 by default).
  4. Token gate (if enabled) — connect your wallet, then Sign & verify so the server can check your ERC-20 balance and set a session cookie.
  5. 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 pass the token gate before chat. With gating off, you can chat immediately if Hermes is configured.

Loading session…