# k1low/deck architecture

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

- Interactive diagram: https://gitdiagram.com/k1low/deck
- Repository: https://github.com/k1low/deck

## Overview

deck is a CLI for creating and iteratively updating Google Slides presentations from Markdown. The main workflow is to create or choose a presentation, write slide content in Markdown, then apply it; the CLI also supports watch mode, export, layout and presentation listing, browser opening, and setup diagnosis. Internally, Markdown parsing produces slide structures that the presentation client applies through Google APIs. Relationships are limited to those visible in excerpts or documented in the README; several core implementation modules are represented, but their internal calls were not sampled.

Main entry points: [`deck.go`](https://github.com/k1low/deck/blob/main/deck.go) (Presentation client), [`md/md.go`](https://github.com/k1low/deck/blob/main/md/md.go) (Markdown parser), [`cmd/apply.go`](https://github.com/k1low/deck/blob/main/cmd/apply.go) (Apply and watch), [`cmd/new.go`](https://github.com/k1low/deck/blob/main/cmd/new.go) (Create presentation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_entry["Command entry<br/>[main.go]"]
  node_apply["Apply and watch<br/>[apply.go]"]
  node_create["Create presentation<br/>[new.go]"]
  node_export["Export PDF<br/>[export.go]"]
  node_list["List presentations<br/>[ls.go]"]
  node_layouts["List layouts<br/>[lsLayouts.go]"]
  node_open["Open presentation<br/>[open.go]"]
  node_doctor["Setup diagnosis<br/>[doctor.go]"]
end

subgraph group_content["Markdown content"]
  node_markdown["Markdown parser<br/>[md.go]"]
  node_frontmatter["Frontmatter<br/>[frontmatter.go]"]
  node_cel["Conditional defaults<br/>[cel.go]"]
end

subgraph group_slides["Presentation engine"]
  node_deck["Presentation client<br/>[deck.go]"]
  node_actions["Slide operations<br/>[action.go]"]
  node_slide["Slide model<br/>[slide.go]"]
  node_style["Slide styling<br/>[style.go]"]
  node_tables["Table rendering<br/>[table.go]"]
  node_images["Image handling<br/>[image.go]"]
end

subgraph group_auth["Identity and settings"]
  node_oauth["OAuth client<br/>[client.go]"]
  node_config["Configuration<br/>[config.go]"]
end

node_user(("Presenter"))
node_google["Google Slides and Drive"]
node_markdownfile["Markdown file"]
node_pdf["PDF file"]
node_browser["Web browser"]

node_user -->|"runs commands"| node_entry
node_entry -->|"dispatches"| node_apply
node_apply -->|"parses content"| node_markdown
node_markdownfile -->|"provides slides"| node_apply
node_apply -->|"applies slides"| node_deck
node_deck -->|"updates presentation"| node_google
node_user -->|"requests creation"| node_create
node_create -->|"creates presentation"| node_deck
node_create -->|"writes metadata"| node_frontmatter
node_frontmatter -->|"updates file"| node_markdownfile
node_user -->|"requests export"| node_export
node_export -->|"exports presentation"| node_deck
node_export -->|"writes PDF"| node_pdf
node_user -->|"lists presentations"| node_list
node_list -.->|"lists files"| node_google
node_user -->|"lists layouts"| node_layouts
node_layouts -->|"reads layouts"| node_deck
node_user -->|"opens presentation"| node_open
node_open -.->|"launches URL"| node_browser
node_user -->|"checks setup"| node_doctor
node_doctor -->|"checks authentication"| node_deck
node_deck -->|"gets HTTP client"| node_oauth
node_oauth -->|"loads credentials"| node_config
node_markdown -->|"reads metadata"| node_frontmatter
node_markdown -.->|"evaluates defaults"| node_cel
node_markdown -->|"builds slide data"| node_slide
node_deck -.->|"dispatches operations"| node_actions
node_actions -.->|"uses slide model"| node_slide
node_deck -.->|"applies styles"| node_style
node_deck -.->|"renders tables"| node_tables
node_deck -.->|"handles images"| node_images

click node_entry "https://github.com/k1low/deck/blob/main/cmd/deck/main.go"
click node_apply "https://github.com/k1low/deck/blob/main/cmd/apply.go"
click node_create "https://github.com/k1low/deck/blob/main/cmd/new.go"
click node_export "https://github.com/k1low/deck/blob/main/cmd/export.go"
click node_list "https://github.com/k1low/deck/blob/main/cmd/ls.go"
click node_layouts "https://github.com/k1low/deck/blob/main/cmd/lsLayouts.go"
click node_open "https://github.com/k1low/deck/blob/main/cmd/open.go"
click node_doctor "https://github.com/k1low/deck/blob/main/cmd/doctor.go"
click node_markdown "https://github.com/k1low/deck/blob/main/md/md.go"
click node_frontmatter "https://github.com/k1low/deck/blob/main/md/frontmatter.go"
click node_cel "https://github.com/k1low/deck/blob/main/md/cel.go"
click node_deck "https://github.com/k1low/deck/blob/main/deck.go"
click node_actions "https://github.com/k1low/deck/blob/main/action.go"
click node_slide "https://github.com/k1low/deck/blob/main/slide.go"
click node_style "https://github.com/k1low/deck/blob/main/style.go"
click node_tables "https://github.com/k1low/deck/blob/main/table.go"
click node_images "https://github.com/k1low/deck/blob/main/image.go"
click node_oauth "https://github.com/k1low/deck/blob/main/client.go"
click node_config "https://github.com/k1low/deck/blob/main/config/config.go"

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_apply,node_create,node_export,node_list,node_layouts,node_open,node_doctor,node_browser toneBlue
class node_markdown,node_frontmatter,node_cel toneAmber
class node_deck,node_actions,node_slide,node_style,node_tables,node_images toneMint
class node_oauth,node_config toneRose
class node_user,node_google,node_markdownfile,node_pdf toneIndigo
```

## Components

### CLI workflows

- [Command entry](https://github.com/k1low/deck/blob/main/cmd/deck/main.go): `cmd/deck/main.go`
- [Apply and watch](https://github.com/k1low/deck/blob/main/cmd/apply.go): `cmd/apply.go`
- [Create presentation](https://github.com/k1low/deck/blob/main/cmd/new.go): `cmd/new.go`
- [Export PDF](https://github.com/k1low/deck/blob/main/cmd/export.go): `cmd/export.go`
- [List presentations](https://github.com/k1low/deck/blob/main/cmd/ls.go): `cmd/ls.go`
- [List layouts](https://github.com/k1low/deck/blob/main/cmd/lsLayouts.go): `cmd/lsLayouts.go`
- [Open presentation](https://github.com/k1low/deck/blob/main/cmd/open.go): `cmd/open.go`
- [Setup diagnosis](https://github.com/k1low/deck/blob/main/cmd/doctor.go): `cmd/doctor.go`

### Markdown content

- [Markdown parser](https://github.com/k1low/deck/blob/main/md/md.go): `md/md.go`
- [Frontmatter](https://github.com/k1low/deck/blob/main/md/frontmatter.go): `md/frontmatter.go`
- [Conditional defaults](https://github.com/k1low/deck/blob/main/md/cel.go): `md/cel.go`

### Presentation engine

- [Presentation client](https://github.com/k1low/deck/blob/main/deck.go): `deck.go`
- [Slide operations](https://github.com/k1low/deck/blob/main/action.go): `action.go`
- [Slide model](https://github.com/k1low/deck/blob/main/slide.go): `slide.go`
- [Slide styling](https://github.com/k1low/deck/blob/main/style.go): `style.go`
- [Table rendering](https://github.com/k1low/deck/blob/main/table.go): `table.go`
- [Image handling](https://github.com/k1low/deck/blob/main/image.go): `image.go`

### Identity and settings

- [OAuth client](https://github.com/k1low/deck/blob/main/client.go): `client.go`
- [Configuration](https://github.com/k1low/deck/blob/main/config/config.go): `config/config.go`

### Other components

- **Presenter**
- **Google Slides and Drive**
- **Markdown file**
- **PDF file**
- **Web browser**

## Connections

- Presenter → Command entry: runs commands (evidence: `README.md`)
- Command entry → Apply and watch: dispatches (evidence: `cmd/deck/main.go`)
- Apply and watch → Markdown parser: parses content (evidence: `cmd/apply.go`)
- Markdown file → Apply and watch: provides slides (evidence: `README.md`)
- Apply and watch → Presentation client: applies slides (evidence: `cmd/apply.go`)
- Presentation client → Google Slides and Drive: updates presentation (evidence: `deck.go`)
- Presenter → Create presentation: requests creation (evidence: `README.md`)
- Create presentation → Presentation client: creates presentation (evidence: `cmd/new.go`)
- Create presentation → Frontmatter: writes metadata (evidence: `cmd/new.go`)
- Frontmatter → Markdown file: updates file (evidence: `md/frontmatter.go`)
- Presenter → Export PDF: requests export (evidence: `README.md`)
- Export PDF → Presentation client: exports presentation (evidence: `cmd/export.go`)
- Export PDF → PDF file: writes PDF (evidence: `cmd/export.go`)
- Presenter → List presentations: lists presentations (evidence: `README.md`)
- List presentations → Google Slides and Drive: lists files
- Presenter → List layouts: lists layouts (evidence: `README.md`)
- List layouts → Presentation client: reads layouts (evidence: `cmd/lsLayouts.go`)
- Presenter → Open presentation: opens presentation (evidence: `README.md`)
- Open presentation → Web browser: launches URL
- Presenter → Setup diagnosis: checks setup (evidence: `README.md`)
- Setup diagnosis → Presentation client: checks authentication (evidence: `cmd/doctor.go`)
- Presentation client → OAuth client: gets HTTP client (evidence: `deck.go`)
- OAuth client → Configuration: loads credentials (evidence: `client.go`)
- Markdown parser → Frontmatter: reads metadata (evidence: `md/md.go`)
- Markdown parser → Conditional defaults: evaluates defaults
- Markdown parser → Slide model: builds slide data (evidence: `md/md.go`)
- Presentation client → Slide operations: dispatches operations
- Slide operations → Slide model: uses slide model
- Presentation client → Slide styling: applies styles
- Presentation client → Table rendering: renders tables
- Presentation client → Image handling: handles images
