Skip to content
drawdb-ioPublic

About

Documentation website for drawDB

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Repository files navigation

drawDB documentation

The drawDB documentation site is built with Fumadocs, Next.js, Tailwind CSS, and a static Orama search index.

Requirements

  • Node.js 22.12 or newer
  • npm 10 or newer

If you use nvm, run:

nvm use

Local setup

Install dependencies and start the development server:

npm install
npm run dev

Open http://localhost:3000. Local development uses no URL prefix, so pages appear at routes such as /create-diagram.

Checks and production build

npm run check
npm run build
npm run start

npm run build writes the fully static site to out/. The production preview command serves that directory locally.

Environment variables

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

Content

  • Documentation pages live in docs/**/*.mdx.
  • Sidebar order is controlled by the root and nested meta.json files.
  • Pro product guides live in docs/pro/; add new Pro pages to docs/pro/meta.json.
  • Light and dark screenshots live in docs/img/light and docs/img/dark.
  • Every page needs a unique title (at most 65 characters) and a description of 80 to 160 characters; source.config.ts enforces both, so the build fails otherwise.
  • JSX-enabled content must use the .mdx extension.

Fumadocs provides Cards, Card, and Callout automatically. This project also registers Accordion, Accordions, and ThemedImage as global MDX components.

Search

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.

SEO files

The build generates:

  • Unique page titles, descriptions, canonical URLs, Open Graph, and X metadata
  • sitemap.xml with lastmod taken from git (lastModified: true in source.config.ts, so builds need a full clone, not a shallow one)
  • manifest.webmanifest
  • BreadcrumbList and TechArticle structured data per page
  • llms.txt, llms-full.txt, and a Markdown twin of every page at <page>.md (scripts/twins.mjs moves them out of the md/ staging route after next 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.

Hosting

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).

GitHub Pages (legacy URL)

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:

  1. Open Settings → Pages.
  2. Set Build and deployment → Source to GitHub Actions.
  3. Push to main or run the workflow manually.

The workflow uses Node.js 22, installs from package-lock.json, builds with the /docs base path, and publishes out/.

About

Documentation website for drawDB

Topics

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages