# nuistmrchest/blyagger architecture

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

- Interactive diagram: https://gitdiagram.com/nuistmrchest/blyagger
- Repository: https://github.com/nuistmrchest/blyagger

## Overview

Blyagger is a Linux-only static blog publishing tool. Its workflow reads an origin.txt article, parses text, image markers and code into an Article, renders a blog page, updates the blog index, copies image assets, then stages, commits and pushes the repository. Source excerpts show the main runtime calls; the image-copy and upload operations are invoked by the CLI, while successful remote publication depends on the configured Git environment.

Main entry points: [`src/main.rs`](https://github.com/nuistmrchest/blyagger/blob/master/src/main.rs) (Publisher CLI), [`src/core_logic.rs`](https://github.com/nuistmrchest/blyagger/blob/master/src/core_logic.rs) (Article Parser), [`src/html_generator.rs`](https://github.com/nuistmrchest/blyagger/blob/master/src/html_generator.rs) (HTML Helpers), [`src/repo.rs`](https://github.com/nuistmrchest/blyagger/blob/master/src/repo.rs) (Index Logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Article Input"]
  node_cli["Publisher CLI<br/>[main.rs]"]
  node_article_file["origin.txt"]
end

subgraph group_render["Article Rendering"]
  node_article_parser["Article Parser<br/>[core_logic.rs]"]
  node_article_components["Article Components<br/>[core_logic.rs]"]
  node_html_helpers["HTML Helpers<br/>[html_generator.rs]"]
  node_page_template["Page Template<br/>[const_str.rs]"]
end

subgraph group_site["Site Updates"]
  node_article_html["Article HTML"]
  node_blog_list["Blog Index"]
  node_index_logic["Index Logic<br/>[repo.rs]"]
  node_image_assets["Image Assets"]
  node_image_copy["Image Copy<br/>[main.rs]"]
end

subgraph group_publish["Publishing"]
  node_git_upload["Git Upload<br/>[repo.rs]"]
end

node_author(("Blog Author"))
node_git_remote[("Git Remote")]

node_author -->|"runs"| node_cli
node_cli -->|"reads"| node_article_file
node_cli -->|"constructs"| node_article_parser
node_article_parser -->|"creates"| node_article_components
node_article_parser -->|"formats with"| node_html_helpers
node_article_components -->|"formats with"| node_html_helpers
node_article_parser -->|"assembles with"| node_page_template
node_cli -->|"writes"| node_article_html
node_cli -->|"reads"| node_blog_list
node_cli -->|"calls"| node_index_logic
node_index_logic -->|"renders entry"| node_html_helpers
node_cli -->|"writes"| node_blog_list
node_cli -->|"copies"| node_image_assets
node_cli -->|"invokes"| node_image_copy
node_cli -->|"calls"| node_git_upload
node_git_upload -->|"pushes"| node_git_remote

click node_cli "https://github.com/nuistmrchest/blyagger/blob/master/src/main.rs"
click node_article_parser "https://github.com/nuistmrchest/blyagger/blob/master/src/core_logic.rs"
click node_article_components "https://github.com/nuistmrchest/blyagger/blob/master/src/core_logic.rs"
click node_html_helpers "https://github.com/nuistmrchest/blyagger/blob/master/src/html_generator.rs"
click node_page_template "https://github.com/nuistmrchest/blyagger/blob/master/src/const_str.rs"
click node_index_logic "https://github.com/nuistmrchest/blyagger/blob/master/src/repo.rs"
click node_image_copy "https://github.com/nuistmrchest/blyagger/blob/master/src/main.rs"
click node_git_upload "https://github.com/nuistmrchest/blyagger/blob/master/src/repo.rs"

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_cli,node_article_file toneBlue
class node_article_parser,node_article_components,node_html_helpers,node_page_template,node_git_remote toneAmber
class node_article_html,node_blog_list,node_index_logic,node_image_assets,node_image_copy toneMint
class node_git_upload toneRose
class node_author toneIndigo
```

## Components

### Article Input

- [Publisher CLI](https://github.com/nuistmrchest/blyagger/blob/master/src/main.rs): `src/main.rs`
- **origin.txt**

### Article Rendering

- [Article Parser](https://github.com/nuistmrchest/blyagger/blob/master/src/core_logic.rs): `src/core_logic.rs`
- [Article Components](https://github.com/nuistmrchest/blyagger/blob/master/src/core_logic.rs): `src/core_logic.rs`
- [HTML Helpers](https://github.com/nuistmrchest/blyagger/blob/master/src/html_generator.rs): `src/html_generator.rs`
- [Page Template](https://github.com/nuistmrchest/blyagger/blob/master/src/const_str.rs): `src/const_str.rs`

### Site Updates

- **Article HTML**
- **Blog Index**
- [Index Logic](https://github.com/nuistmrchest/blyagger/blob/master/src/repo.rs): `src/repo.rs`
- **Image Assets**
- [Image Copy](https://github.com/nuistmrchest/blyagger/blob/master/src/main.rs): `src/main.rs`

### Publishing

- [Git Upload](https://github.com/nuistmrchest/blyagger/blob/master/src/repo.rs): `src/repo.rs`

### Other components

- **Blog Author**
- **Git Remote**

## Connections

- Blog Author → Publisher CLI: runs (evidence: `README.md`)
- Publisher CLI → origin.txt: reads (evidence: `src/main.rs`)
- Publisher CLI → Article Parser: constructs (evidence: `src/main.rs`)
- Article Parser → Article Components: creates (evidence: `src/core_logic.rs`)
- Article Parser → HTML Helpers: formats with (evidence: `src/core_logic.rs`)
- Article Components → HTML Helpers: formats with (evidence: `src/core_logic.rs`)
- Article Parser → Page Template: assembles with (evidence: `src/core_logic.rs`)
- Publisher CLI → Article HTML: writes (evidence: `src/main.rs`)
- Publisher CLI → Blog Index: reads (evidence: `src/main.rs`)
- Publisher CLI → Index Logic: calls (evidence: `src/main.rs`)
- Index Logic → HTML Helpers: renders entry (evidence: `src/repo.rs`)
- Publisher CLI → Blog Index: writes (evidence: `src/main.rs`)
- Publisher CLI → Image Assets: copies (evidence: `src/main.rs`)
- Publisher CLI → Image Copy: invokes (evidence: `src/main.rs`)
- Publisher CLI → Git Upload: calls (evidence: `src/main.rs`)
- Git Upload → Git Remote: pushes (evidence: `src/repo.rs`)
