# acmepy/report-make architecture

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

- Interactive diagram: https://gitdiagram.com/acmepy/report-make
- Repository: https://github.com/acmepy/report-make

## Overview

Report Make lets users edit a PDFMake template and its test data and variables, preview generated PDFs in the browser, and synchronize named templates with an Express middleware. The graph preserves local drafts separately from server files and includes documented interface capabilities. The UI’s synchronization and PDF flow are supported by sampled source; some ancillary UI details are documented in the README but not individually sampled.

Main entry points: [`src/main.js`](https://github.com/acmepy/report-make/blob/main/src/main.js) (Editor and workspace), [`src/templates.js`](https://github.com/acmepy/report-make/blob/main/src/templates.js) (Template actions), [`src/evaluate-template.js`](https://github.com/acmepy/report-make/blob/main/src/evaluate-template.js) (Template evaluation), [`server/index.js`](https://github.com/acmepy/report-make/blob/main/server/index.js) (Template API and middleware)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Template authoring"]
  node_ui["Editor and workspace<br/>[main.js]"]
  node_codeedit["Code, data, variables<br/>[main.js]"]
  node_layout["Theme and panel layout<br/>[main.js]"]
  node_localprefs[("Layout preferences<br/>[main.js]")]
  node_console["Integrated console<br/>[main.js]"]
end

subgraph group_rendering["PDF rendering"]
  node_variablecheck["Variable validation"]
  node_evaluator["Template evaluation"]
  node_formatters["Date and number helpers<br/>[formatters.js]"]
  node_pdfmake["PDFMake generator"]
  node_pdfpreview["PDF preview<br/>[main.js]"]
end

subgraph group_sync["Template synchronization"]
  node_templates["Template actions<br/>[templates.js]"]
  node_naming["Name and ID rules<br/>[template-name.js]"]
  node_localdrafts["Draft storage adapter"]
  node_idb[("IndexedDB drafts")]
end

subgraph group_server["Express middleware"]
  node_api["Template API and middleware<br/>[index.js]"]
  node_templatefiles[("Template JSON files")]
  node_express["Express host"]
end

node_user(("Report designer"))

node_user -->|"edits and acts"| node_ui
node_ui -->|"shows editors"| node_codeedit
node_codeedit -->|"reports changes"| node_templates
node_codeedit -->|"provides inputs"| node_evaluator
node_ui -->|"initializes"| node_templates
node_templates -->|"saves and loads"| node_localdrafts
node_localdrafts -->|"reads and writes"| node_idb
node_templates -->|"fetches templates"| node_api
node_templates -->|"checks names"| node_naming
node_templates -->|"validates variables"| node_variablecheck
node_evaluator -->|"validates variables"| node_variablecheck
node_evaluator -->|"exposes helpers"| node_formatters
node_ui -->|"evaluates template"| node_evaluator
node_ui -->|"creates PDF"| node_pdfmake
node_pdfmake -->|"returns PDF blob"| node_pdfpreview
node_ui -->|"captures console"| node_console
node_ui -->|"persists layout"| node_localprefs
node_api -->|"reads and writes"| node_templatefiles
node_express -->|"mounts middleware"| node_api

click node_ui "https://github.com/acmepy/report-make/blob/main/src/main.js"
click node_codeedit "https://github.com/acmepy/report-make/blob/main/src/main.js"
click node_layout "https://github.com/acmepy/report-make/blob/main/src/main.js"
click node_templates "https://github.com/acmepy/report-make/blob/main/src/templates.js"
click node_naming "https://github.com/acmepy/report-make/blob/main/server/template-name.js"
click node_variablecheck "https://github.com/acmepy/report-make/blob/main/server/template-variables.js"
click node_localdrafts "https://github.com/acmepy/report-make/blob/main/src/template-storage.js"
click node_localprefs "https://github.com/acmepy/report-make/blob/main/src/main.js"
click node_evaluator "https://github.com/acmepy/report-make/blob/main/src/evaluate-template.js"
click node_formatters "https://github.com/acmepy/report-make/blob/main/src/formatters.js"
click node_pdfpreview "https://github.com/acmepy/report-make/blob/main/src/main.js"
click node_console "https://github.com/acmepy/report-make/blob/main/src/main.js"
click node_api "https://github.com/acmepy/report-make/blob/main/server/index.js"

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_ui,node_codeedit,node_layout,node_localprefs,node_console toneBlue
class node_variablecheck,node_evaluator,node_formatters,node_pdfmake,node_pdfpreview toneAmber
class node_templates,node_naming,node_localdrafts,node_idb toneMint
class node_api,node_templatefiles,node_express toneRose
class node_user toneIndigo
```

## Components

### Template authoring

- [Editor and workspace](https://github.com/acmepy/report-make/blob/main/src/main.js): `src/main.js`
- [Code, data, variables](https://github.com/acmepy/report-make/blob/main/src/main.js): `src/main.js`
- [Theme and panel layout](https://github.com/acmepy/report-make/blob/main/src/main.js): `src/main.js`
- [Layout preferences](https://github.com/acmepy/report-make/blob/main/src/main.js): `src/main.js`
- [Integrated console](https://github.com/acmepy/report-make/blob/main/src/main.js): `src/main.js`

### PDF rendering

- [Variable validation](https://github.com/acmepy/report-make/blob/main/server/template-variables.js): `server/template-variables.js`
- [Template evaluation](https://github.com/acmepy/report-make/blob/main/src/evaluate-template.js): `src/evaluate-template.js`
- [Date and number helpers](https://github.com/acmepy/report-make/blob/main/src/formatters.js): `src/formatters.js`
- **PDFMake generator**
- [PDF preview](https://github.com/acmepy/report-make/blob/main/src/main.js): `src/main.js`

### Template synchronization

- [Template actions](https://github.com/acmepy/report-make/blob/main/src/templates.js): `src/templates.js`
- [Name and ID rules](https://github.com/acmepy/report-make/blob/main/server/template-name.js): `server/template-name.js`
- [Draft storage adapter](https://github.com/acmepy/report-make/blob/main/src/template-storage.js): `src/template-storage.js`
- **IndexedDB drafts**

### Express middleware

- [Template API and middleware](https://github.com/acmepy/report-make/blob/main/server/index.js): `server/index.js`
- **Template JSON files**
- **Express host**

### Other components

- **Report designer**

## Connections

- Report designer → Editor and workspace: edits and acts
- Editor and workspace → Code, data, variables: shows editors
- Code, data, variables → Template actions: reports changes
- Code, data, variables → Template evaluation: provides inputs
- Editor and workspace → Template actions: initializes
- Template actions → Draft storage adapter: saves and loads
- Draft storage adapter → IndexedDB drafts: reads and writes
- Template actions → Template API and middleware: fetches templates
- Template actions → Name and ID rules: checks names
- Template actions → Variable validation: validates variables
- Template evaluation → Variable validation: validates variables
- Template evaluation → Date and number helpers: exposes helpers
- Editor and workspace → Template evaluation: evaluates template
- Editor and workspace → PDFMake generator: creates PDF
- PDFMake generator → PDF preview: returns PDF blob
- Editor and workspace → Integrated console: captures console
- Editor and workspace → Layout preferences: persists layout
- Template API and middleware → Template JSON files: reads and writes
- Express host → Template API and middleware: mounts middleware
