Public documentation for 0xBUFF products, built with React Router 8, Fumadocs MDX and Cloudflare Workers. Articles and navigation live in content/docs/. The app compiles and serves this public collection without a runtime content store.
Fumadocs owns the documentation navigation. The repository is organized by tool, not by individual feature:
content/docs/
├── meta.json # Shared tool order
├── assay/ # Default product
│ ├── meta.json
│ └── index.mdx
├── throughline/
│ ├── meta.json # Throughline navigation
│ ├── index.mdx # Tool overview
│ └── *.mdx # Guides and references
└── <new-tool>/
├── meta.json
├── index.mdx
└── *.mdx
- The root
content/docs/meta.jsonlists Assay first, then Throughline and uses Fumadocs'"..."entry to include future tools automatically. - Give every tool its own
content/docs/<slug>/directory with anindex.mdxandmeta.json. Set"root": truein the tool's metadata so its navigation is separate from other tools. Give it a clear title, a short description, and an explicitpagesorder. Section separators such as"---Reference---"group related pages without changing URLs. - Use stable filenames: Fumadocs derives each public address from its MDX path. Navigation changes must not unnecessarily change existing addresses.
- Add only material intended for public release. Every MDX article in the collection is public after deployment and is eligible for search and LLM exports.
- Keep product-specific descriptions in the product's own MDX and metadata. Shared site metadata must describe the full documentation library.
The navigation validation tests run with pnpm test. They verify tool roots, declared pages, and document frontmatter.
Use native Fumadocs code tabs for interchangeable examples. Give consecutive fences a tab="..." label and set tab-group="package-manager" on the first fence of each npm/pnpm/Yarn installation group so the selected manager is shared and remembered. Keep sequential commands, inputs and outputs in separate blocks.
Selected Throughline guides render the published @0xbuff/throughline@0.0.2 React player. The overview leads with a multi-system checkout recovery trace; introductory pages retain smaller teaching examples. Sources are kept in src/lib/throughline-demos.ts; MDX pages use <ThroughlineDemo id="..." />. The component is registered in src/components/mdx.tsx. Its compiler, player and namespaced CSS load in a separate module only when a demo is rendered. All other 0xBUFF tool documentation remains independent of Throughline.
The showcase is deliberately limited to a few pages and does not automatically transform every thl code fence. The official remarkThroughline({ mode: "mdx" }) integration and ThroughlineEmbed require a subsequent package release; v0.0.2 must not be assumed to contain them. This preserves portable source examples and avoids unnecessary client JavaScript. scripts/throughline-interactive.test.mjs compiles every showcased trace with the installed package; CI also typechecks and builds both environments.
Fumadocs builds the page tree, search index, sitemap and Markdown exports from the local MDX collection. Both / and /docs redirect directly to /docs/assay. Unknown articles return HTTP 404. Updating the collection requires a documentation deployment; the company product catalog is independent.
| Target | Worker | Public domain |
|---|---|---|
| Staging | 0xbuff-docs-staging |
staging.docs.0xbuff.com |
| Production | 0xbuff-docs |
docs.0xbuff.com |
The top-level Wrangler configuration is production. env.staging overrides the domain and DOCS_ENV value.
Node 24 and pnpm 11.2.2 are required.
pnpm install
pnpm typecheck
pnpm test
pnpm devNo private registry credentials or content seeding are required. Set local RESEND_API_KEY in an untracked .dev.vars only when newsletter testing is necessary; .dev.vars.example documents it.
pnpm build
pnpm bundle:report
pnpm build:stagingpnpm build: production target, using top-level Wrangler settings.pnpm build:staging: selectsenv.stagingwithCLOUDFLARE_ENV=stagingduring the Vite build.pnpm bundle:report: prints compressed JS/CSS asset sizes, largest first. The sum of all chunks is not the initial browser download; route-level MDX and Mermaid remain lazy, and the search dialog is deferred.scripts/check-deploy-config.mjs staging|production: asserts the generatedbuild/server/wrangler.jsoncarries the intended Worker name, custom domain, runtime environment, and absence of R2 bindings.
With the Cloudflare Vite plugin, wrangler deploy uses the generated deployment config; wrangler deploy --env staging must not be used after the build.
Code merges do not deploy to Cloudflare. The deployment workflow follows 0xNAND's explicit release boundary:
- Merge the reviewed and signed code into
mainafter CI passes. This alone does not deploy either environment. - Set up GitHub Environments named
stagingandproduction. Verify each environment's domain, credentials, and any newsletter secrets. Set environment variableDOCS_RELEASE_READY=trueonly after verifying that environment. - Run Actions → Deploy Documentation → Run workflow from the
mainbranch, choosestaging, and enterDEPLOY_STAGING. The workflow checks readiness, builds the staging environment, checks the generated Worker configuration, deploys, and probes the live endpoints. - Once staging is verified, dispatch the same workflow from
maintargetingproductionwithDEPLOY_PRODUCTIONand a separately verified production environment (DOCS_RELEASE_READY=true).
Pull requests continue to typecheck, test, build both target configurations, verify the generated Worker configuration and report client asset sizes without deploying.
Cloudflare deployment requires repository secrets CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID with the minimum permissions for Workers and the configured custom domains. Newsletter RESEND_API_KEY is a Worker secret, set independently for the production and staging Workers. The staging RESEND_SEGMENT_ID is intentionally empty to prevent accidental subscriptions to the production audience; configure a separate staging segment before testing signup delivery.
Before either deployment, confirm the Cloudflare domain and credentials are provisioned. The deployment smoke tests verify both redirects, Assay and Throughline pages, a missing page, Markdown exports, LLM indexes, search, robots, sitemap and subscription routes. Staging serves robots.txt with Disallow: / and sets X-Robots-Tag: noindex, nofollow, noarchive on Worker responses.
Fumadocs MDX uses async: true, so individual documents are compiled into page-level lazy chunks. Mermaid loads through a dynamic import when a diagram mounts. The search UI is also loaded on demand; the search index is generated from the compiled MDX collection and cached briefly. The bundle report provides reproducible size evidence in pull-request and deploy workflows. Compare it with a browser network waterfall before claiming any percentage reduction in initial transfer or setting budgets.
worker-configuration.d.ts is generated locally by wrangler types and is intentionally not tracked. pnpm typecheck regenerates it before React Router types and the TypeScript compiler run; run pnpm exec wrangler types separately after changing bindings if editor types need refreshing. opencode.json is also ignored as machine-specific OpenCode configuration. The DOCS_ENV value is used server-side to keep staging out of search indexes.
The shared tokens, fonts and base styles in src/app.css are synchronized from the platform design system. Keep the Fumadocs adapter, local source detection and documentation-specific rules when updating that snapshot. The documentation application does not import the platform's private workspace packages.
Assay, Preceptor and Retention document their public v0.0.2 releases: Assay, Preceptor and Retention. Use each release's package exports, contract types, tests and versioned guides as the technical source of truth. Do not document unreleased behavior as available. Public installation commands use the package name without a version suffix; each automated example verifier pins the documented release.
Keep product sidebars compact and flat. The Introduction explains the product and when to use it. Getting started covers installation and a short working example. Task and concept pages explain how to use and understand the product; API and contract pages provide precise lookup information. Add a page only for a distinct reader need.
Use sentence-case titles, direct language, explicit prerequisites and expected results. Define unfamiliar terms before relying on them. Keep code fragments distinct from complete examples. Use diagrams to explain data flow, responsibilities and trust boundaries. Preserve technical boundaries and keep public pages self-contained; do not reference private specifications or implementation tickets.
The editorial approach draws on Vercel's writing guidelines, Cloudflare's style guide, Mintlify's developer documentation checklist and Diátaxis. Apply the Content repository's humanizer skill when editing prose.
Run pnpm test for the documentation structure and internal-link checks. Run node scripts/verify-assay-examples.mjs, node scripts/verify-preceptor-examples.mjs and node scripts/verify-retention-examples.mjs to install each pinned public release in a temporary directory and execute the marked examples. These checks require registry access and Node 24; they do not add the products to the documentation application's dependency graph. Update the example verifier and all affected version references when adopting a new release.