# naaturel/gamebook-editor architecture

> Architecture diagram of the GitHub repository naaturel/gamebook-editor, 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/naaturel/gamebook-editor
- Repository: https://github.com/naaturel/gamebook-editor

## Overview

This is a JavaFX game-book editor: an editor starts the application, selects or creates a book, edits its pages and branching destinations, and can publish or delete content. Presenters mediate between the views, domain models, and repository interface; the sampled edition flow retrieves books and pages and submits validated changes through that interface. The application starts with a database-backed repository, and the sampled storage code performs SQL operations. Creation and startup presenter internals, and the repository-to-storage implementation, were not sampled, so those connections are not asserted.

Main entry points: [`src/main/java/org/helmo/gbeditor/presenters/EditionPresenter.java`](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/EditionPresenter.java) (Edition presenter), [`src/main/java/org/helmo/gbeditor/App.java`](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/App.java) (Application entry), [`src/main/java/org/helmo/gbeditor/models/Book.java`](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Book.java) (Book rules and state), [`src/main/java/org/helmo/gbeditor/views/EditionView.java`](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/EditionView.java) (Book and page editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Application UI"]
  node_app["Application entry<br/>[App.java]"]
  node_main_view["View container<br/>[ContainerView.java]"]
  node_start_view["Start screen<br/>[StartView.java]"]
  node_creation_view["Book creation<br/>[CreationView.java]"]
  node_edition_view["Book and page editor<br/>[EditionView.java]"]
end

subgraph group_workflow["Editing workflow"]
  node_start_presenter["Start presenter"]
  node_main_presenter["Navigation presenter<br/>[MainPresenter.java]"]
  node_creation_presenter["Creation presenter"]
  node_edition_presenter["Edition presenter"]
end

subgraph group_domain["Book domain"]
  node_book["Book rules and state<br/>[Book.java]"]
  node_shelf["Book collection<br/>[Shelf.java]"]
  node_page["Page content<br/>[Page.java]"]
  node_path["Branch destination<br/>[Path.java]"]
  node_editor_model["Author identity<br/>[Editor.java]"]
  node_isbn["ISBN validation<br/>[Isbn.java]"]
end

subgraph group_persistence["Persistence"]
  node_repo["Repository interface<br/>[Repo.java]"]
  node_db_repo["Database repository<br/>[dbRepo.java]"]
  node_storage_factory["Storage factory"]
  node_storage["SQL storage"]
  node_dto["Data transfer objects<br/>[DTOBook.java]"]
  node_mapper["Model mapper<br/>[Mapper.java]"]
end

node_editor(("Editor"))
node_database[("SQL database")]

node_editor -->|"starts"| node_app
node_app -->|"creates"| node_main_view
node_app -->|"shows"| node_start_view
node_app -->|"creates"| node_main_presenter
node_app -->|"creates"| node_start_presenter
node_editor -->|"uses"| node_edition_view
node_edition_view -->|"dispatches actions"| node_edition_presenter
node_edition_presenter -->|"updates display"| node_edition_view
node_edition_presenter -->|"retrieves and saves"| node_repo
node_edition_presenter -->|"updates collection"| node_shelf
node_edition_presenter -->|"validates edits"| node_book
node_edition_presenter -->|"creates and edits"| node_page
node_edition_presenter -->|"checks destinations"| node_path
node_edition_presenter -->|"requests navigation"| node_main_presenter
node_book -->|"holds identifier"| node_isbn
node_book -->|"holds author"| node_editor_model
node_book -->|"contains pages"| node_page
node_page -->|"contains destinations"| node_path
node_storage_factory -->|"creates"| node_storage
node_storage -->|"queries and updates"| node_database

click node_app "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/App.java"
click node_main_view "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/ContainerView.java"
click node_start_view "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/StartView.java"
click node_creation_view "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/CreationView.java"
click node_edition_view "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/EditionView.java"
click node_start_presenter "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/StartPresenter.java"
click node_main_presenter "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/MainPresenter.java"
click node_creation_presenter "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/CreationPresenter.java"
click node_edition_presenter "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/EditionPresenter.java"
click node_repo "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/repo/Repo.java"
click node_db_repo "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/repo/dbRepo.java"
click node_storage_factory "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/GameBookStorageFactory.java"
click node_storage "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/GameBookStorage.java"
click node_book "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Book.java"
click node_shelf "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Shelf.java"
click node_page "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Page.java"
click node_path "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Path.java"
click node_editor_model "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Editor.java"
click node_isbn "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Isbn.java"
click node_dto "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/DTOBook.java"
click node_mapper "https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/Mapper.java"

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_app,node_main_view,node_start_view,node_creation_view,node_edition_view toneBlue
class node_start_presenter,node_main_presenter,node_creation_presenter,node_edition_presenter,node_database toneAmber
class node_book,node_shelf,node_page,node_path,node_editor_model,node_isbn toneMint
class node_repo,node_db_repo,node_storage_factory,node_storage,node_dto,node_mapper toneRose
class node_editor toneIndigo
```

## Components

### Application UI

- [Application entry](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/App.java): `src/main/java/org/helmo/gbeditor/App.java`
- [View container](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/ContainerView.java): `src/main/java/org/helmo/gbeditor/views/ContainerView.java`
- [Start screen](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/StartView.java): `src/main/java/org/helmo/gbeditor/views/StartView.java`
- [Book creation](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/CreationView.java): `src/main/java/org/helmo/gbeditor/views/CreationView.java`
- [Book and page editor](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/views/EditionView.java): `src/main/java/org/helmo/gbeditor/views/EditionView.java`

### Editing workflow

- [Start presenter](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/StartPresenter.java): `src/main/java/org/helmo/gbeditor/presenters/StartPresenter.java`
- [Navigation presenter](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/MainPresenter.java): `src/main/java/org/helmo/gbeditor/presenters/MainPresenter.java`
- [Creation presenter](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/CreationPresenter.java): `src/main/java/org/helmo/gbeditor/presenters/CreationPresenter.java`
- [Edition presenter](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/presenters/EditionPresenter.java): `src/main/java/org/helmo/gbeditor/presenters/EditionPresenter.java`

### Book domain

- [Book rules and state](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Book.java): `src/main/java/org/helmo/gbeditor/models/Book.java`
- [Book collection](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Shelf.java): `src/main/java/org/helmo/gbeditor/models/Shelf.java`
- [Page content](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Page.java): `src/main/java/org/helmo/gbeditor/models/Page.java`
- [Branch destination](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Path.java): `src/main/java/org/helmo/gbeditor/models/Path.java`
- [Author identity](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Editor.java): `src/main/java/org/helmo/gbeditor/models/Editor.java`
- [ISBN validation](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/models/Isbn.java): `src/main/java/org/helmo/gbeditor/models/Isbn.java`

### Persistence

- [Repository interface](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/repo/Repo.java): `src/main/java/org/helmo/gbeditor/repo/Repo.java`
- [Database repository](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/repo/dbRepo.java): `src/main/java/org/helmo/gbeditor/repo/dbRepo.java`
- [Storage factory](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/GameBookStorageFactory.java): `src/main/java/org/helmo/gbeditor/infrastructure/GameBookStorageFactory.java`
- [SQL storage](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/GameBookStorage.java): `src/main/java/org/helmo/gbeditor/infrastructure/GameBookStorage.java`
- [Data transfer objects](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/DTOBook.java): `src/main/java/org/helmo/gbeditor/infrastructure/DTOBook.java`
- [Model mapper](https://github.com/naaturel/gamebook-editor/blob/master/src/main/java/org/helmo/gbeditor/infrastructure/Mapper.java): `src/main/java/org/helmo/gbeditor/infrastructure/Mapper.java`

### Other components

- **Editor**
- **SQL database**

## Connections

- Editor → Application entry: starts
- Application entry → View container: creates
- Application entry → Start screen: shows
- Application entry → Navigation presenter: creates
- Application entry → Start presenter: creates
- Editor → Book and page editor: uses
- Book and page editor → Edition presenter: dispatches actions
- Edition presenter → Book and page editor: updates display
- Edition presenter → Repository interface: retrieves and saves
- Edition presenter → Book collection: updates collection
- Edition presenter → Book rules and state: validates edits
- Edition presenter → Page content: creates and edits
- Edition presenter → Branch destination: checks destinations
- Edition presenter → Navigation presenter: requests navigation
- Book rules and state → ISBN validation: holds identifier
- Book rules and state → Author identity: holds author
- Book rules and state → Page content: contains pages
- Page content → Branch destination: contains destinations
- Storage factory → SQL storage: creates
- SQL storage → SQL database: queries and updates
