# soulca-prjkt/book-foto-automatico architecture

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

- Interactive diagram: https://gitdiagram.com/soulca-prjkt/book-foto-automatico
- Repository: https://github.com/soulca-prjkt/book-foto-automatico

## Overview

Book Foto Automatico is a Windows GUI for turning a folder of photos into a Word catalog. The user selects source and destination folders and a filename; the GUI discovers and naturally sorts supported images, then calls the document generator. That generator lays images out in an A4 grid, adds filenames, reports progress, and saves a .docx file. The generator also uses Pillow to open and orient images, and python-docx to create the document. The README documents the intended catalog features; source excerpts show implementation details, including a hard-coded 5.5 cm image height.

Main entry points: [`app/gui.py`](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/gui.py) (GUI workflow), [`app/word_generator.py`](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/word_generator.py) (Word generator), [`app/image_utils.py`](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/image_utils.py) (Image discovery), [`main.py`](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/main.py) (App entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_entry["App entry<br/>[main.py]"]
  node_gui["GUI workflow<br/>[gui.py]"]
end

subgraph group_discovery["Image discovery"]
  node_image_files["Source images"]
  node_finder["Image discovery<br/>[image_utils.py]"]
end

subgraph group_generation["Document generation"]
  node_generator["Word generator<br/>[word_generator.py]"]
  node_pillow["Pillow"]
  node_docx_lib["python-docx"]
  node_word_file["Word document"]
end

node_user(("User"))

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_gui
node_user -->|"selects folders"| node_gui
node_gui -->|"finds images"| node_finder
node_finder -->|"reads and sorts"| node_image_files
node_finder -->|"returns paths"| node_gui
node_gui -->|"generates catalog"| node_generator
node_generator -->|"opens images"| node_pillow
node_generator -->|"builds document"| node_docx_lib
node_docx_lib -->|"saves .docx"| node_word_file
node_generator -->|"reports progress"| node_gui

click node_entry "https://github.com/soulca-prjkt/book-foto-automatico/blob/main/main.py"
click node_gui "https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/gui.py"
click node_finder "https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/image_utils.py"
click node_generator "https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/word_generator.py"

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_entry,node_gui,node_user toneBlue
class node_image_files,node_finder toneAmber
class node_generator,node_pillow,node_docx_lib,node_word_file toneMint
```

## Components

### User interface

- [App entry](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/main.py): `main.py`
- [GUI workflow](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/gui.py): `app/gui.py`

### Image discovery

- **Source images**
- [Image discovery](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/image_utils.py): `app/image_utils.py`

### Document generation

- [Word generator](https://github.com/soulca-prjkt/book-foto-automatico/blob/main/app/word_generator.py): `app/word_generator.py`
- **Pillow**
- **python-docx**
- **Word document**

### Other components

- **User**

## Connections

- User → App entry: launches
- App entry → GUI workflow: starts
- User → GUI workflow: selects folders
- GUI workflow → Image discovery: finds images
- Image discovery → Source images: reads and sorts
- Image discovery → GUI workflow: returns paths
- GUI workflow → Word generator: generates catalog
- Word generator → Pillow: opens images
- Word generator → python-docx: builds document
- python-docx → Word document: saves .docx
- Word generator → GUI workflow: reports progress
