# zhutyler21/ai_article_generator architecture

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

- Interactive diagram: https://gitdiagram.com/zhutyler21/ai_article_generator
- Repository: https://github.com/zhutyler21/ai_article_generator

## Overview

##### Document Processing Layer
- Two main components:
- PDF Processor (pdf_to_markdown.py)
- Word Document Processor (extract_bold.py)

##### Template Management Layer
- This in the middle layer
- Create two template repositories:
- Logic Framework Template (Logic_Outline_template.md)
- Writing Template (Writing_template.md)

##### AI Prompt System Layer
- This at the top layer
- Prompt.md as a central knowledge base
- Different prompt categories:
- Logic Framework Prompts
- Writing Template Prompts
- Literature Analysis Prompts

##### User Interaction Layer
- This as an overlay on the right side
- User input/output flows
- Interaction points with each layer

##### Component Labels
- Use clear, concise labels
- File names in smaller text
- Brief functionality descriptions

##### Process Flows
- Three main workflows:
1. Document Processing Flow
2. Template Application Flow
3. AI Assistance Flow

##### Integration Points
- How processed documents feed into the template system
- How AI prompts assist in both document processing and template usage
- Demonstrate the interaction between different components

##### Data Flow Patterns
- Transformation of documents from PDF/Word to Markdown
- How templates are applied to processed content
- Where AI assistance is available

##### System Boundaries
- Clearly delineate the three main subsystems
- External integration points
- Potential expansion points

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Style Definitions
    classDef processing fill:#a8d1f0,stroke:#333
    classDef template fill:#90EE90,stroke:#333
    classDef ai fill:#DDA0DD,stroke:#333
    classDef user fill:#D3D3D3,stroke:#333

    %% User Interaction Layer
    subgraph User
        UI[User Interface]:::user
        Input[Document Input]:::user
        Output[Final Output]:::user
    end

    %% AI Prompt System Layer
    subgraph AISystem
        AIP[AI Prompt System]:::ai
        LP[Logic Framework Prompts]:::ai
        WP[Writing Template Prompts]:::ai
        LAP[Literature Analysis Prompts]:::ai
    end
    click AIP "https://github.com/zhutyler21/AI_Article_Generator/blob/main/Prompt.md"

    %% Template Management Layer
    subgraph Templates
        LFT[Logic Framework Template]:::template
        WT[Writing Template]:::template
    end
    click LFT "https://github.com/zhutyler21/AI_Article_Generator/blob/main/Logic_Outline_template.md"
    click WT "https://github.com/zhutyler21/AI_Article_Generator/blob/main/Writing_template.md"

    %% Document Processing Layer
    subgraph Processing
        PDF[PDF Processor]:::processing
        Word[Word Document Processor]:::processing
    end
    click PDF "https://github.com/zhutyler21/AI_Article_Generator/blob/main/pdf_to_markdown.py"
    click Word "https://github.com/zhutyler21/AI_Article_Generator/blob/main/extract_bold.py"

    %% Connections
    Input --> PDF
    Input --> Word
    PDF --> LFT
    Word --> LFT
    LFT --> WT
    WT --> Output

    AIP --> LP
    AIP --> WP
    AIP --> LAP
    
    LP -.-> LFT
    WP -.-> WT
    LAP -.-> Processing

    UI --> Input
    Output --> UI

    %% Legend
    subgraph Legend
        L1[Processing Components]:::processing
        L2[Template Components]:::template
        L3[AI Components]:::ai
        L4[User Interface]:::user
    end
```
