web #
The Tangled web app at tangled.org. It is built with SvelteKit (Svelte 5) and Tailwind 4, and talks to the Tangled services and to users' PDSes over AT Protocol.
Requirements #
- Node 24
- pnpm 11 (
corepack enablepicks up the pinned version) - Bun 1.4+ (
pnpm buildruns vite under it, and the production server isbun build/index.js)
Getting started #
pnpm install
pnpm dev # http://127.0.0.1:5173
By default the server expects bobbin on 127.0.0.1:8090 and the API on 127.0.0.1:8080,
which is the localinfra stack. To work against deployed services instead,
put the URLs in .env, e.g. as in wrangler.dev.jsonc:
BOBBIN_URL=https://next.tangled.org
TANGLED_API_URL=https://tangled.org
Private repos only show when bobbin has a host of its own that lists the web's origin in
BOBBIN_VIEWER_ORIGINS. On the Cloudflare preview the web's /xrpc/* proxy strips
x-tangled-viewer, and from local dev the browser won't send the SameSite=Lax viewer
cookie cross-site, so they 404.
Every server variable is optional and listed in src/env.ts; the defaults are in
src/lib/server/config.ts (and github/env.ts, indexnow.ts beside it).
Commands #
| Command | What it does |
|---|---|
pnpm dev |
Dev server |
pnpm check |
Type-check |
pnpm lint |
Prettier, ESLint, test-id check |
pnpm test |
Unit tests (Vitest) |
pnpm storybook |
Component stories on :6006 |
pnpm build |
Production build into build/ |
pnpm codegen |
Regenerate lexicon types |
End-to-end tests live in ../e2e.
oauth service audiences #
The OAuth metadata and browser sign-in use the DIDs derived from BOBBIN_URL,
DELIBERI_URL, MIGRATOR_URL, and TANGLED_SITES_URL. Their hosts must serve
DID documents advertising the matching Tangled XRPC endpoints when using a named
OAuth client. Moderation uses MODERATION_SERVICE_DID with #atproto_labeler.
POCKET_SERVICE_DID defaults to did:web:tangled.org. Its DID document points
at Bobbin, which forwards the JWT unchanged to Pocket. Changing this DID changes
the namespace for saved preferences; keep it stable on existing deployments.
Deploy the DID documents before enabling the pinned scopes. They require a PDS
that checks atproto-proxy scopes against the full service reference, like
@atproto/pds 0.5.1 or later. Loopback login and existing wildcard grants
continue to use direct service auth.