How fuma-nama/fumadocs works
Main Components
a. Core Packages Layer:
• @fumadocs/core: The foundation layer handling core functionality
• @fumadocs/mdx: MDX processing and transformation
• @fumadocs/ui: UI components and layouts
• @fumadocs/openapi: OpenAPI integration
• @fumadocs/typescript: TypeScript documentation generation
• @fumadocs/twoslash: TypeScript playground integration
b. Integration Layer:
• Content Collections
• Internationalization (i18n)
• Search functionality (Algolia, Orama)
• OpenAPI documentation
• TypeScript documentation
c. User Interface Layer:
• Layouts (docs, home, notebook)
• Components (accordion, codeblock, tabs, etc.)
• Theme system
• Search UI
d. Build & CLI Tools:
• CLI package for project scaffolding
• Doc-gen for documentation generation
• Create-app for project initialization
Relationships to Highlight
• How the core package provides foundational services to other packages
• Demonstrate the flow from content (MDX files) through the processing pipeline
• How the UI components consume the processed content
• Integration points with external services (search, OpenAPI)
Architecture Pattern
┌─────────────────────────────────────────────────────┐
• Applications │
• (Documentation Sites built with Fumadocs) │
• ┤
• UI Components │
• (Layouts, Components, Theme System) │
• ┤
• Integration Layer │
• (Search, i18n, OpenAPI, TypeScript) │
• ┤
• Core Layer │
• (MDX Processing, Content Management, Routing) │
• ┘
Important Flows
• Content Processing Flow:
MDX Files → MDX Processing → UI Rendering → Final Output
• Build Process Flow:
Source Files → Doc Generation → Static Assets → Deployment
• Search Flow:
Content → Search Indexing → Search UI → Results
Additional Elements
• Version compatibility information
• Integration points with Next.js
• ESM-only nature of the packages