# recipes/client

The proof for @aweftjs/client and the auth battery's client half: a small application.

Two halves, one server. In Node: someone opens an app, shares a document and asks a module before the socket is open, learns it is nobody, signs up, gets its own state document, and keeps working while the server is restarted underneath it. Then in Chromium: the same server serves a real page whose every part is a module. A visit to a gated URL while anonymous shows the battery's sign-in form, a sign-up through that form makes the page somebody, and the gated act renders over the document the page shares.

A browser needs no seams for the Node half. Node needs two, and only two: a socket that carries the cookie header, and a fetch that keeps the cookie, because Node's keeps none.

```sh
node --import @aweftjs/build/loader recipes/client/main.ts
```

## Files

- [`app.tsx`](/docs/recipes/client/files/app.tsx)
- [`entry.tsx`](/docs/recipes/client/files/entry.tsx)
- [`index.html`](/docs/recipes/client/files/index.html)
- [`main.ts`](/docs/recipes/client/files/main.ts)
- [`modules/Current.ts`](/docs/recipes/client/files/modules/Current.ts)
- [`modules/Gate.ts`](/docs/recipes/client/files/modules/Gate.ts)
- [`modules/Home.tsx`](/docs/recipes/client/files/modules/Home.tsx)
- [`modules/Page.tsx`](/docs/recipes/client/files/modules/Page.tsx)
- [`trace.ts`](/docs/recipes/client/files/trace.ts)
- [`vite.config.ts`](/docs/recipes/client/files/vite.config.ts)
