# apoorvpathak/simpleblogger architecture

> Architecture diagram of the GitHub repository apoorvpathak/simpleblogger, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/apoorvpathak/simpleblogger
- Repository: https://github.com/apoorvpathak/simpleblogger

## Overview

##### Main System Components

a) CLI Interface Layer
- Entry point for user commands (init, create-post, build)

b) Core Processing Layer
- File System Operations
- Markdown to HTML Conversion
- Post Indexing System

c) Output Generation Layer
- Static File Generation
- Blog Structure Creation

##### Component Relationships

**[User/CLI Layer]**
- ↓
**[Core Processing Layer]**
- ↓
**[Output Generation Layer]**

##### Specific Component Details

CLI Layer (Top):
- Use rounded rectangles to represent these command endpoints

Core Processing Layer (Middle):
- A "Markdown Processor" component
- A "Post Indexer" component

Output Generation Layer (Bottom):
- Blog structure with folders
- Posts.json generator
- Static HTML output

##### Important Elements

- Input directory structure (posts-md/)
- Output directory structure (posts-html/)
- posts.json structure
- Template processing flow

##### Technical Details to Highlight

Specific technical components:
- Markdown parsing process
- JSON metadata generation
- HTML template injection
- Static file organization

##### Notes Section

A small notes section indicating:
- Asynchronous operations
- File system dependencies
- Template customization points

Remember to include:
- Version control integration points
- Error handling flow
- Configuration file interactions
- Template customization points

This will give other developers a clear understanding of how SimpleBlogger works, from user input through to static blog generation.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef cli fill:#a8d1f0,stroke:#333,stroke-width:2px
    classDef process fill:#90EE90,stroke:#333,stroke-width:2px
    classDef output fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef fs fill:#FFA07A,stroke:#333,stroke-width:2px

    %% CLI Layer
    subgraph CLI
        Entry["CLI Entry Point"]:::cli
        Init["Init Command"]:::cli
        Create["Create Post Command"]:::cli
        Build["Build Command"]:::cli
        
        Entry --> Init
        Entry --> Create
        Entry --> Build
    end

    %% Core Processing Layer
    subgraph Processing
        FSM["File System Manager"]:::process
        MP["Markdown Processor"]:::process
        PI["Post Indexer"]:::process
        
        Init -.-> FSM
        Create -.-> FSM
        Build -.-> FSM
        
        FSM <--> MP
        FSM <--> PI
    end

    %% Output Generation Layer
    subgraph Output
        BS["Blog Structure"]:::output
        PJ["posts.json Generator"]:::output
        SO["Static HTML Output"]:::output
        
        MP --> SO
        PI --> PJ
        PJ --> BS
        SO --> BS
    end

    %% File System Operations
    subgraph "File System"
        MD[("posts-md/")]:::fs
        HTML[("posts-html/")]:::fs
        Templates[("templates/")]:::fs
        
        FSM -.-> MD
        FSM -.-> HTML
        FSM -.-> Templates
    end

    %% Click Events
    click Entry "https://github.com/apoorvpathak/simpleblogger/blob/main/src/index.js"
    click Init "https://github.com/apoorvpathak/simpleblogger/blob/main/src/init.js"
    click Create "https://github.com/apoorvpathak/simpleblogger/blob/main/src/newpost.js"
    click Build "https://github.com/apoorvpathak/simpleblogger/blob/main/src/build.js"

    %% Legend
    subgraph Legend
        L1["CLI Components"]:::cli
        L2["Processing Components"]:::process
        L3["Output Components"]:::output
        L4["File System"]:::fs
    end
```
