# joaojotta/jotta-text architecture

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

- Interactive diagram: https://gitdiagram.com/joaojotta/jotta-text
- Repository: https://github.com/joaojotta/jotta-text

## Overview

Jotta Text is a Lite XL-based editor for code, Markdown, and web projects, with desktop and browser editions. The main workflow is to open a file or folder, edit it with language-aware tools, then preview or export the result; workspace recovery and visual tools support that work. The browser edition has a visible app/files/preview/worker structure, and GitHub sync is an optional trial. Desktop Lua subsystems are identified from the tree and README capabilities; their internal call relationships were not sampled, so the graph avoids asserting them.

Main entry points: [`profile/init.lua`](https://github.com/joaojotta/jotta-text/blob/main/profile/init.lua) (Jotta Text editor), [`web/app.mjs`](https://github.com/joaojotta/jotta-text/blob/main/web/app.mjs) (Browser editor app), [`profile/litefront/web_preview.lua`](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/web_preview.lua) (Desktop web preview), [`web/worker.mjs`](https://github.com/joaojotta/jotta-text/blob/main/web/worker.mjs) (Browser worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editing["Editing and language tools"]
  node_desktop["Jotta Text editor<br/>[init.lua]"]
  node_language["Language support"]
  node_completion["Completion context"]
  node_formatter["Prettier integration"]
end

subgraph group_authoring["Preview and authoring"]
  node_markdown["Markdown tools<br/>[markdown.lua]"]
  node_webpreview["Desktop web preview<br/>[web_preview.lua]"]
  node_previewserver["Preview server<br/>[preview.mjs]"]
  node_pdf["Markdown PDF export<br/>[markdown-pdf.mjs]"]
end

subgraph group_workspace["Workspace and interface"]
  node_session[("Workspace recovery<br/>[session.lua]")]
  node_explorer["File explorer<br/>[browser.lua]"]
  node_outline["Document outline<br/>[outline.lua]"]
  node_appearance["Appearance settings<br/>[settings.lua]"]
end

subgraph group_integrations["Browser and integrations"]
  node_browserapp["Browser editor app<br/>[app.mjs]"]
  node_browserfiles[("Browser workspace files<br/>[files.mjs]")]
  node_browserpreview["Browser HTML preview<br/>[preview.mjs]"]
  node_worker["Browser worker<br/>[worker.mjs]"]
  node_workercore["Format and outline<br/>[worker-core.mjs]"]
  node_github["GitHub trial service<br/>[github-trial.mjs]"]
  node_githubsetup["GitHub setup and sync<br/>[github-setup.mjs]"]
end

node_user(("Editor user"))

node_user -->|"opens and edits"| node_desktop
node_user -->|"opens browser edition"| node_browserapp
node_browserapp -->|"imports files"| node_browserfiles
node_browserapp -->|"builds preview"| node_browserpreview
node_browserapp -->|"dispatches requests"| node_worker
node_worker -->|"runs requests"| node_workercore
node_browserapp -->|"reads workspace"| node_browserfiles
node_desktop -.->|"uses language detection"| node_language
node_desktop -.->|"offers completion"| node_completion
node_desktop -.->|"offers formatting"| node_formatter
node_desktop -.->|"authors Markdown"| node_markdown
node_desktop -.->|"opens live preview"| node_webpreview
node_webpreview -.->|"starts preview"| node_previewserver
node_desktop -.->|"exports PDF"| node_pdf
node_desktop -.->|"restores workspace"| node_session
node_desktop -.->|"opens projects"| node_explorer
node_desktop -.->|"shows outline"| node_outline
node_desktop -.->|"configures appearance"| node_appearance
node_user -.->|"starts optional sync"| node_github
node_github -->|"delegates setup actions"| node_githubsetup

click node_desktop "https://github.com/joaojotta/jotta-text/blob/main/profile/init.lua"
click node_language "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/language_detection.lua"
click node_completion "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/completion_context.lua"
click node_formatter "https://github.com/joaojotta/jotta-text/blob/main/profile/plugins/litefront_prettier.lua"
click node_markdown "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/markdown.lua"
click node_webpreview "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/web_preview.lua"
click node_previewserver "https://github.com/joaojotta/jotta-text/blob/main/tools/preview.mjs"
click node_pdf "https://github.com/joaojotta/jotta-text/blob/main/tools/markdown-pdf.mjs"
click node_session "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/session.lua"
click node_explorer "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/browser.lua"
click node_outline "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/outline.lua"
click node_appearance "https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/settings.lua"
click node_browserapp "https://github.com/joaojotta/jotta-text/blob/main/web/app.mjs"
click node_browserfiles "https://github.com/joaojotta/jotta-text/blob/main/web/files.mjs"
click node_browserpreview "https://github.com/joaojotta/jotta-text/blob/main/web/preview.mjs"
click node_worker "https://github.com/joaojotta/jotta-text/blob/main/web/worker.mjs"
click node_workercore "https://github.com/joaojotta/jotta-text/blob/main/web/worker-core.mjs"
click node_github "https://github.com/joaojotta/jotta-text/blob/main/tools/github-trial.mjs"
click node_githubsetup "https://github.com/joaojotta/jotta-text/blob/main/tools/github-setup.mjs"

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_desktop,node_language,node_completion,node_formatter,node_user toneBlue
class node_markdown,node_webpreview,node_previewserver,node_pdf toneAmber
class node_session,node_explorer,node_outline,node_appearance toneMint
class node_browserapp,node_browserfiles,node_browserpreview,node_worker,node_workercore,node_github,node_githubsetup toneRose
```

## Components

### Editing and language tools

- [Jotta Text editor](https://github.com/joaojotta/jotta-text/blob/main/profile/init.lua): `profile/init.lua`
- [Language support](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/language_detection.lua): `profile/litefront/language_detection.lua`
- [Completion context](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/completion_context.lua): `profile/litefront/completion_context.lua`
- [Prettier integration](https://github.com/joaojotta/jotta-text/blob/main/profile/plugins/litefront_prettier.lua): `profile/plugins/litefront_prettier.lua`

### Preview and authoring

- [Markdown tools](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/markdown.lua): `profile/litefront/markdown.lua`
- [Desktop web preview](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/web_preview.lua): `profile/litefront/web_preview.lua`
- [Preview server](https://github.com/joaojotta/jotta-text/blob/main/tools/preview.mjs): `tools/preview.mjs`
- [Markdown PDF export](https://github.com/joaojotta/jotta-text/blob/main/tools/markdown-pdf.mjs): `tools/markdown-pdf.mjs`

### Workspace and interface

- [Workspace recovery](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/session.lua): `profile/litefront/session.lua`
- [File explorer](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/browser.lua): `profile/litefront/browser.lua`
- [Document outline](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/outline.lua): `profile/litefront/outline.lua`
- [Appearance settings](https://github.com/joaojotta/jotta-text/blob/main/profile/litefront/settings.lua): `profile/litefront/settings.lua`

### Browser and integrations

- [Browser editor app](https://github.com/joaojotta/jotta-text/blob/main/web/app.mjs): `web/app.mjs`
- [Browser workspace files](https://github.com/joaojotta/jotta-text/blob/main/web/files.mjs): `web/files.mjs`
- [Browser HTML preview](https://github.com/joaojotta/jotta-text/blob/main/web/preview.mjs): `web/preview.mjs`
- [Browser worker](https://github.com/joaojotta/jotta-text/blob/main/web/worker.mjs): `web/worker.mjs`
- [Format and outline](https://github.com/joaojotta/jotta-text/blob/main/web/worker-core.mjs): `web/worker-core.mjs`
- [GitHub trial service](https://github.com/joaojotta/jotta-text/blob/main/tools/github-trial.mjs): `tools/github-trial.mjs`
- [GitHub setup and sync](https://github.com/joaojotta/jotta-text/blob/main/tools/github-setup.mjs): `tools/github-setup.mjs`

### Other components

- **Editor user**

## Connections

- Editor user → Jotta Text editor: opens and edits (evidence: `README.md`)
- Editor user → Browser editor app: opens browser edition (evidence: `README.md`)
- Browser editor app → Browser workspace files: imports files (evidence: `web/app.mjs`)
- Browser editor app → Browser HTML preview: builds preview (evidence: `web/app.mjs`)
- Browser editor app → Browser worker: dispatches requests (evidence: `web/app.mjs`)
- Browser worker → Format and outline: runs requests (evidence: `web/worker.mjs`)
- Browser editor app → Browser workspace files: reads workspace (evidence: `web/app.mjs`)
- Jotta Text editor → Language support: uses language detection
- Jotta Text editor → Completion context: offers completion
- Jotta Text editor → Prettier integration: offers formatting
- Jotta Text editor → Markdown tools: authors Markdown
- Jotta Text editor → Desktop web preview: opens live preview
- Desktop web preview → Preview server: starts preview
- Jotta Text editor → Markdown PDF export: exports PDF
- Jotta Text editor → Workspace recovery: restores workspace
- Jotta Text editor → File explorer: opens projects
- Jotta Text editor → Document outline: shows outline
- Jotta Text editor → Appearance settings: configures appearance
- Editor user → GitHub trial service: starts optional sync
- GitHub trial service → GitHub setup and sync: delegates setup actions (evidence: `tools/github-trial.mjs`)
