# facundodlf/argendoku-creator architecture

> Architecture diagram of the GitHub repository facundodlf/argendoku-creator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/facundodlf/argendoku-creator
- Repository: https://github.com/facundodlf/argendoku-creator

## Overview

Argendoku Creator is a browser-based Sudoku book editor. The user chooses difficulty and batch size, adds generated puzzles to a book, reviews puzzle and automatically derived solution pages, and can remove puzzles or pages. PDF/KDP and image export are represented in the UI, but the inspected PDF flow is explicitly simulated; no real file-generation or external storage service is evidenced. The graph follows the app’s state-owning page through generation, layout and rendering, with shared UI primitives as an internal layer. Some component details were not sampled, so their links are limited to indexed references.

Main entry points: [`app/page.tsx`](https://github.com/facundodlf/argendoku-creator/blob/main/app/page.tsx) (App state and shell), [`lib/argendo/config.ts`](https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/config.ts) (Book configuration), [`components/argendo/toolbar.tsx`](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/toolbar.tsx) (Book controls), [`lib/argendo/types.ts`](https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/types.ts) (Domain contracts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application flow"]
  node_page["App state and shell<br/>[page.tsx]"]
end

subgraph group_domain["Puzzle and book domain"]
  node_generator["Puzzle generator<br/>[sudoku.ts]"]
  node_booklayout["Book page layout<br/>[use-book.ts]"]
  node_config["Book configuration<br/>[config.ts]"]
  node_types["Domain contracts<br/>[types.ts]"]
end

subgraph group_editor["Book editor UI"]
  node_header["Application header<br/>[app-header.tsx]"]
  node_toolbar["Book controls<br/>[toolbar.tsx]"]
  node_workspace["Book workspace<br/>[workspace.tsx]"]
  node_pagecard["Page preview<br/>[page-card.tsx]"]
  node_grid["Sudoku grid<br/>[sudoku-grid.tsx]"]
  node_export["Export dialog<br/>[export-dialog.tsx]"]
end

subgraph group_ui["Shared UI"]
  node_uikit["UI primitives"]
end

node_user(("Book creator"))

node_user -->|"uses editor"| node_page
node_page -->|"renders"| node_header
node_page -->|"renders"| node_toolbar
node_page -->|"renders"| node_workspace
node_page -->|"renders"| node_export
node_page -->|"creates batches"| node_generator
node_page -->|"derives pages"| node_booklayout
node_toolbar -->|"sends actions"| node_page
node_workspace -->|"renders pages"| node_pagecard
node_pagecard -->|"renders grids"| node_grid
node_generator -->|"reads difficulty rules"| node_config
node_page -->|"reads defaults"| node_config
node_toolbar -->|"reads options"| node_config
node_booklayout -->|"reads page limits"| node_config
node_export -->|"reads export options"| node_config
node_generator -->|"uses puzzle types"| node_types
node_booklayout -->|"uses page types"| node_types
node_page -->|"holds book state"| node_types
node_pagecard -->|"renders page data"| node_types
node_toolbar -->|"uses controls"| node_uikit
node_export -->|"uses dialog controls"| node_uikit

click node_page "https://github.com/facundodlf/argendoku-creator/blob/main/app/page.tsx"
click node_header "https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/app-header.tsx"
click node_toolbar "https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/toolbar.tsx"
click node_workspace "https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/workspace.tsx"
click node_pagecard "https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/page-card.tsx"
click node_grid "https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/sudoku-grid.tsx"
click node_export "https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/export-dialog.tsx"
click node_generator "https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/sudoku.ts"
click node_booklayout "https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/use-book.ts"
click node_config "https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/config.ts"
click node_types "https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/types.ts"
click node_uikit "https://github.com/facundodlf/argendoku-creator/tree/main/components/ui"

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_page toneBlue
class node_generator,node_booklayout,node_config,node_types toneAmber
class node_header,node_toolbar,node_workspace,node_pagecard,node_grid,node_export toneMint
class node_uikit toneRose
class node_user toneIndigo
```

## Components

### Application flow

- [App state and shell](https://github.com/facundodlf/argendoku-creator/blob/main/app/page.tsx): `app/page.tsx`

### Puzzle and book domain

- [Puzzle generator](https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/sudoku.ts): `lib/argendo/sudoku.ts`
- [Book page layout](https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/use-book.ts): `lib/argendo/use-book.ts`
- [Book configuration](https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/config.ts): `lib/argendo/config.ts`
- [Domain contracts](https://github.com/facundodlf/argendoku-creator/blob/main/lib/argendo/types.ts): `lib/argendo/types.ts`

### Book editor UI

- [Application header](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/app-header.tsx): `components/argendo/app-header.tsx`
- [Book controls](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/toolbar.tsx): `components/argendo/toolbar.tsx`
- [Book workspace](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/workspace.tsx): `components/argendo/workspace.tsx`
- [Page preview](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/page-card.tsx): `components/argendo/page-card.tsx`
- [Sudoku grid](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/sudoku-grid.tsx): `components/argendo/sudoku-grid.tsx`
- [Export dialog](https://github.com/facundodlf/argendoku-creator/blob/main/components/argendo/export-dialog.tsx): `components/argendo/export-dialog.tsx`

### Shared UI

- [UI primitives](https://github.com/facundodlf/argendoku-creator/tree/main/components/ui): `components/ui`

### Other components

- **Book creator**

## Connections

- Book creator → App state and shell: uses editor (evidence: `app/page.tsx`)
- App state and shell → Application header: renders (evidence: `app/page.tsx`)
- App state and shell → Book controls: renders (evidence: `app/page.tsx`)
- App state and shell → Book workspace: renders (evidence: `app/page.tsx`)
- App state and shell → Export dialog: renders (evidence: `app/page.tsx`)
- App state and shell → Puzzle generator: creates batches (evidence: `app/page.tsx`)
- App state and shell → Book page layout: derives pages (evidence: `app/page.tsx`)
- Book controls → App state and shell: sends actions (evidence: `app/page.tsx`)
- Book workspace → Page preview: renders pages (evidence: `components/argendo/workspace.tsx`)
- Page preview → Sudoku grid: renders grids (evidence: `components/argendo/page-card.tsx`)
- Puzzle generator → Book configuration: reads difficulty rules (evidence: `lib/argendo/sudoku.ts`)
- App state and shell → Book configuration: reads defaults (evidence: `app/page.tsx`)
- Book controls → Book configuration: reads options (evidence: `components/argendo/toolbar.tsx`)
- Book page layout → Book configuration: reads page limits (evidence: `lib/argendo/use-book.ts`)
- Export dialog → Book configuration: reads export options (evidence: `components/argendo/export-dialog.tsx`)
- Puzzle generator → Domain contracts: uses puzzle types (evidence: `lib/argendo/sudoku.ts`)
- Book page layout → Domain contracts: uses page types (evidence: `lib/argendo/use-book.ts`)
- App state and shell → Domain contracts: holds book state (evidence: `app/page.tsx`)
- Page preview → Domain contracts: renders page data (evidence: `components/argendo/page-card.tsx`)
- Book controls → UI primitives: uses controls (evidence: `components/argendo/toolbar.tsx`)
- Export dialog → UI primitives: uses dialog controls (evidence: `components/argendo/export-dialog.tsx`)
