| title | Architecture |
|---|---|
| description | Deep dive into ObjectDocs architecture, directory structure, and data flow. |
import { Layers, FileJson, Code, FileText } from 'lucide-react';
ObjectDocs is built on a strict Separation of Concerns philosophy that separates presentation, configuration, and content into distinct layers.
Unlike traditional documentation sites where structure is hardcoded in React components, ObjectDocs treats documentation organization as data.
} title="Metadata-Driven"> Navigation, sidebars, and page ordering are defined in JSON files, not React code. } title="Logic-Free Views"> React components in `app/` are purely presentational and consume configuration.┌─────────────────────────────────────────┐
│ Content Layer (MDX) │ ← Technical Writers
│ /content/docs/**/*.mdx │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Configuration Layer (JSON) │ ← Platform Architects
│ /content/**/meta.json │
│ /packages/site/objectdocs.json │
└─────────────────────────────────────────┘
↓
┌─────────────────────────────────────────┐
│ Presentation Layer (React) │ ← Frontend Engineers
│ /packages/site/app/** │
└─────────────────────────────────────────┘
content/
└── docs/
├── meta.json # Root navigation structure
├── index.mdx # Documentation home page
├── getting-started/
│ ├── meta.json # Getting Started section structure
│ ├── installation.mdx
│ ├── architecture.mdx
│ └── configuration.mdx
└── components/
├── meta.json # Components section structure
└── objectui-embed.mdx
packages/site/
├── app/ # Next.js App Router
│ ├── [lang]/
│ │ ├── docs/
│ │ │ ├── [[...slug]]/
│ │ │ │ └── page.tsx # Dynamic doc page
│ │ │ └── layout.tsx # Docs layout wrapper
│ │ ├── layout.tsx # Language layout
│ │ └── page.tsx # Homepage redirect
│ ├── layout.config.tsx # Layout configuration
│ └── layout.tsx # Root layout
├── lib/
│ ├── source.ts # Content source configuration
│ └── site-config.ts # Site config loader
├── objectdocs.json # Global site configuration
└── source.config.ts # Fumadocs source config
graph LR
A[MDX Files] --> B[Fumadocs]
B --> C[source.getPageTree]
C --> D[DocsLayout]
D --> E[Rendered Page]
- MDX files in
content/docs/are processed by Fumadocs - meta.json files define the navigation tree structure
- source.getPageTree() generates the sidebar tree
- DocsLayout component renders the final layout
// packages/site/lib/site-config.ts
import siteConfig from '../objectdocs.json';
export { siteConfig };The objectdocs.json file is imported and used throughout the application to configure:
- Navigation bar links
- Branding (logo, theme colors)
- Sidebar behavior
- Footer content
- TOC settings
Each directory can have a meta.json file that controls the sidebar structure:
{
"title": "Section Title",
"pages": [
"page-slug",
"another-page",
"---Separator---",
"subsection"
]
}- title: Display name in the sidebar
- pages: Array of page slugs in the desired order
- Separators: Use
---Title---format for visual separators
Every MDX file should include frontmatter:
---
title: Page Title
description: Brief description for SEO and cards
---
# Content starts hereNow that you understand the architecture, learn how to configure your site:
Customize navigation, branding, and features Embed interactive ObjectUI components