# hlxecz/blog-automation architecture

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

- Interactive diagram: https://gitdiagram.com/hlxecz/blog-automation
- Repository: https://github.com/hlxecz/blog-automation

## Overview

H.Dev Studio is a Windows desktop workspace for turning development screenshots, notes, and links into reviewed Tistory posts. Its main workflow runs from input collection through AI drafting and block-level editing to preview and publication; existing public posts can also be imported and updated at their original address. The graph distinguishes the Electron shell, editor, authoring services, and Tistory integration. Some server routes and publishing internals were not sampled, so those links are limited to documented workflow or visible imports.

Main entry points: [`scripts/server.mjs`](https://github.com/hlxecz/blog-automation/blob/main/scripts/server.mjs) (Local app server), [`web/app.js`](https://github.com/hlxecz/blog-automation/blob/main/web/app.js) (Workspace UI), [`scripts/publication.mjs`](https://github.com/hlxecz/blog-automation/blob/main/scripts/publication.mjs) (Publication builder), [`desktop/main.mjs`](https://github.com/hlxecz/blog-automation/blob/main/desktop/main.mjs) (Electron app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop shell"]
  node_electron["Electron app<br/>[main.mjs]"]
  node_account["Account reader<br/>[account.mjs]"]
  node_server["Local app server<br/>[server.mjs]"]
end

subgraph group_editor["Workspace editor"]
  node_editor_app["Workspace UI<br/>[app.js]"]
  node_draft_model["Draft model<br/>[draft-model.js]"]
  node_renderer["Article renderer"]
  node_style_ui["Style settings<br/>[style-settings.js]"]
  node_prompt_ui["Category prompts"]
  node_ai_help["AI connection help<br/>[ai-help.js]"]
end

subgraph group_authoring["Draft authoring"]
  node_blog_jobs["Input and draft jobs<br/>[blog.mjs]"]
  node_references["Reference reader<br/>[references.mjs]"]
  node_generation["Draft generation<br/>[generate.mjs]"]
  node_ai["AI CLI bridge<br/>[ai.mjs]"]
  node_refinement["Draft refinement<br/>[refine.mjs]"]
  node_style_prompts["Writing preferences<br/>[style.mjs]"]
  node_writing_prompts["Writing prompts"]
end

subgraph group_content["Post lifecycle"]
  node_storage[("Workspace storage<br/>[storage.mjs]")]
  node_publication["Publication builder<br/>[publication.mjs]"]
  node_post_update["Existing-post update<br/>[post-update.mjs]"]
  node_existing_posts["Post importer<br/>[existing-posts.mjs]"]
end

subgraph group_tistory["Tistory integration"]
  node_tistory_library["Public post library<br/>[tistory.mjs]"]
  node_blog_settings["Blog settings<br/>[blog-settings.mjs]"]
  node_categories["Category service<br/>[categories.mjs]"]
  node_publisher["Tistory publisher<br/>[publish.mjs]"]
end

node_user(("Writer"))
node_tistory["Tistory"]
node_ai_cli["Codex / Claude CLI"]

node_user -->|"opens app"| node_electron
node_electron -->|"starts"| node_server
node_electron -->|"reads account"| node_account
node_user -->|"creates and edits"| node_editor_app
node_editor_app -->|"calls API"| node_server
node_editor_app -->|"uses"| node_draft_model
node_editor_app -->|"renders preview"| node_renderer
node_editor_app -->|"loads settings"| node_style_ui
node_editor_app -->|"loads prompts"| node_prompt_ui
node_editor_app -->|"shows connection help"| node_ai_help
node_server -->|"routes job actions"| node_blog_jobs
node_server -->|"routes generation"| node_generation
node_server -->|"routes refinement"| node_refinement
node_server -->|"reads references"| node_references
node_server -->|"manages job files"| node_storage
node_generation -->|"requests generation"| node_ai
node_refinement -->|"requests refinement"| node_ai
node_ai -->|"invokes"| node_ai_cli
node_blog_jobs -->|"reads inputs"| node_references
node_blog_jobs -->|"builds preview"| node_renderer
node_publication -->|"builds preview"| node_blog_jobs
node_publication -->|"renders article"| node_renderer
node_server -->|"routes publication"| node_publication
node_electron -->|"creates publisher"| node_publisher
node_publisher -->|"builds publish HTML"| node_publication
node_publisher -->|"publishes posts"| node_tistory
node_server -->|"routes post library"| node_tistory_library
node_tistory_library -->|"parses public posts"| node_existing_posts
node_server -->|"routes post updates"| node_post_update
node_post_update -->|"uses post parser"| node_existing_posts
node_post_update -->|"prepares revised post"| node_publication
node_post_update -->|"updates original post"| node_tistory
node_server -->|"routes settings"| node_blog_settings
node_server -->|"routes categories"| node_categories
node_blog_settings -->|"reads blog settings"| node_tistory
node_categories -->|"loads categories"| node_tistory
node_server -->|"routes preferences"| node_style_prompts
node_server -->|"routes writing prompts"| node_writing_prompts

click node_electron "https://github.com/hlxecz/blog-automation/blob/main/desktop/main.mjs"
click node_account "https://github.com/hlxecz/blog-automation/blob/main/desktop/account.mjs"
click node_editor_app "https://github.com/hlxecz/blog-automation/blob/main/web/app.js"
click node_draft_model "https://github.com/hlxecz/blog-automation/blob/main/web/draft-model.js"
click node_renderer "https://github.com/hlxecz/blog-automation/blob/main/web/article-renderer.js"
click node_style_ui "https://github.com/hlxecz/blog-automation/blob/main/web/style-settings.js"
click node_prompt_ui "https://github.com/hlxecz/blog-automation/blob/main/web/category-prompts.js"
click node_ai_help "https://github.com/hlxecz/blog-automation/blob/main/web/ai-help.js"
click node_server "https://github.com/hlxecz/blog-automation/blob/main/scripts/server.mjs"
click node_blog_jobs "https://github.com/hlxecz/blog-automation/blob/main/scripts/blog.mjs"
click node_references "https://github.com/hlxecz/blog-automation/blob/main/scripts/references.mjs"
click node_generation "https://github.com/hlxecz/blog-automation/blob/main/scripts/generate.mjs"
click node_ai "https://github.com/hlxecz/blog-automation/blob/main/scripts/ai.mjs"
click node_refinement "https://github.com/hlxecz/blog-automation/blob/main/scripts/refine.mjs"
click node_style_prompts "https://github.com/hlxecz/blog-automation/blob/main/scripts/style.mjs"
click node_writing_prompts "https://github.com/hlxecz/blog-automation/blob/main/scripts/writing-prompts.mjs"
click node_storage "https://github.com/hlxecz/blog-automation/blob/main/scripts/storage.mjs"
click node_publication "https://github.com/hlxecz/blog-automation/blob/main/scripts/publication.mjs"
click node_post_update "https://github.com/hlxecz/blog-automation/blob/main/scripts/post-update.mjs"
click node_existing_posts "https://github.com/hlxecz/blog-automation/blob/main/scripts/existing-posts.mjs"
click node_tistory_library "https://github.com/hlxecz/blog-automation/blob/main/scripts/tistory.mjs"
click node_blog_settings "https://github.com/hlxecz/blog-automation/blob/main/scripts/blog-settings.mjs"
click node_categories "https://github.com/hlxecz/blog-automation/blob/main/scripts/categories.mjs"
click node_publisher "https://github.com/hlxecz/blog-automation/blob/main/desktop/publish.mjs"

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_electron,node_account,node_server toneBlue
class node_editor_app,node_draft_model,node_renderer,node_style_ui,node_prompt_ui,node_ai_help toneAmber
class node_blog_jobs,node_references,node_generation,node_ai,node_refinement,node_style_prompts,node_writing_prompts toneMint
class node_storage,node_publication,node_post_update,node_existing_posts toneRose
class node_tistory_library,node_blog_settings,node_categories,node_publisher,node_user,node_tistory,node_ai_cli toneIndigo
```

## Components

### Desktop shell

- [Electron app](https://github.com/hlxecz/blog-automation/blob/main/desktop/main.mjs): `desktop/main.mjs`
- [Account reader](https://github.com/hlxecz/blog-automation/blob/main/desktop/account.mjs): `desktop/account.mjs`
- [Local app server](https://github.com/hlxecz/blog-automation/blob/main/scripts/server.mjs): `scripts/server.mjs`

### Workspace editor

- [Workspace UI](https://github.com/hlxecz/blog-automation/blob/main/web/app.js): `web/app.js`
- [Draft model](https://github.com/hlxecz/blog-automation/blob/main/web/draft-model.js): `web/draft-model.js`
- [Article renderer](https://github.com/hlxecz/blog-automation/blob/main/web/article-renderer.js): `web/article-renderer.js`
- [Style settings](https://github.com/hlxecz/blog-automation/blob/main/web/style-settings.js): `web/style-settings.js`
- [Category prompts](https://github.com/hlxecz/blog-automation/blob/main/web/category-prompts.js): `web/category-prompts.js`
- [AI connection help](https://github.com/hlxecz/blog-automation/blob/main/web/ai-help.js): `web/ai-help.js`

### Draft authoring

- [Input and draft jobs](https://github.com/hlxecz/blog-automation/blob/main/scripts/blog.mjs): `scripts/blog.mjs`
- [Reference reader](https://github.com/hlxecz/blog-automation/blob/main/scripts/references.mjs): `scripts/references.mjs`
- [Draft generation](https://github.com/hlxecz/blog-automation/blob/main/scripts/generate.mjs): `scripts/generate.mjs`
- [AI CLI bridge](https://github.com/hlxecz/blog-automation/blob/main/scripts/ai.mjs): `scripts/ai.mjs`
- [Draft refinement](https://github.com/hlxecz/blog-automation/blob/main/scripts/refine.mjs): `scripts/refine.mjs`
- [Writing preferences](https://github.com/hlxecz/blog-automation/blob/main/scripts/style.mjs): `scripts/style.mjs`
- [Writing prompts](https://github.com/hlxecz/blog-automation/blob/main/scripts/writing-prompts.mjs): `scripts/writing-prompts.mjs`

### Post lifecycle

- [Workspace storage](https://github.com/hlxecz/blog-automation/blob/main/scripts/storage.mjs): `scripts/storage.mjs`
- [Publication builder](https://github.com/hlxecz/blog-automation/blob/main/scripts/publication.mjs): `scripts/publication.mjs`
- [Existing-post update](https://github.com/hlxecz/blog-automation/blob/main/scripts/post-update.mjs): `scripts/post-update.mjs`
- [Post importer](https://github.com/hlxecz/blog-automation/blob/main/scripts/existing-posts.mjs): `scripts/existing-posts.mjs`

### Tistory integration

- [Public post library](https://github.com/hlxecz/blog-automation/blob/main/scripts/tistory.mjs): `scripts/tistory.mjs`
- [Blog settings](https://github.com/hlxecz/blog-automation/blob/main/scripts/blog-settings.mjs): `scripts/blog-settings.mjs`
- [Category service](https://github.com/hlxecz/blog-automation/blob/main/scripts/categories.mjs): `scripts/categories.mjs`
- [Tistory publisher](https://github.com/hlxecz/blog-automation/blob/main/desktop/publish.mjs): `desktop/publish.mjs`

### Other components

- **Writer**
- **Tistory**
- **Codex / Claude CLI**

## Connections

- Writer → Electron app: opens app
- Electron app → Local app server: starts (evidence: `desktop/main.mjs`)
- Electron app → Account reader: reads account (evidence: `desktop/main.mjs`)
- Writer → Workspace UI: creates and edits
- Workspace UI → Local app server: calls API (evidence: `web/app.js`)
- Workspace UI → Draft model: uses (evidence: `web/app.js`)
- Workspace UI → Article renderer: renders preview (evidence: `web/app.js`)
- Workspace UI → Style settings: loads settings (evidence: `web/app.js`)
- Workspace UI → Category prompts: loads prompts (evidence: `web/app.js`)
- Workspace UI → AI connection help: shows connection help (evidence: `web/app.js`)
- Local app server → Input and draft jobs: routes job actions (evidence: `scripts/server.mjs`)
- Local app server → Draft generation: routes generation (evidence: `scripts/server.mjs`)
- Local app server → Draft refinement: routes refinement (evidence: `scripts/server.mjs`)
- Local app server → Reference reader: reads references (evidence: `scripts/server.mjs`)
- Local app server → Workspace storage: manages job files (evidence: `scripts/server.mjs`)
- Draft generation → AI CLI bridge: requests generation (evidence: `scripts/generate.mjs`)
- Draft refinement → AI CLI bridge: requests refinement (evidence: `scripts/refine.mjs`)
- AI CLI bridge → Codex / Claude CLI: invokes
- Input and draft jobs → Reference reader: reads inputs (evidence: `scripts/blog.mjs`)
- Input and draft jobs → Article renderer: builds preview (evidence: `scripts/blog.mjs`)
- Publication builder → Input and draft jobs: builds preview (evidence: `scripts/publication.mjs`)
- Publication builder → Article renderer: renders article (evidence: `scripts/publication.mjs`)
- Local app server → Publication builder: routes publication (evidence: `scripts/server.mjs`)
- Electron app → Tistory publisher: creates publisher (evidence: `desktop/main.mjs`)
- Tistory publisher → Publication builder: builds publish HTML (evidence: `desktop/publish.mjs`)
- Tistory publisher → Tistory: publishes posts
- Local app server → Public post library: routes post library (evidence: `scripts/server.mjs`)
- Public post library → Post importer: parses public posts (evidence: `scripts/tistory.mjs`)
- Local app server → Existing-post update: routes post updates (evidence: `scripts/server.mjs`)
- Existing-post update → Post importer: uses post parser (evidence: `scripts/post-update.mjs`)
- Existing-post update → Publication builder: prepares revised post (evidence: `scripts/post-update.mjs`)
- Existing-post update → Tistory: updates original post
- Local app server → Blog settings: routes settings (evidence: `scripts/server.mjs`)
- Local app server → Category service: routes categories (evidence: `scripts/server.mjs`)
- Blog settings → Tistory: reads blog settings
- Category service → Tistory: loads categories
- Local app server → Writing preferences: routes preferences (evidence: `scripts/server.mjs`)
- Local app server → Writing prompts: routes writing prompts (evidence: `scripts/server.mjs`)
