# substance/texture architecture

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

- Interactive diagram: https://gitdiagram.com/substance/texture
- Repository: https://github.com/substance/texture

## Overview

Texture is a structured scientific-content editor: users open a manuscript in a DAR archive, edit its article content and metadata, then save the changes. Its main product areas are the web/desktop application shell, article editing and conversion, the shared editor/model toolkit, and DAR archive persistence. The README documents the JATS/DAR formats and save workflow; source-index references and excerpts establish only some code-level links, so other plausible connections are omitted or marked unverified.

Main entry points: [`src/article/ArticlePanel.js`](https://github.com/substance/texture/blob/master/src/article/ArticlePanel.js) (Article editor panel), [`src/article/nodes/Article.js`](https://github.com/substance/texture/blob/master/src/article/nodes/Article.js) (Article model), [`src/dar/DarFileStorage.js`](https://github.com/substance/texture/blob/master/src/dar/DarFileStorage.js) (DAR file storage), [`src/TextureArchive.js`](https://github.com/substance/texture/blob/master/src/TextureArchive.js) (Texture archive)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_webapp["Web application<br/>[TextureWebApp.js]"]
  node_desktopapp["Desktop application"]
  node_chrome["App chrome"]
  node_texture["Texture editor<br/>[Texture.js]"]
end

subgraph group_article["Article authoring"]
  node_articlepkg["Article package<br/>[ArticlePackage.js]"]
  node_articlepanel["Article editor panel<br/>[ArticlePanel.js]"]
  node_articlemodel["Article model<br/>[Article.js]"]
  node_metadata["Metadata editing<br/>[MetadataPackage.js]"]
  node_commands["Editing commands"]
  node_jats["JATS conversion"]
  node_html["HTML conversion"]
  node_citations["Citation labels"]
end

subgraph group_kit["Editor toolkit"]
  node_kitui["Editor UI components"]
  node_kitmodel["Property models"]
end

subgraph group_storage["Archive persistence"]
  node_persistence["Save integration"]
  node_archive["Texture archive<br/>[TextureArchive.js]"]
  node_darfile["DAR file storage<br/>[DarFileStorage.js]"]
  node_fsstorage["Filesystem storage<br/>[FSStorage.js]"]
  node_archiveio["Archive readers/writers<br/>[readArchive.js]"]
  node_darformat[("DAR archive")]
end

node_author(("Author"))

node_author -.->|"opens editor"| node_webapp
node_author -.->|"opens editor"| node_desktopapp
node_texture -->|"registers plugin"| node_articlepkg
node_texture -.->|"renders article"| node_articlepanel
node_articlepkg -.->|"configures editor"| node_articlepanel
node_articlepanel -.->|"edits document"| node_articlemodel
node_articlepanel -.->|"edits metadata"| node_metadata
node_articlepanel -.->|"dispatches edits"| node_commands
node_articlemodel -.->|"converts to JATS"| node_jats
node_articlemodel -.->|"exports HTML"| node_html
node_articlepanel -.->|"updates labels"| node_citations
node_articlepanel -.->|"uses components"| node_kitui
node_articlemodel -.->|"models properties"| node_kitmodel
node_chrome -.->|"loads archive"| node_archive
node_persistence -.->|"saves changes"| node_archive
node_archive -.->|"uses storage"| node_darfile
node_darfile -->|"delegates storage"| node_fsstorage
node_fsstorage -->|"reads and writes"| node_archiveio
node_darfile -->|"packs and unpacks"| node_darformat
node_author -.->|"saves manuscript"| node_darformat

click node_webapp "https://github.com/substance/texture/blob/master/src/TextureWebApp.js"
click node_desktopapp "https://github.com/substance/texture/blob/master/src/TextureDesktopApp.js"
click node_chrome "https://github.com/substance/texture/blob/master/src/TextureAppChrome.js"
click node_texture "https://github.com/substance/texture/blob/master/src/Texture.js"
click node_articlepkg "https://github.com/substance/texture/blob/master/src/article/ArticlePackage.js"
click node_articlepanel "https://github.com/substance/texture/blob/master/src/article/ArticlePanel.js"
click node_articlemodel "https://github.com/substance/texture/blob/master/src/article/nodes/Article.js"
click node_metadata "https://github.com/substance/texture/blob/master/src/article/metadata/MetadataPackage.js"
click node_commands "https://github.com/substance/texture/tree/master/src/article/commands"
click node_jats "https://github.com/substance/texture/tree/master/src/article/converter/jats"
click node_html "https://github.com/substance/texture/tree/master/src/article/converter/html"
click node_citations "https://github.com/substance/texture/blob/master/src/article/shared/AbstractCitationManager.js"
click node_kitui "https://github.com/substance/texture/tree/master/src/kit/ui"
click node_kitmodel "https://github.com/substance/texture/blob/master/src/kit/model/createValueModel.js"
click node_persistence "https://github.com/substance/texture/blob/master/src/shared/PersistencePackage.js"
click node_archive "https://github.com/substance/texture/blob/master/src/TextureArchive.js"
click node_darfile "https://github.com/substance/texture/blob/master/src/dar/DarFileStorage.js"
click node_fsstorage "https://github.com/substance/texture/blob/master/src/dar/FSStorage.js"
click node_archiveio "https://github.com/substance/texture/blob/master/src/dar/readArchive.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_webapp,node_desktopapp,node_chrome,node_texture toneBlue
class node_articlepkg,node_articlepanel,node_articlemodel,node_metadata,node_commands,node_jats,node_html,node_citations toneAmber
class node_kitui,node_kitmodel toneMint
class node_persistence,node_archive,node_darfile,node_fsstorage,node_archiveio,node_darformat toneRose
class node_author toneIndigo
```

## Components

### Application shell

- [Web application](https://github.com/substance/texture/blob/master/src/TextureWebApp.js): `src/TextureWebApp.js`
- [Desktop application](https://github.com/substance/texture/blob/master/src/TextureDesktopApp.js): `src/TextureDesktopApp.js`
- [App chrome](https://github.com/substance/texture/blob/master/src/TextureAppChrome.js): `src/TextureAppChrome.js`
- [Texture editor](https://github.com/substance/texture/blob/master/src/Texture.js): `src/Texture.js`

### Article authoring

- [Article package](https://github.com/substance/texture/blob/master/src/article/ArticlePackage.js): `src/article/ArticlePackage.js`
- [Article editor panel](https://github.com/substance/texture/blob/master/src/article/ArticlePanel.js): `src/article/ArticlePanel.js`
- [Article model](https://github.com/substance/texture/blob/master/src/article/nodes/Article.js): `src/article/nodes/Article.js`
- [Metadata editing](https://github.com/substance/texture/blob/master/src/article/metadata/MetadataPackage.js): `src/article/metadata/MetadataPackage.js`
- [Editing commands](https://github.com/substance/texture/tree/master/src/article/commands): `src/article/commands`
- [JATS conversion](https://github.com/substance/texture/tree/master/src/article/converter/jats): `src/article/converter/jats`
- [HTML conversion](https://github.com/substance/texture/tree/master/src/article/converter/html): `src/article/converter/html`
- [Citation labels](https://github.com/substance/texture/blob/master/src/article/shared/AbstractCitationManager.js): `src/article/shared/AbstractCitationManager.js`

### Editor toolkit

- [Editor UI components](https://github.com/substance/texture/tree/master/src/kit/ui): `src/kit/ui`
- [Property models](https://github.com/substance/texture/blob/master/src/kit/model/createValueModel.js): `src/kit/model/createValueModel.js`

### Archive persistence

- [Save integration](https://github.com/substance/texture/blob/master/src/shared/PersistencePackage.js): `src/shared/PersistencePackage.js`
- [Texture archive](https://github.com/substance/texture/blob/master/src/TextureArchive.js): `src/TextureArchive.js`
- [DAR file storage](https://github.com/substance/texture/blob/master/src/dar/DarFileStorage.js): `src/dar/DarFileStorage.js`
- [Filesystem storage](https://github.com/substance/texture/blob/master/src/dar/FSStorage.js): `src/dar/FSStorage.js`
- [Archive readers/writers](https://github.com/substance/texture/blob/master/src/dar/readArchive.js): `src/dar/readArchive.js`
- **DAR archive**

### Other components

- **Author**

## Connections

- Author → Web application: opens editor
- Author → Desktop application: opens editor
- Texture editor → Article package: registers plugin (evidence: `src/Texture.js`)
- Texture editor → Article editor panel: renders article
- Article package → Article editor panel: configures editor
- Article editor panel → Article model: edits document
- Article editor panel → Metadata editing: edits metadata
- Article editor panel → Editing commands: dispatches edits
- Article model → JATS conversion: converts to JATS
- Article model → HTML conversion: exports HTML
- Article editor panel → Citation labels: updates labels
- Article editor panel → Editor UI components: uses components
- Article model → Property models: models properties
- App chrome → Texture archive: loads archive
- Save integration → Texture archive: saves changes
- Texture archive → DAR file storage: uses storage
- DAR file storage → Filesystem storage: delegates storage (evidence: `src/dar/DarFileStorage.js`)
- Filesystem storage → Archive readers/writers: reads and writes (evidence: `src/dar/FSStorage.js`)
- DAR file storage → DAR archive: packs and unpacks (evidence: `src/dar/DarFileStorage.js`)
- Author → DAR archive: saves manuscript
