# sunghwan2789/bible2ppt architecture

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

- Interactive diagram: https://gitdiagram.com/sunghwan2789/bible2ppt
- Repository: https://github.com/sunghwan2789/bible2ppt

## Overview

##### Project type and purpose
- Bible2PPT is a Windows desktop application (built on .NET Framework 4.8, Windows Forms) whose goal is to fetch Bible verses (from multiple online sources), cache them locally, apply user-customizable PowerPoint templates, and generate PPTX files for given verse queries.

##### File structure
- Top-level “Bible2PPT” directory: the WinForms UI project (Program.cs, MainForm.*, Controls/, Resources/, app.config)
- “Bible2PPT.Services.*” projects (class libraries) under solution root:
- BibleIndexService – parses and indexes verse queries, uses EF Core for storing an index database
- BibleService – fetches/normalizes Bible text from external HTTP sources, uses EF Core for offline cache DB
- BuildService – orchestrates PPT creation (manages jobs, uses Open XML or COM automation to build slides), EF Core for build job tracking
- TemplateService – applies placeholders (tokens) to a PPTx template file
- “Bible2PPT.Tests” and service-specific test projects for unit tests
- “Template” folder: raw PPTX template structure to be used by TemplateService
- Configuration, GitHub workflows, migrations for each EF-backed service

##### README for additional insights
- Describes feature set: verse query format, template placeholders, offline caching, chapter‐by‐chapter file output
- Lists external Bible sources by language
- Explains template token system ([TITLE], [CHAP], etc.)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% UI Layer
    subgraph "UI Layer" 
        direction TB
        UI["Bible2PPT WinForms UI"]:::ui
    end

    %% Service Layer
    subgraph "Service Layer"
        direction TB
        IndexSvc["BibleIndexService"]:::service
        BibleSvc["BibleService"]:::service
        TemplateSvc["TemplateService"]:::service
        BuildSvc["BuildService"]:::service
    end

    %% Persistence Layer
    subgraph "Persistence Layer"
        direction TB
        IndexDB["Index DB"]:::db
        CacheDB["Cache DB"]:::db
        BuildDB["Build Job DB"]:::db
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        HTTP["HTTP Bible Sources"]:::external
        COM["PowerPoint COM/Open XML SDK"]:::external
    end

    %% File System
    subgraph "File System"
        direction TB
        TemplateFolder["Raw PPTX Template Folder"]:::storage
        Output["Generated PPTX Output"]:::storage
    end

    %% Connections
    UI -->|"enter verse queries"| IndexSvc
    IndexSvc -->|"read/write queries"| IndexDB
    UI -->|"request verses"| BibleSvc
    BibleSvc -->|"read/write cache"| CacheDB
    BibleSvc -->|"fetch on miss"| HTTP
    UI -->|"select template & data"| TemplateSvc
    TemplateSvc -->|"load template"| TemplateFolder
    TemplateSvc -->|"prepared slides"| BuildSvc
    BuildSvc -->|"manage jobs"| BuildDB
    BuildSvc -->|"automate slides"| COM
    BuildSvc -->|"write files"| Output

    %% Click Events
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/Program.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.Designer.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.Helper.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.History.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.Settings.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.Templates.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/MainForm.Build.cs"
    click UI "https://github.com/sunghwan2789/bible2ppt/tree/main/Bible2PPT/Controls/"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/Resources/Template.pptx"
    click UI "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT/app.config"

    click IndexSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleIndexService/BibleIndexService.cs"
    click IndexSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleIndexService/VerseQueryParser.cs"
    click IndexSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleIndexService/VerseQueryRange.cs"
    click IndexSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleIndexService/BibleIndexContext.cs"
    click IndexSvc "https://github.com/sunghwan2789/bible2ppt/tree/main/Bible2PPT.Services.BibleIndexService/Migrations/"

    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleService/BibleService.cs"
    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleService/BibleContext.cs"
    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleService/Sources/GodpeopleBible.cs"
    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleService/Sources/GoodtvBible.cs"
    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleService/Sources/GodpiaBible.cs"
    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BibleService/Extensions/HttpClientExtension.cs"
    click BibleSvc "https://github.com/sunghwan2789/bible2ppt/tree/main/Bible2PPT.Services.BibleService/Migrations/"

    click TemplateSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.TemplateService/TemplateService.cs"
    click TemplateSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.TemplateService/Template.cs"
    click TemplateSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.TemplateService/TemplateTextOptions.cs"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/blob/main/Template/[Content_Types].xml"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/tree/main/Template/_rels/"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/blob/main/Template/ppt/presentation.xml"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/blob/main/Template/ppt/slideLayouts/slideLayout1.xml"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/blob/main/Template/ppt/slideMasters/slideMaster1.xml"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/blob/main/Template/ppt/slides/slide1.xml"
    click TemplateFolder "https://github.com/sunghwan2789/bible2ppt/blob/main/Template/ppt/theme/theme1.xml"

    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/BuildContext.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/PPT/Builder.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/PPT/JobManager.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/PPT/Job.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/PPT/JobQueuedEventArgs.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/PPT/JobProgressEventArgs.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/PPT/JobCompletedEventArgs.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/blob/main/Bible2PPT.Services.BuildService/Services/HiddenPowerPoint.cs"
    click BuildSvc "https://github.com/sunghwan2789/bible2ppt/tree/main/Bible2PPT.Services.BuildService/Migrations/"

    %% Styles
    classDef ui fill:#DAE8FC,stroke:#6C8EBF,color:#1F2A36;
    classDef service fill:#D5E8D4,stroke:#82B366,color:#1F2A36;
    classDef db fill:#FFE6AD,stroke:#D6A100,color:#1F2A36;
    classDef storage fill:#F8CECC,stroke:#B85450,color:#1F2A36;
    classDef external fill:#E1E1E1,stroke:#888888,color:#1F2A36;
```
