---
title: "Project Structure"
description: "The Fumadocs monorepo is organized into specialized packages that power documentation generation, processing, and rendering. Workspace packages such as fumadocs-core, fumadocs-ui, @fumadocs/base-ui..."
last_updated: "2026-10-12T07:53:59.866213+00:00"
canonical_url: "https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/getting-started/project-structure"
---


## Overview

The Fumadocs monorepo is organized into specialized packages that power documentation generation, processing, and rendering. Workspace packages such as `fumadocs-core`, `fumadocs-ui`, `@fumadocs/base-ui`, `fumadocs-mdx`, and `@fumadocs/openapi` collaborate across build and runtime phases to support content transformation, UI layouts, and API spec tooling.


## Core Architecture and Shared Utilities

### Core Package Responsibilities

The foundational runtime and processing logic of the workspace resides in `fumadocs-core` (`packages/core`), published under version `16.10.2` as an ES module package. It provides public entrypoints for breadcrumbs, content transformers, dynamic linking, framework adapters, code highlighters, internationalization, page trees, search indexers, and source loaders packages/core/package.json:1-97.

The package exports framework-specific routing and rendering adapters for Next.js, React Router, TanStack, and Waku through its framework entrypoints packages/core/package.json:29-33. Search capabilities span client-side search engines and server integrations for Algolia, Flexsearch, Mixedbread, and Orama Cloud packages/core/package.json:66-80.


### Shared Utilities and Workspace Workspace Dependencies

Workspace configuration and tooling rely on private shared packages such as `shared` (`packages/shared`), which coordinates utility libraries and CLI dependencies across builds packages/shared/package.json:1-15. 

> [!NOTE]
> The `shared` package is marked as `"private": true` and uses ES module imports, depending on `fuma-cli` and `tinyglobby` for file globbing and command execution during workspace operations.


## User Interface Packages

### Radix UI and Base UI Packages

Fumadocs provides two distinct UI implementation packages for its presentation layer: `fumadocs-ui` (`packages/radix-ui`), which serves as the Radix UI version of Fumadocs UI under version `16.10.2`, and `@fumadocs/base-ui` (`packages/base-ui`), which implements the Base UI version under the same version packages/radix-ui/package.json:1-4, packages/base-ui/package.json:1-4. Both packages share identical public export paths for components, layouts, contexts, and providers, but differ in their underlying primitive dependencies.

The Radix UI implementation relies on specific `@radix-ui/react-*` primitive packages for accessibility and state management, whereas the Base UI variant depends on `@base-ui/react` for its unstyled component primitives packages/radix-ui/package.json:131-154, packages/base-ui/package.json:127-141.


### Component Exports and Framework Providers

Both UI packages export extensive sets of component entrypoints, framework providers, and layout slots. The provider entrypoints support multiple frontend architectures, including Next.js, React Router, TanStack, and Waku packages/radix-ui/package.json:104-108, packages/base-ui/package.json:102-106.

| Export Path | Target File (`dist/`) | Description |
| :--- | :--- | :--- |
| `./provider/base` | `./dist/provider/base.js` | Base UI/Radix provider implementation |
| `./provider/next` | `./dist/provider/next.js` | Next.js framework provider integration |
| `./provider/react-router` | `./dist/provider/react-router.js` | React Router framework provider |
| `./provider/tanstack` | `./dist/provider/tanstack.js` | TanStack framework provider |
| `./provider/waku` | `./dist/provider/waku.js` | Waku framework provider integration |


> [!WARNING]
> While `fumadocs-ui` includes legacy compatibility exports (`./legacy/layout` and `./legacy/sidebar`) alongside standard UI elements, `@fumadocs/base-ui` omits these legacy paths entirely in favor of its modern layout and slot structure packages/radix-ui/package.json:94-95, packages/base-ui/package.json:18-114.


## Content Processing and Schema Bundling

### Content Collection Schema Configuration

The `@fumadocs/content` package acts as the content adapter for Fumadocs, integrating with `fuma-content` and standard schema specifications via `@standard-schema/spec` packages/content/package.json:2-33. It configures MDX collections and metadata data collections through specialized builder functions such as `docsMdxCollection` and `docsCollection` packages/content/src/index.ts:16-53. 

| Function / Class | Parameter / Return Type | Purpose |
| :--- | :--- | :--- |
| `docsMdxCollection` | `DocsMDXCollectionConfig<FrontmatterSchema>` | Creates an MDX collection wrapping `mdxCollection` with preset options and remark include plugins packages/content/src/index.ts:16-33. |
| `docsCollection` | `DocsCollectionConfig<FrontmatterSchema, MetaSchema>` | Returns an object containing `index`, `meta`, and `doc` collection handles packages/content/src/index.ts:44-53. |
| `DocsCollection` | Extends `Collection` | Subclass that registers code generators via `onEmit.pipe` to output store bindings packages/content/src/index.ts:55-70. |


> [!NOTE]
> The `docsMdxCollection` utility dynamically evaluates option configurations (whether provided as a static object or an asynchronous factory function) and injects the `remarkInclude` plugin into the MDX bundler preset packages/content/src/index.ts:24-31.


### MDX Transformations and Bundler Integration

The `fumadocs-mdx` package (`packages/mdx/package.json`) provides the built-in content source and bundler integrations across multiple target environments and build systems packages/mdx/package.json:2-45. It exposes explicit subpath exports for Node, Next.js, Vite, Bun, Rolldown, and Webpack loaders and plugins packages/mdx/package.json:24-44.

| Export Subpath | Target File (`dist/`) | Purpose |
| :--- | :--- | :--- |
| `.` | `./dist/index.js` | Main entry point |
| `./bin` | `./dist/bin.js` | CLI binary execution entry |
| `./bun` | `./dist/bun/index.js` | Bun runtime integration |
| `./config` | `./dist/config/index.js` | Configuration loader helpers |
| `./next` | `./dist/next/index.js` | Next.js source integration |
| `./node` | `./dist/node/index.js` | Node.js source bindings |
| `./node/loader` | `./dist/node/loader.js` | Node module loader |
| `./rolldown` | `./dist/rolldown/index.js` | Rolldown bundler plugin |
| `./vite` | `./dist/vite/index.js` | Vite bundler plugin |
| `./webpack/mdx` | `./dist/webpack/mdx.js` | Webpack MDX loader |
| `./webpack/meta` | `./dist/webpack/meta.js` | Webpack meta loader |


> [!WARNING]
> [Bundler plugins](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/mdx-pipeline/bundler-plugins) and loaders such as `rolldown`, `vite`, and `webpack` are declared as optional peer dependencies alongside `next` and `mdast-util-directive`, allowing consumer projects to install only the toolchain integrations they require packages/mdx/package.json:96-132.


## API Specification Tooling

### OpenAPI and AsyncAPI Processing Packages

The API specification ecosystem in Fumadocs is powered by three specialized packages: `@fumadocs/api-docs` (`packages/api-docs/package.json`), `fumadocs-openapi` (`packages/openapi/package.json`), and `@fumadocs/asyncapi` (`packages/asyncapi/package.json`) packages/api-docs/package.json:2-45, packages/openapi/package.json:2-37, packages/asyncapi/package.json:2-25. These packages supply shared utility modules, server bindings, request code generators, and UI presentation components for machine-readable API specifications.

| Package Name | Version | Description | Key Subpath Exports |
| :--- | :--- | :--- | :--- |
| `@fumadocs/api-docs` | `0.0.2` | Shared utils for API docs generation | `./schema`, `./schema/bundle`, `./schema/dereference`, `./components/schema` packages/api-docs/package.json:2-38 |
| `fumadocs-openapi` | `11.0.2` | Generate MDX docs for your OpenAPI spec | `.`, `./i18n`, `./scalar`, `./server`, `./ui`, `./requests/generators/all` packages/openapi/package.json:2-36 |
| `@fumadocs/asyncapi` | `0.0.2` | Generate docs for your AsyncAPI spec | `.`, `./i18n`, `./server`, `./ui` packages/asyncapi/package.json:2-24 |


> [!NOTE]
> `@fumadocs/api-docs` bundles and inlines critical JSON Schema processing tools such as `@apidevtools/json-schema-ref-parser`, `@fastify/deepmerge`, and `ajv` directly within its distribution configuration packages/api-docs/package.json:97-104.


### Request Generators and Code Generation Modules

The `fumadocs-openapi` package exposes modular request code generators under its `./requests/generators/*` export paths, enabling automatic generation of client request snippets across multiple target languages packages/openapi/package.json:22-29.

| Export Subpath | Target File (`dist/`) | Purpose |
| :--- | :--- | :--- |
| `./requests/generators` | `./dist/requests/generators/index.js` | Main generators dispatcher entry point packages/openapi/package.json:22 |
| `./requests/generators/all` | `./dist/requests/generators/all.js` | Bundle aggregator for all supported languages packages/openapi/package.json:23 |
| `./requests/generators/csharp` | `./dist/requests/generators/csharp.js` | C# HTTP request snippet generator packages/openapi/package.json:24 |
| `./requests/generators/curl` | `./dist/requests/generators/curl.js` | cURL command-line snippet generator packages/openapi/package.json:25 |
| `./requests/generators/go` | `./dist/requests/generators/go.js` | Go `net/http` request generator packages/openapi/package.json:26 |
| `./requests/generators/java` | `./dist/requests/generators/java.js` | Java HTTP request generator packages/openapi/package.json:27 |
| `./requests/generators/javascript` | `./dist/requests/generators/javascript.js` | JavaScript `fetch` snippet generator packages/openapi/package.json:28 |
| `./requests/generators/python` | `./dist/requests/generators/python.js` | Python `requests` snippet generator packages/openapi/package.json:29 |


> [!WARNING]
> Optional peer dependencies such as `@scalar/api-client-react` and `json-schema-typed` must be explicitly installed by consuming applications when utilizing interactive Scalar API playground components or strict schema typing packages/openapi/package.json:79-98.


## Language Analysis and Code Generation

### TypeScript and Twoslash Integrations

The workspace provides dedicated tooling for TypeScript code analysis, interactive type annotations, and documentation generation through `fumadocs-typescript`, `fumadocs-twoslash`, and `fumadocs-docgen`. These packages integrate syntax analysis, tree transformations, and build-time code transformations.

| Package Name | Main Entry Point (`dist/`) | Primary Export Subpaths | Description |
| :--- | :--- | :--- | :--- |
| `fumadocs-twoslash` | `./dist/index.js` packages/twoslash/package.json:18-18 | `./twoslash.css`, `/.`, `./ui`, `./cache-fs` packages/twoslash/package.json:21-33 | TypeScript Twoslash integration with Shiki and UI popover support packages/twoslash/package.json:2-4, packages/twoslash/package.json:46-52 |
| `fumadocs-typescript` | `./dist/index.js` packages/typescript/package.json:17-17 | `.`, `./ui` packages/typescript/package.json:20-27 | TypeScript code intelligence and AST utilities via `ts-morph` packages/typescript/package.json:2-4, packages/typescript/package.json:46-46 |
| `fumadocs-docgen` | `./dist/index.js` packages/doc-gen/package.json:19-19 | `.`, `./remark-ts2js` packages/doc-gen/package.json:22-29 | Remark plugins and utilities including TypeScript-to-JavaScript code transformation packages/doc-gen/package.json:2-4, packages/doc-gen/package.json:26-29 |
| `@fumadocs/language` | Not applicable (exports individual translation files) packages/language/package.json:17-21 | `./zh-cn`, `./zh-tw`, `./package.json` packages/language/package.json:18-20 | Common localized language packs and integration metadata for Fumadocs packages packages/language/package.json:2-4, packages/language/package.json:17-21 |


> [!WARNING]
> `@fumadocs/language` declares peer dependencies on several workspace API and story components (`@fumadocs/api-docs`, `@fumadocs/asyncapi`, `@fumadocs/story`, `fumadocs-core`, `fumadocs-openapi`, `fumadocs-ui`) marked as optional, meaning consuming projects must provide the specific packages corresponding to the desired localized documentation tools packages/language/package.json:43-70.


### Transformation Dependencies and Syntax Processing

Code analysis modules rely on syntax transformers and AST parsers to manipulate Markdown and code structures. `fumadocs-typescript` integrates `ts-morph` alongside `estree-util-value-to-estree`, `hast-util-to-estree`, and `hast-util-to-jsx-runtime` packages/typescript/package.json:39-49. Similarly, `fumadocs-docgen` leverages `oxc-transform` and `zod` schema parsing to process and convert code snippets packages/doc-gen/package.json:41-50.

> [!TIP]
> When configuring `fumadocs-twoslash`, consumers can import cache layers via the `./cache-fs` export path alongside `@shikijs/twoslash` and `twoslash` dependencies to persist type check results across builds packages/twoslash/package.json:30-33, packages/twoslash/package.json:47-47, packages/twoslash/package.json:52-52.


## Python Tooling and Components

### Fumapy Core Package Configuration

The `fumapy` Python library (`fumadocs-python`) extracts API documentation from source code and docstrings, serving as the back-end extraction engine for Fumadocs packages/python/package.json:2-4, packages/python/pyproject.toml:2-4. Managed via Hatchling as its build-backend, it requires Python 3.10 or newer and depends on `griffe` and `griffe_typingdoc` to inspect Python code structures packages/python/pyproject.toml:7-8, packages/python/pyproject.toml:13-15. The command-line script entrypoint `fumapy-generate` points directly to the `generate` function inside the package packages/python/pyproject.toml:10-11.


> [!NOTE]
> `fumapy` relies strictly on `griffe` (versions `>=1.13.0, <2.0.0`) and `griffe_typingdoc` (versions `>=0.2.8, <1.0.0`) for static analysis and docstring typing support packages/python/pyproject.toml:8-8.


### Module and Type Models

The `fumapy.mksource` subpackage exports core parsing helpers and typed model structures that define how Python symbols are represented [packages/python/fumapy/mksource/__init__.py:1-9](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/fumapy/mksource/__init__.py#L1-9). The models utilize TypedDict definitions to represent modules, classes, functions, parameters, attributes, and docstring sections [packages/python/fumapy/mksource/models.py:6-60](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/fumapy/mksource/models.py#L6-60).

| Model | Key Fields | Description |
| :--- | :--- | :--- |
| `Module` | `name`, `path`, `filepath`, `description`, `docstring`, `attributes`, `modules`, `classes`, `functions`, `version` | Represents a parsed Python module container holding nested modules, classes, and functions. |
| `Class` | `name`, `path`, `description`, `parameters`, `attributes`, `docstring`, `functions`, `source` | Represents a Python class declaration including its source string and member functions. |
| `Function` | `name`, `path`, `signature`, `description`, `parameters`, `returns`, `docstring`, `source` | Represents a function or method signature, return annotations, and source code. |
| `Parameter` | `name`, `annotation`, `description`, `value` | Describes an individual function parameter or class argument with type annotations and defaults. |
| `Attribute` | `name`, `annotation`, `description`, `value` | Captures class or module-level attributes and field assignments. |
| `DocstringSection` | `kind`, `value` | Represents structural sections parsed out of docstrings. |


### React Presentation Components

The front-end package `fumadocs-python` exposes UI presentation components under its `./components` export path to render Python API documentation [packages/python/package.json:28-31](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/package.json#L28-31), [packages/python/src/components/index.tsx:25-133](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/src/components/index.tsx#L25-133). These components use Tailwind CSS, class-variance-authority, and Fumadocs UI primitives to display code symbols, badges, parameters, and collapsible source blocks.

| Component | Props | Purpose |
| :--- | :--- | :--- |
| `PyFunction` | `name`, `type`, `children` | Renders a function symbol card with a specialized `func` badge and type signature [packages/python/src/components/index.tsx:25-40](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/src/components/index.tsx#L25-40). |
| `PyAttribute` | `name`, `type`, `value`, `children` | Displays an attribute card featuring an `attribute` badge, type, and default value [packages/python/src/components/index.tsx:42-69](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/src/components/index.tsx#L42-69). |
| `PyParameter` | `name`, `type`, `value`, `children` | Formats function parameters inside a secondary container with a `param` badge [packages/python/src/components/index.tsx:71-101](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/src/components/index.tsx#L71-101). |
| `PySourceCode` | `children` | Wraps raw source code blocks in a collapsible element with a toggle trigger [packages/python/src/components/index.tsx:103-121](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/src/components/index.tsx#L103-121). |
| `PyFunctionReturn` | `type`, `children` | Presents function return types and descriptions within a structured box [packages/python/src/components/index.tsx:123-133](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/python/src/components/index.tsx#L123-133). |


## Scaffolding and Authoring Integrations

### Project Scaffolding and Preview CLI

The package `create-fumadocs-app` initializes and scaffolds new documentation sites, relying on dependency version tracking managed by `create-fumadocs-versions` [packages/create-app/package.json:2-6](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/create-app/package.json#L2-6), [packages/create-app-versions/package.json:2-5](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/create-app-versions/package.json#L2-5). Concurrently, `fumadocs-preview` provides an opinionated framework for fast content previews using Waku and Hono [packages/preview/package.json:2-4](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/preview/package.json#L2-4), [packages/preview/package.json:29-32](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f5607701e/packages/preview/package.json#L29-32), [packages/preview/package.json:43-65](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f560770

## Related

- [Overview](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/getting-started/overview)
- [Quick Start](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/getting-started/quick-start)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/llms.txt) for all pages in this wiki.
