Documentation
Write and organize these docs, and deploy them.
These docs are apps/docs, a fumadocs app on TanStack Start. They come
with search, AI page actions and llms.txt, branded
like the rest of the product.
bun run dev:docs # http://localhost:3024 (also started by `bun run dev`)| Variable | Default | Used for |
|---|---|---|
VITE_SITE_URL | http://localhost:3022 | the "Website" link in the navigation |
VITE_SAAS_URL | http://localhost:3021 | the "Open the app" link |
The name, the repository (for "Open in GitHub") and the routes are in apps/docs/src/lib/shared.ts.
The app and the marketing site link here through their VITE_DOCS_URL; leave it empty to hide
those links.
Writing pages
Pages are MDX files in apps/docs/content/docs:
---
title: Webhooks
description: Shown under the title, in search results and link previews.
icon: Webhook # optional, any lucide icon name
---
Markdown, plus components like <Cards> and <Callout>.The sidebar follows the meta.json files. The root one sorts pages into sections:
{
"pages": ["---Getting started---", "index", "installation", "---Guides---", "payments", "...api"]
}---Title---starts a section.- A folder appears as a collapsible group with its own
meta.json(titleandpages)."...folder"lists a folder's pages inline instead. "..."adds every page not listed yet. Without it, unlisted pages are left out of the sidebar.
When a feature lands, add its guide under Guides: what it does, how to configure it, and how to extend it, with file paths in backticks.
AI and search
- Search covers every page and endpoint (Orama, served by
/api/search). - Page actions: "Copy Markdown" and the "Open" menu (ChatGPT, Claude, Cursor, Scira, GitHub, the raw Markdown) on every guide.
- For LLMs:
/llms.txtlists all pages,/llms-full.txthas their full text, and any page is available as Markdown by adding.mdto its URL (/docs/installation.md). - Share images:
/og/docs/<page>/image.webprenders the title and description.
Branding
The docs map fumadocs' colors onto the active design's tokens (packages/ui/src/styles/designs/)
and use the same Logo and fonts, so rebranding the app rebrands the
docs too. The mapping is in apps/docs/src/styles/app.css.
Build and deploy
bun run --cwd apps/docs build # prerenders every page
bun apps/docs/.output/server/index.mjs- The build prerenders every page,
llms.txtandllms-full.txt, and precompresses them. The server answers search, share images and the.mdroutes. - It runs on Bun (
bun --bun vp build) with the bun server preset, like the marketing site. docker compose up docsbuilds the same image (apps/docs/Dockerfile). TheVITE_*URLs are build arguments, because they're baked into the prerendered pages.