# myself-sayan/obsidian_docs architecture

> Architecture diagram of the GitHub repository myself-sayan/obsidian_docs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/myself-sayan/obsidian_docs
- Repository: https://github.com/myself-sayan/obsidian_docs

## Overview

1. This repository is a content-driven Next.js documentation site for the Obsidian SDK. It does not implement the SDK itself; instead, it publishes the docs, search, machine-readable exports, and social assets around that external CLI/API product.

2. The main source of truth is under `content/docs/`. Docs are organized by product area: `api/`, `core/`, `system/`, `productivity/`, `getting-started/`, and top-level pages like `quickstart` and `prerequisites`. Each section has a `meta.json` file that drives ordering/navigation, and the pages are MDX (`.mdx`) so prose and embedded components live together.

3. `source.config.ts` plus `src/lib/source.ts` form the content ingestion boundary. They connect the MDX content tree into the app’s routing and page generation layer, so the docs site can render navigation, slug-based pages, and related metadata from one canonical content source.

4. The primary user-facing shell is the Next.js App Router under `src/app/`. There are two major page surfaces: `src/app/(home)` for the landing/marketing page, and `src/app/docs/[[...slug]]` for the documentation browser. `src/app/layout.tsx` and `src/app/global.css` provide the global document shell, styling, and shared layout primitives.

5. The docs page route is the core runtime path. It takes a slug, resolves the corresponding MDX document from the content layer, and renders it through shared MDX components in `src/components/mdx.tsx` and layout helpers in `src/lib/layout.shared.tsx`. This is the main boundary where authored content becomes navigable UI.

6. The home page is separate from the docs corpus and uses marketing-specific React components such as `FeatureSection` and `TestimonialsSection`. This keeps the landing experience decoupled from the documentation renderer, even though both share the same app and design system.

7. There is a small server-side API surface in `src/app/api/search/route.ts`. This is the runtime search entry point for querying the docs corpus, likely powering site search without pushing that logic into the client. It sits at the boundary between the indexed documentation content and user query requests.

8. Several routes export documentation in machine-oriented formats: `llms.txt`, `llms.mdx`, and `llms-full.txt` plus the nested `docs` routes under them. These endpoints are designed to expose the docs in plain-text or LLM-friendly forms, separate from the regular human-readable UI.

9. The OG image generator at `src/app/og/docs/[...slug]/route.tsx` is another focused server route. It produces page-specific social images from doc content, so sharing metadata is derived from the same docs tree but rendered through a different pipeline.

10. `src/components/` contains the reusable presentation layer: shared MDX rendering, visual sections for the homepage, and UI primitives like `Morphinga`. `src/lib/` holds cross-cutting utilities such as class-name composition (`cn.ts`) and shared config/data helpers. These modules keep styling and content rendering consistent across docs, home, and generated endpoints.

11. In architecture terms, the repo has one central content pipeline feeding multiple outputs: interactive docs pages, a marketing home page, search results, LLM/text exports, and OG images. The key boundaries are “authoring content” in `content/docs`, “content resolution/rendering” in `source.config.ts` and `src/lib/source.ts`, and “delivery surfaces” in `src/app/` routes.

12. External SDK/runtime concerns are intentionally out of band here. The documentation describes an Obsidian CLI/API ecosystem, but this repository’s responsibility is to present that system, not to run the vault operations themselves.

Main entry points: [`content/docs`](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs) (Docs corpus), [`src/app/docs/[[...slug]]/page.tsx`](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/docs/[[...slug]]/page.tsx) (Docs route), [`src/app/(home)/page.tsx`](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/(home)/page.tsx) (Home page), [`src/app/layout.tsx`](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/layout.tsx) (App shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_content["Content source"]
  node_node_content_root["Docs corpus<br/>mdx content tree"]
  node_node_content_api["API docs<br/>docs section"]
  node_node_content_core["Core docs<br/>docs section"]
  node_node_content_productivity["Productivity<br/>docs section"]
  node_node_content_system["System docs<br/>docs section"]
  node_node_content_start["Getting started<br/>docs section"]
end

subgraph group_group_ingest["Content ingest"]
  node_node_source_config["Source config<br/>content config<br/>[source.config.ts]"]
  node_node_source_lib["Source bridge<br/>content loader<br/>[source.ts]"]
end

subgraph group_group_app["App Router"]
  node_node_app_root["App shell<br/>[layout.tsx]"]
  node_node_home_route["Home page<br/>marketing route<br/>[page.tsx]"]
  node_node_docs_route["Docs route<br/>[page.tsx]"]
  node_node_docs_layout["Docs layout<br/>route layout<br/>[layout.tsx]"]
  node_node_search_api["Search API<br/>server endpoint<br/>[route.ts]"]
  node_node_llms_exports["LLMS exports<br/>text routes<br/>[route.ts]"]
  node_node_og_route["OG images<br/>image route<br/>[route.tsx]"]
end

subgraph group_group_ui["Shared UI"]
  node_node_layout_shared["Shared layout<br/>render helpers<br/>[layout.shared.tsx]"]
  node_node_mdx_components["MDX renderer<br/>presentation layer<br/>[mdx.tsx]"]
  node_node_home_components["Home sections<br/>marketing components<br/>[FeatureSection.tsx]"]
  node_node_ui_primitives(("UI primitives<br/>visual widgets<br/>[Morphinga.tsx]"))
end

node_node_content_api -->|"part of"| node_node_content_root
node_node_content_core -->|"part of"| node_node_content_root
node_node_content_productivity -->|"part of"| node_node_content_root
node_node_content_system -->|"part of"| node_node_content_root
node_node_content_start -->|"part of"| node_node_content_root
node_node_source_config -->|"defines"| node_node_content_root
node_node_source_lib -->|"reads"| node_node_source_config
node_node_docs_route -->|"resolves"| node_node_source_lib
node_node_docs_route -->|"renders with"| node_node_mdx_components
node_node_docs_route -->|"lays out"| node_node_layout_shared
node_node_home_route -->|"composes"| node_node_home_components
node_node_home_route -->|"inherits"| node_node_app_root
node_node_docs_route -->|"inherits"| node_node_app_root
node_node_docs_layout -->|"wraps"| node_node_app_root
node_node_search_api -->|"queries"| node_node_content_root
node_node_llms_exports -->|"serializes"| node_node_content_root
node_node_og_route -->|"images from"| node_node_content_root
node_node_og_route -->|"reuses"| node_node_mdx_components
node_node_home_route -->|"uses"| node_node_ui_primitives
node_node_docs_route -->|"uses"| node_node_ui_primitives

click node_node_content_root "https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs"
click node_node_content_api "https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/api"
click node_node_content_core "https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/core"
click node_node_content_productivity "https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/productivity"
click node_node_content_system "https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/system"
click node_node_content_start "https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/getting-started"
click node_node_source_config "https://github.com/myself-sayan/obsidian_docs/blob/main/source.config.ts"
click node_node_source_lib "https://github.com/myself-sayan/obsidian_docs/blob/main/src/lib/source.ts"
click node_node_layout_shared "https://github.com/myself-sayan/obsidian_docs/blob/main/src/lib/layout.shared.tsx"
click node_node_mdx_components "https://github.com/myself-sayan/obsidian_docs/blob/main/src/components/mdx.tsx"
click node_node_home_components "https://github.com/myself-sayan/obsidian_docs/blob/main/src/components/FeatureSection.tsx"
click node_node_ui_primitives "https://github.com/myself-sayan/obsidian_docs/blob/main/src/components/ui/Morphinga.tsx"
click node_node_app_root "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/layout.tsx"
click node_node_home_route "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/(home)/page.tsx"
click node_node_docs_route "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/docs/[[...slug]]/page.tsx"
click node_node_docs_layout "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/docs/layout.tsx"
click node_node_search_api "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/api/search/route.ts"
click node_node_llms_exports "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/llms.txt/route.ts"
click node_node_og_route "https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/og/docs/[...slug]/route.tsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_node_content_root,node_node_content_api,node_node_content_core,node_node_content_productivity,node_node_content_system,node_node_content_start toneBlue
class node_node_source_config,node_node_source_lib toneAmber
class node_node_app_root,node_node_home_route,node_node_docs_route,node_node_docs_layout,node_node_search_api,node_node_llms_exports,node_node_og_route toneMint
class node_node_layout_shared,node_node_mdx_components,node_node_home_components,node_node_ui_primitives toneRose
```

## Components

### Content source

Authoring tree and section metadata that define the docs corpus.

- [Docs corpus](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs): mdx content tree · Primary documentation source under content/docs with sectioned MDX pages and meta files. · `content/docs`
- [API docs](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/api): docs section · API-oriented documentation area with content, files, platform, relationships, and utilities subsections. · `content/docs/api`
- [Core docs](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/core): docs section · Core conceptual docs for files, notes, linking, and search. · `content/docs/core`
- [Productivity](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/productivity): docs section · Workflow-focused docs for daily use, templates, random notes, and workspace. · `content/docs/productivity`
- [System docs](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/system): docs section · System-level documentation for vaults, sync, plugins, metrics, and history. · `content/docs/system`
- [Getting started](https://github.com/myself-sayan/obsidian_docs/tree/main/content/docs/getting-started): docs section · Onboarding and entry-point docs such as quickstart and prerequisites. · `content/docs/getting-started`

### Content ingest

Boundary that turns content files into routable docs data.

- [Source config](https://github.com/myself-sayan/obsidian_docs/blob/main/source.config.ts): content config · Defines how the docs tree is discovered and ordered for the site. · `source.config.ts`
- [Source bridge](https://github.com/myself-sayan/obsidian_docs/blob/main/src/lib/source.ts): content loader · Connects content definitions into the app's routing and page-generation layer. · `src/lib/source.ts`

### App Router

User-facing and machine-oriented route surfaces in Next.js.

- [App shell](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/layout.tsx): next app shell · Global Next.js layout and styling that frame all pages. · `src/app/layout.tsx`
- [Home page](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/(home)/page.tsx): marketing route · Landing page surface under the App Router. · `src/app/(home)/page.tsx`
- [Docs route](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/docs/[[...slug]]/page.tsx): docs route · Slug-based documentation browser that resolves MDX from the content layer. · `src/app/docs/[[...slug]]/page.tsx`
- [Docs layout](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/docs/layout.tsx): route layout · Route-scoped shell for the documentation experience. · `src/app/docs/layout.tsx`
- [Search API](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/api/search/route.ts): server endpoint · Server-side search entry point over the documentation corpus. · `src/app/api/search/route.ts`
- [LLMS exports](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/llms.txt/route.ts): text routes · Machine-oriented docs exports in llms.txt, llms.mdx, and llms-full.txt forms. · `src/app/llms.txt/route.ts`
- [OG images](https://github.com/myself-sayan/obsidian_docs/blob/main/src/app/og/docs/[...slug]/route.tsx): image route · Generates page-specific social images from doc content. · `src/app/og/docs/[...slug]/route.tsx`

### Shared UI

Reusable presentation and layout helpers.

- [Shared layout](https://github.com/myself-sayan/obsidian_docs/blob/main/src/lib/layout.shared.tsx): render helpers · Layout helpers used to present MDX pages consistently across routes. · `src/lib/layout.shared.tsx`
- [MDX renderer](https://github.com/myself-sayan/obsidian_docs/blob/main/src/components/mdx.tsx): presentation layer · Shared components that render authored MDX content into the docs UI. · `src/components/mdx.tsx`
- [Home sections](https://github.com/myself-sayan/obsidian_docs/blob/main/src/components/FeatureSection.tsx): marketing components · Landing-page sections such as feature and testimonial blocks. · `src/components/FeatureSection.tsx`
- [UI primitives](https://github.com/myself-sayan/obsidian_docs/blob/main/src/components/ui/Morphinga.tsx): visual widgets · Shared interactive and visual primitives used across the site. · `src/components/ui/Morphinga.tsx`

## Connections

- API docs → Docs corpus: part of · API docs live within the main docs corpus.
- Core docs → Docs corpus: part of · Core docs live within the main docs corpus.
- Productivity → Docs corpus: part of · Productivity docs live within the main docs corpus.
- System docs → Docs corpus: part of · System docs live within the main docs corpus.
- Getting started → Docs corpus: part of · Getting-started docs live within the main docs corpus.
- Source config → Docs corpus: defines · Configures how the content tree is discovered and ordered.
- Source bridge → Source config: reads · Uses source config as the ingestion boundary.
- Docs route → Source bridge: resolves · Looks up slugged documents through the content bridge.
- Docs route → MDX renderer: renders with · Uses shared MDX rendering for authored pages.
- Docs route → Shared layout: lays out · Uses shared layout helpers for docs presentation.
- Home page → Home sections: composes · Builds the marketing home page from reusable sections.
- Home page → App shell: inherits · Rendered within the global app shell.
- Docs route → App shell: inherits · Rendered within the global app shell.
- Docs layout → App shell: wraps · Provides route-specific framing inside the app shell.
- Search API → Docs corpus: queries · Search operates over the documentation corpus.
- LLMS exports → Docs corpus: serializes · Exports the docs corpus into machine-readable text forms.
- OG images → Docs corpus: images from · Derives social images from doc content.
- OG images → MDX renderer: reuses · Shares rendering primitives for page-derived imagery.
- Home page → UI primitives: uses · Marketing UI can use shared visual primitives.
- Docs route → UI primitives: uses · Docs UI can use shared visual primitives.
