# wesleyscholl/book-generator architecture

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

- Interactive diagram: https://gitdiagram.com/wesleyscholl/book-generator
- Repository: https://github.com/wesleyscholl/book-generator

## Overview

AI Book Generator supports topic validation, AI-assisted manuscript creation and revision, book extras and cover generation, and multi-format compilation. The principal workflow starts with a topic or outline, develops and improves chapters, then assembles and exports a book. Market, trend, and social research are separate supporting capabilities. The README documents several scripts whose source was not sampled; those branches are included based on its descriptions, with uncertain wiring omitted.

Main entry points: [`scripts/multi_provider_ai_simple.sh`](https://github.com/wesleyscholl/book-generator/blob/main/scripts/multi_provider_ai_simple.sh) (Provider selection), [`scripts/topic_market_research.sh`](https://github.com/wesleyscholl/book-generator/blob/main/scripts/topic_market_research.sh) (Topic research), [`scripts/compile_book.sh`](https://github.com/wesleyscholl/book-generator/blob/main/scripts/compile_book.sh) (Manuscript compiler), [`scripts/book_research_data/market_analyzer.py`](https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/market_analyzer.py) (Market analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_research["Topic Research"]
  node_market["KDP market analysis"]
  node_market_core["Market analysis<br/>[market_analyzer.py]"]
  node_topic_research["Topic research"]
  node_trends["Trend analysis<br/>[trends_analyzer.py]"]
  node_social["Social research<br/>[social_analyzer.py]"]
  node_report["Research report"]
end

subgraph group_authoring["Book Authoring"]
  node_outline["Book outline"]
  node_provider_helper["Provider selection"]
  node_chapters["Chapter handling"]
end

subgraph group_quality["Editing and Extras"]
  node_appendices["Book extras"]
  node_plagiarism["Plagiarism checks"]
end

subgraph group_design["Cover Design"]
  node_cover["Cover generation<br/>[generate_covers.sh]"]
end

subgraph group_publication["Book Compilation"]
  node_compile["Manuscript compiler<br/>[compile_book.sh]"]
  node_formats["Book files"]
end

node_author(("Book creator"))
node_amazon["Amazon"]
node_web["Search platforms"]
node_ai["AI providers"]
node_local_design["Local design tools"]
node_publishing["Publishing platforms"]

node_author -->|"researches topic"| node_market
node_market -->|"runs analysis"| node_market_core
node_market_core -.->|"scrapes listings"| node_amazon
node_author -->|"researches topic"| node_topic_research
node_topic_research -.->|"checks trends"| node_trends
node_topic_research -.->|"checks social"| node_social
node_trends -.->|"searches"| node_web
node_social -.->|"researches"| node_web
node_report -->|"reads analysis"| node_market_core
node_report -.->|"reads trends"| node_trends
node_author -->|"requests generation"| node_provider_helper
node_provider_helper -.->|"calls provider"| node_ai
node_chapters -->|"generates chapters"| node_provider_helper
node_author -->|"creates or revises"| node_chapters
node_author -->|"generates extras"| node_appendices
node_appendices -->|"requests generation"| node_provider_helper
node_author -.->|"checks manuscript"| node_plagiarism
node_author -->|"requests cover"| node_cover
node_cover -.->|"uses tools"| node_local_design
node_author -->|"compiles book"| node_compile
node_compile -->|"exports formats"| node_formats
node_compile -->|"prepares for"| node_publishing

click node_market "https://github.com/wesleyscholl/book-generator/blob/main/scripts/kdp_market_analyzer.sh"
click node_market_core "https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/market_analyzer.py"
click node_topic_research "https://github.com/wesleyscholl/book-generator/blob/main/scripts/topic_market_research.sh"
click node_trends "https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/trends_analyzer.py"
click node_social "https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/social_analyzer.py"
click node_report "https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/report_generator.py"
click node_provider_helper "https://github.com/wesleyscholl/book-generator/blob/main/scripts/multi_provider_ai_simple.sh"
click node_chapters "https://github.com/wesleyscholl/book-generator/blob/main/scripts/optimized_chapter_handler.sh"
click node_appendices "https://github.com/wesleyscholl/book-generator/blob/main/scripts/generate_appendices.sh"
click node_plagiarism "https://github.com/wesleyscholl/book-generator/blob/main/scripts/plagiarism_report_manager.sh"
click node_cover "https://github.com/wesleyscholl/book-generator/blob/main/scripts/generate_covers.sh"
click node_compile "https://github.com/wesleyscholl/book-generator/blob/main/scripts/compile_book.sh"

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_market,node_market_core,node_topic_research,node_trends,node_social,node_report toneBlue
class node_outline,node_provider_helper,node_chapters toneAmber
class node_appendices,node_plagiarism toneMint
class node_cover toneRose
class node_compile,node_formats,node_author,node_amazon,node_web,node_ai,node_local_design,node_publishing toneIndigo
```

## Components

### Topic Research

- [KDP market analysis](https://github.com/wesleyscholl/book-generator/blob/main/scripts/kdp_market_analyzer.sh): `scripts/kdp_market_analyzer.sh`
- [Market analysis](https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/market_analyzer.py): `scripts/book_research_data/market_analyzer.py`
- [Topic research](https://github.com/wesleyscholl/book-generator/blob/main/scripts/topic_market_research.sh): `scripts/topic_market_research.sh`
- [Trend analysis](https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/trends_analyzer.py): `scripts/book_research_data/trends_analyzer.py`
- [Social research](https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/social_analyzer.py): `scripts/book_research_data/social_analyzer.py`
- [Research report](https://github.com/wesleyscholl/book-generator/blob/main/scripts/book_research_data/report_generator.py): `scripts/book_research_data/report_generator.py`

### Book Authoring

- **Book outline**
- [Provider selection](https://github.com/wesleyscholl/book-generator/blob/main/scripts/multi_provider_ai_simple.sh): `scripts/multi_provider_ai_simple.sh`
- [Chapter handling](https://github.com/wesleyscholl/book-generator/blob/main/scripts/optimized_chapter_handler.sh): `scripts/optimized_chapter_handler.sh`

### Editing and Extras

- [Book extras](https://github.com/wesleyscholl/book-generator/blob/main/scripts/generate_appendices.sh): `scripts/generate_appendices.sh`
- [Plagiarism checks](https://github.com/wesleyscholl/book-generator/blob/main/scripts/plagiarism_report_manager.sh): `scripts/plagiarism_report_manager.sh`

### Cover Design

- [Cover generation](https://github.com/wesleyscholl/book-generator/blob/main/scripts/generate_covers.sh): `scripts/generate_covers.sh`

### Book Compilation

- [Manuscript compiler](https://github.com/wesleyscholl/book-generator/blob/main/scripts/compile_book.sh): `scripts/compile_book.sh`
- **Book files**

### Other components

- **Book creator**
- **Amazon**
- **Search platforms**
- **AI providers**
- **Local design tools**
- **Publishing platforms**

## Connections

- Book creator → KDP market analysis: researches topic
- KDP market analysis → Market analysis: runs analysis
- Market analysis → Amazon: scrapes listings
- Book creator → Topic research: researches topic
- Topic research → Trend analysis: checks trends
- Topic research → Social research: checks social
- Trend analysis → Search platforms: searches
- Social research → Search platforms: researches
- Research report → Market analysis: reads analysis
- Research report → Trend analysis: reads trends
- Book creator → Provider selection: requests generation
- Provider selection → AI providers: calls provider
- Chapter handling → Provider selection: generates chapters
- Book creator → Chapter handling: creates or revises
- Book creator → Book extras: generates extras
- Book extras → Provider selection: requests generation
- Book creator → Plagiarism checks: checks manuscript
- Book creator → Cover generation: requests cover
- Cover generation → Local design tools: uses tools
- Book creator → Manuscript compiler: compiles book
- Manuscript compiler → Book files: exports formats
- Manuscript compiler → Publishing platforms: prepares for
