# jianyanya/astro-jianyanya architecture

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

- Interactive diagram: https://gitdiagram.com/jianyanya/astro-jianyanya
- Repository: https://github.com/jianyanya/astro-jianyanya

## Overview

铃月の小屋 is a personal Astro blog with a standalone CMS and an in-browser writing room. Readers browse localized posts and enhanced Markdown; authors edit and manage posts through the CMS/editor. The README also documents search, image placeholders, and multilingual support. The graph includes those product capabilities, RSS, and the Koharu CLI’s content-maintenance role. Source excerpts support the CMS route wiring, editor rendering worker, Open Graph fetching, and TOC assembly; other feature links are limited to documented capabilities because their implementation was not sampled.

Main entry points: [`src/pages/_shared/routes.ts`](https://github.com/jianyanya/astro-jianyanya/blob/main/src/pages/_shared/routes.ts) (Blog routes), [`cms/server.ts`](https://github.com/jianyanya/astro-jianyanya/blob/main/cms/server.ts) (CMS server), [`src/features/editor/Editor.tsx`](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/Editor.tsx) (Writing room), [`src/features/editor/render.worker.ts`](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/render.worker.ts) (Render worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_blog["Blog and publishing"]
  node_blog_routes["Blog routes<br/>[routes.ts]"]
  node_post_content["Post content"]
  node_content_model["Content model<br/>[posts.ts]"]
  node_rss["RSS feeds<br/>[rss.xml.ts]"]
  node_search["Site search"]
end

subgraph group_authoring["Authoring tools"]
  node_cms_ui["CMS dashboard<br/>[App.tsx]"]
  node_cms_server["CMS server<br/>[server.ts]"]
  node_cms_api["Post management API<br/>[write.ts]"]
  node_source_api["Source editing API<br/>[source.ts]"]
  node_editor["Writing room<br/>[Editor.tsx]"]
  node_editor_render["Markdown renderer<br/>[render.ts]"]
  node_render_worker["Render worker<br/>[render.worker.ts]"]
  node_og_service["Link metadata<br/>[og-service.ts]"]
  node_url_validation["Public URL checks<br/>[public-url.ts]"]
end

subgraph group_content["Content experience"]
  node_markdown["Markdown experience"]
  node_toc["Table of contents"]
  node_multilingual["Localization<br/>[content.ts]"]
end

subgraph group_operations["Content operations"]
  node_koharu_cli["Koharu CLI<br/>[koharu.tsx]"]
  node_lqip["Image placeholders<br/>[generateLqips.ts]"]
end

node_reader(("Reader"))

node_reader -->|"browses"| node_blog_routes
node_blog_routes -->|"resolves posts"| node_content_model
node_blog_routes -.->|"routes posts"| node_post_content
node_blog_routes -.->|"offers feeds"| node_rss
node_reader -->|"searches site"| node_search
node_reader -->|"reads enhanced posts"| node_markdown
node_markdown -.->|"navigates headings"| node_toc
node_reader -->|"chooses language"| node_multilingual
node_cms_ui -.->|"requests content"| node_cms_server
node_cms_server -->|"routes requests"| node_cms_api
node_cms_server -->|"routes source edits"| node_source_api
node_editor -.->|"requests rendering"| node_render_worker
node_render_worker -->|"invokes renderer"| node_editor_render
node_editor -.->|"fetches link data"| node_og_service
node_og_service -->|"validates URLs"| node_url_validation
node_koharu_cli -.->|"generates placeholders"| node_lqip

click node_blog_routes "https://github.com/jianyanya/astro-jianyanya/blob/main/src/pages/_shared/routes.ts"
click node_post_content "https://github.com/jianyanya/astro-jianyanya/tree/main/src/content/blog"
click node_content_model "https://github.com/jianyanya/astro-jianyanya/blob/main/src/lib/content/posts.ts"
click node_rss "https://github.com/jianyanya/astro-jianyanya/blob/main/src/pages/rss.xml.ts"
click node_search "https://github.com/jianyanya/astro-jianyanya/blob/main/src/components/layout/SearchDialogContent.tsx"
click node_markdown "https://github.com/jianyanya/astro-jianyanya/blob/main/src/components/markdown/ContentEnhancer.tsx"
click node_toc "https://github.com/jianyanya/astro-jianyanya/blob/main/src/hooks/useTocController.ts"
click node_multilingual "https://github.com/jianyanya/astro-jianyanya/blob/main/src/i18n/content.ts"
click node_cms_ui "https://github.com/jianyanya/astro-jianyanya/blob/main/cms/src/App.tsx"
click node_cms_server "https://github.com/jianyanya/astro-jianyanya/blob/main/cms/server.ts"
click node_cms_api "https://github.com/jianyanya/astro-jianyanya/blob/main/cms/src/api/write.ts"
click node_source_api "https://github.com/jianyanya/astro-jianyanya/blob/main/cms/src/api/source.ts"
click node_editor "https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/Editor.tsx"
click node_editor_render "https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/render.ts"
click node_render_worker "https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/render.worker.ts"
click node_og_service "https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/server/og-service.ts"
click node_url_validation "https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/server/public-url.ts"
click node_koharu_cli "https://github.com/jianyanya/astro-jianyanya/blob/main/scripts/koharu.tsx"
click node_lqip "https://github.com/jianyanya/astro-jianyanya/blob/main/src/scripts/generateLqips.ts"

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_blog_routes,node_post_content,node_content_model,node_rss,node_search toneBlue
class node_cms_ui,node_cms_server,node_cms_api,node_source_api,node_editor,node_editor_render,node_render_worker,node_og_service,node_url_validation toneAmber
class node_markdown,node_toc,node_multilingual toneMint
class node_koharu_cli,node_lqip toneRose
class node_reader toneIndigo
```

## Components

### Blog and publishing

- [Blog routes](https://github.com/jianyanya/astro-jianyanya/blob/main/src/pages/_shared/routes.ts): `src/pages/_shared/routes.ts`
- [Post content](https://github.com/jianyanya/astro-jianyanya/tree/main/src/content/blog): `src/content/blog`
- [Content model](https://github.com/jianyanya/astro-jianyanya/blob/main/src/lib/content/posts.ts): `src/lib/content/posts.ts`
- [RSS feeds](https://github.com/jianyanya/astro-jianyanya/blob/main/src/pages/rss.xml.ts): `src/pages/rss.xml.ts`
- [Site search](https://github.com/jianyanya/astro-jianyanya/blob/main/src/components/layout/SearchDialogContent.tsx): `src/components/layout/SearchDialogContent.tsx`

### Authoring tools

- [CMS dashboard](https://github.com/jianyanya/astro-jianyanya/blob/main/cms/src/App.tsx): `cms/src/App.tsx`
- [CMS server](https://github.com/jianyanya/astro-jianyanya/blob/main/cms/server.ts): `cms/server.ts`
- [Post management API](https://github.com/jianyanya/astro-jianyanya/blob/main/cms/src/api/write.ts): `cms/src/api/write.ts`
- [Source editing API](https://github.com/jianyanya/astro-jianyanya/blob/main/cms/src/api/source.ts): `cms/src/api/source.ts`
- [Writing room](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/Editor.tsx): `src/features/editor/Editor.tsx`
- [Markdown renderer](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/render.ts): `src/features/editor/render.ts`
- [Render worker](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/render.worker.ts): `src/features/editor/render.worker.ts`
- [Link metadata](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/server/og-service.ts): `src/features/editor/server/og-service.ts`
- [Public URL checks](https://github.com/jianyanya/astro-jianyanya/blob/main/src/features/editor/server/public-url.ts): `src/features/editor/server/public-url.ts`

### Content experience

- [Markdown experience](https://github.com/jianyanya/astro-jianyanya/blob/main/src/components/markdown/ContentEnhancer.tsx): `src/components/markdown/ContentEnhancer.tsx`
- [Table of contents](https://github.com/jianyanya/astro-jianyanya/blob/main/src/hooks/useTocController.ts): `src/hooks/useTocController.ts`
- [Localization](https://github.com/jianyanya/astro-jianyanya/blob/main/src/i18n/content.ts): `src/i18n/content.ts`

### Content operations

- [Koharu CLI](https://github.com/jianyanya/astro-jianyanya/blob/main/scripts/koharu.tsx): `scripts/koharu.tsx`
- [Image placeholders](https://github.com/jianyanya/astro-jianyanya/blob/main/src/scripts/generateLqips.ts): `src/scripts/generateLqips.ts`

### Other components

- **Reader**

## Connections

- Reader → Blog routes: browses (evidence: `README.md`)
- Blog routes → Content model: resolves posts (evidence: `src/pages/_shared/routes.ts`)
- Blog routes → Post content: routes posts
- Blog routes → RSS feeds: offers feeds
- Reader → Site search: searches site (evidence: `README.md`)
- Reader → Markdown experience: reads enhanced posts (evidence: `README.md`)
- Markdown experience → Table of contents: navigates headings
- Reader → Localization: chooses language (evidence: `README.md`)
- CMS dashboard → CMS server: requests content
- CMS server → Post management API: routes requests (evidence: `cms/server.ts`)
- CMS server → Source editing API: routes source edits (evidence: `cms/server.ts`)
- Writing room → Render worker: requests rendering
- Render worker → Markdown renderer: invokes renderer (evidence: `src/features/editor/render.worker.ts`)
- Writing room → Link metadata: fetches link data
- Link metadata → Public URL checks: validates URLs (evidence: `src/features/editor/server/og-service.ts`)
- Koharu CLI → Image placeholders: generates placeholders
