ZeroStarterRC

Documentation

Manage documentation content and search.

Overview

Documentation is managed using Fumadocs and stored in web/next/content/docs/. Full-text search is powered by Orama via Fumadocs.

Content Structure

  • Location: web/next/content/docs/
  • Format: MDX files with frontmatter
  • Configuration: Defined in web/next/source.config.ts and web/next/content/docs/meta.json

Creating Documentation

  1. Create a new .mdx file in web/next/content/docs/
  2. Add frontmatter with title and description
  3. Write content using MDX syntax
  4. Add entry to web/next/content/docs/meta.json

Configuration

Documentation source is configured in web/next/source.config.ts:

export const docs = defineDocs({
  dir: "content/docs",
})

Pages are listed in web/next/content/docs/meta.json. The sequence matters - it determines the order pages appear in navigation:

{
  "pages": [
    "index",
    "getting-started/architecture",
    "getting-started/project-structure",
    "getting-started/type-safe-api",
    "getting-started/setup",
    "getting-started/scripts",
    "getting-started/roadmap",
    "manage/authentication",
    "manage/dashboard",
    "manage/database",
    "manage/api-conventions",
    "manage/analytics",
    "manage/blog",
    "manage/code-quality",
    "manage/documentation",
    "manage/feedback",
    "manage/environment",
    "manage/release",
    "manage/theming",
    "manage/og-images",
    "manage/llms-txt",
    "manage/robots",
    "manage/sitemap",
    "deployment/docker",
    "deployment/vercel",
    "resources/ai-skills",
    "resources/ide-setup",
    "resources/infisical",
    "contributing"
  ]
}

Full-text search indexes all documentation and blog content via an API endpoint at web/next/src/app/api/search/route.ts:

import { createSearchAPI } from "fumadocs-core/search/server"
import { source } from "@/lib/source"

export const { GET } = createSearchAPI("advanced", {
  indexes: source.getPages().map((page) => ({
    title: page.data.title,
    description: page.data.description,
    url: page.url,
    id: page.url,
    structuredData: page.data.structuredData,
  })),
})

The Next.js config rewrites /api/search to the internal app URL to avoid CORS issues:

{ source: "/api/search", destination: `${env.NEXT_PUBLIC_APP_URL}/api/search` }

Keyboard Shortcut

Press Cmd+K (Mac) or Ctrl+K (Windows/Linux) to open the search dialog from any docs page. The search dialog supports full-text search across all content, heading-level results, and keyboard navigation.