The drawDB documentation site is built with Fumadocs, Next.js, Tailwind CSS, and a static Orama search index.
- Node.js 22.12 or newer
- npm 10 or newer
If you use nvm, run:
nvm useInstall dependencies and start the development server:
npm install
npm run devOpen http://localhost:3000. Local development uses no URL prefix, so pages appear at routes such as /create-diagram.
npm run check
npm run build
npm run startnpm run build writes the fully static site to out/. The production preview command serves that directory locally.
| Variable | Purpose | Local default |
|---|---|---|
NEXT_PUBLIC_SITE_URL |
Canonical public URL used by metadata, sitemap, and social cards. | https://www.drawdb.app/docs |
NEXT_PUBLIC_BASE_PATH |
Path where the static site is mounted. Use an empty value for a root domain. | Empty |
Every production build uses:
NEXT_PUBLIC_SITE_URL=https://www.drawdb.app/docs
NEXT_PUBLIC_BASE_PATH=/docs
- Documentation pages live in
docs/**/*.mdx. - Sidebar order is controlled by the root and nested
meta.jsonfiles. - Pro product guides live in
docs/pro/; add new Pro pages todocs/pro/meta.json. - Light and dark screenshots live in
docs/img/lightanddocs/img/dark. - Every page needs a unique
title(at most 65 characters) and adescriptionof 80 to 160 characters;source.config.tsenforces both, so the build fails otherwise. - JSX-enabled content must use the
.mdxextension.
Fumadocs provides Cards, Card, and Callout automatically. This project also registers Accordion, Accordions, and ThemedImage as global MDX components.
Search uses a static Orama index generated during the build. It requires no hosted search service or API key. The index is exported at /api/search and the UI supports the standard search button and Command/Ctrl + K.
The build generates:
- Unique page titles, descriptions, canonical URLs, Open Graph, and X metadata
sitemap.xmlwithlastmodtaken from git (lastModified: trueinsource.config.ts, so builds need a full clone, not a shallow one)manifest.webmanifestBreadcrumbListandTechArticlestructured data per pagellms.txt,llms-full.txt, and a Markdown twin of every page at<page>.md(scripts/twins.mjsmoves them out of themd/staging route afternext build)
There is no robots.txt: the site is served under www.drawdb.app/docs, whose root robots file applies.
Open Graph images are per page at /og/<slugs joined by ->.png (index.png for the root). They are rendered by the drawdb-pro build (scripts/build-docs.mjs), which owns Puppeteer, from each page's <title> and description. If you change the metadata path in src/lib/site.ts, change it there too.
The canonical home is https://www.drawdb.app/docs. The drawdb-pro deploy workflow clones this repository, builds it with the variables above, and copies out/ into its own dist/docs, so the docs ship as static files of the same Cloudflare Worker as the site. The redeploy-site job in .github/workflows/deploy.yml triggers that workflow after every push here; it needs a PRO_DEPLOY_TOKEN repository secret (a fine-grained token with Contents read/write on drawdb-io/drawdb-pro).
drawdb-io.github.io/docs was the original home. The workflow still publishes there so the old URLs keep resolving: with the custom domain docs.drawdb.app set on the Pages site, GitHub 301s github.io to it, and a Cloudflare redirect rule (infra/terraform, docs_redirect_host) 301s docs.drawdb.app/* on to www.drawdb.app/docs/*.
In the GitHub repository:
- Open Settings → Pages.
- Set Build and deployment → Source to GitHub Actions.
- Push to
mainor run the workflow manually.
The workflow uses Node.js 22, installs from package-lock.json, builds with the /docs base path, and publishes out/.