UCD.js Docs

Docs

Architecture notes for apps/docs

apps/docs is the documentation site for package guides, pipelines, and architecture notes.

Role

  • Loads MDX content from apps/docs/content.
  • Renders it through TanStack Router and Fumadocs.
  • Defines the navigation model that connects public docs, pipeline docs, and architecture docs.

Mental Model

The docs app is a content-driven SPA with SSR support:

  • Fumadocs indexes the MDX content tree
  • TanStack Router serves a catch-all docs route
  • the route resolves a page, serializes the page tree, and renders the MDX module

The page structure is largely data-driven by the content tree and meta.json files.

Request Flows

App bootstrap

__root.tsxrouteTree.gengetRouter()__root.tsxrouteTree.gengetRouter()Browserinitialize appcreate TanStack router from generated routesrouter instancerender root document shellglobal CSS, provider, scripts, devtoolsBrowser

Docs page request

Fumadocs client loaderserverLoaderdocs-loader source/$ routeFumadocs client loaderserverLoaderdocs-loader source/$ routealt[page missing][page found]Usernavigate to /architecture/packages/fs-backendderive slug arraygetPage(slugs)nullnotFound()page + pageTreepreload MDX content modulepage content readyDocsLayout + rendered MDX pageUser getSection()source.getPageTree()baseOptions()getSection()source.getPageTree()baseOptions()Readeropen docs sidebarread page tree from content sourcemap top-level path to section colortabs + nodes + metadatasectioned sidebar and page navigationReader

Design Notes

  • The content tree is the source of truth for docs navigation.
  • The catch-all route keeps the docs surface simple while still allowing section-aware behavior.
  • Architecture discoverability depends as much on meta.json structure as on page prose.
  • This app is a documentation renderer, not a place for package logic.

Testing Use

  • catch-all route loading and 404 behavior
  • page-tree serialization
  • section/tab mapping for packages, pipelines, architecture, and contributing
  • rendering of MDX components and cross-page navigation

On this page