402Briefbar
Stack

One Next.js process. TypeScript. No database yet.

Briefbar is a single web app, not a platform. Humans get HTML. Agents get JSON over HTTP 402. Everything in this cloud environment is that one Node process plus three public upstreams.

Languages and runtime

TypeScript throughout. React 19 for the pages. Next.js 16 App Router for both UI and Route Handlers. Tailwind v4 and shadcn/ui for the desk chrome. Node.js built-ins (crypto, fetch) for HMAC demo receipts and upstream calls.

Where the code lives

app/
Routes: human pages, /api/v1/briefs/[kind], catalog, demo facilitator, ledger, health, OpenAPI, /.well-known/*, /llms.txt.
lib/
x402 header codec, catalog/SKUs, paywall, in-memory ledger, Wikipedia / HN / Open-Meteo / protocol fulfillers, discovery documents.
components/
Playground, SKU cards, chrome. shadcn primitives under ui/.

Servers, right now

Development is next dev on 127.0.0.1:43147 inside this cloud VM. There is no Docker Compose, no local Postgres, no Redis. Upstream HTTP is live: Wikipedia, Hacker News Algolia, Open-Meteo.

The x402 facilitator on this instance is in-process: POST /api/demo/receipt HMAC-signs a payload. Production USDC would call an external facilitator.

What database we would expect

None is required for the 402 loop itself. Quotes and briefs are stateless besides a nonce. Today sales and used nonces live in process RAM and die with the server.

The first real store would be Postgres for: settled receipts, consumed nonces, SKU config, and cached upstream packets.

Deployment shape

This is an ordinary Next.js app. Vercel or any Node host that can run next build / next start is the path. Set BRIEFBAR_DEMO_SECRET and NEXT_PUBLIC_SITE_URL on the host.

Grok fleet and pstack

A Grok fleet will pick SKUs, police sourcing, and triage this page. That fleet talks through ops/ and Origin PRs. Slack is a human projector at most.

Engineering uses pstack: /add-plugin pstack, /setup-pstack, /poteto-mode. pstack is how code is written.

Grok / xAI surfaceability

Two different Grok surfaces matter.

  1. Live search / citation. A Grok answer that browses the web needs crawlable HTML. This desk allows all xAI user-agents and publishes a sitemap.
  2. Tool-using agent. A Grok agent that can pay should start at /llms.txt, /openapi.json, /.well-known/agent.json, and /.well-known/x402.

We do not run bot-blocking middleware. A 402 is a price, not a block.