# dtnprt/todo.txt architecture

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

- Interactive diagram: https://gitdiagram.com/dtnprt/todo.txt
- Repository: https://github.com/dtnprt/todo.txt

## Overview

todo.txt is a task manager delivered as a browser app, a Tauri desktop app, and a Rust terminal app, all centered on plain todo.txt files. Users enter or select tasks, then parse, filter, edit, and save them; the terminal also exposes scripted commands. Supporting branches cover folder and note files, optional Git/WebDAV sync, encryption and offline caching, backups, and GUI themes. The source index and excerpts establish the listed calls; some unsampled feature wiring is documented in the README, so uncertain links are omitted.

Main entry points: [`web/app.js`](https://github.com/dtnprt/todo.txt/blob/main/web/app.js) (Browser app), [`cli/src/main.rs`](https://github.com/dtnprt/todo.txt/blob/main/cli/src/main.rs) (Todo CLI), [`cli/src/tui.rs`](https://github.com/dtnprt/todo.txt/blob/main/cli/src/tui.rs) (Terminal interface), [`cli/src/store.rs`](https://github.com/dtnprt/todo.txt/blob/main/cli/src/store.rs) (File storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web client"]
  node_webui["Browser app<br/>[app.js]"]
  node_composer["Task composer<br/>[composer.js]"]
  node_webformat["Task format<br/>[todotxt.js]"]
  node_calendar["Date calendar<br/>[calendar.js]"]
  node_webcrypto["Web encryption<br/>[crypt.js]"]
  node_webdavjs["WebDAV client<br/>[webdav.js]"]
  node_paste["Paste handling<br/>[paste.js]"]
  node_android["Android bridge<br/>[android.js]"]
  node_themes["GUI themes"]
end

subgraph group_terminal["Terminal client"]
  node_cli["Todo CLI<br/>[main.rs]"]
  node_tui["Terminal interface<br/>[tui.rs]"]
  node_input["Input handling<br/>[input.rs]"]
  node_list["List and filters<br/>[list.rs]"]
  node_operations["Task operations<br/>[ops.rs]"]
  node_format["Task format<br/>[todotxt.rs]"]
end

subgraph group_storage["Storage and sync"]
  node_folder["Folders and notes<br/>[folder.rs]"]
  node_store["File storage<br/>[store.rs]"]
  node_crypt["Encryption<br/>[crypt.rs]"]
  node_davcache[("WebDAV cache<br/>[davcache.rs]")]
  node_webdav["WebDAV backend<br/>[webdav.rs]"]
  node_git["Git sync<br/>[git.rs]"]
  node_backup["Backup<br/>[backup.rs]"]
end

subgraph group_desktop["Desktop integration"]
  node_desktop["Tauri wrapper<br/>[lib.rs]"]
end

node_user(("User"))

node_user -->|"uses"| node_webui
node_user -->|"runs"| node_cli
node_webui -->|"uses"| node_composer
node_webui -->|"uses"| node_webformat
node_webui -->|"uses"| node_webcrypto
node_webui -->|"uses"| node_webdavjs
node_webui -->|"uses"| node_paste
node_webui -->|"uses"| node_calendar
node_webui -->|"uses"| node_android
node_composer -->|"parses tasks"| node_webformat
node_composer -->|"builds picker"| node_calendar
node_cli -.->|"launches"| node_tui
node_cli -->|"uses"| node_format
node_cli -->|"loads and saves"| node_store
node_cli -->|"uses"| node_folder
node_cli -->|"syncs with"| node_git
node_cli -->|"backs up"| node_backup
node_tui -->|"loads"| node_store
node_tui -->|"starts sync"| node_git
node_tui -->|"switches folders"| node_folder
node_tui -->|"handles input"| node_input
node_tui -->|"renders list"| node_list
node_store -->|"decrypts files"| node_crypt
node_store -->|"reads and writes"| node_davcache
node_store -->|"selects server"| node_webdav
node_davcache -->|"fetches and uploads"| node_webdav
node_folder -->|"resolves storage"| node_store
node_folder -->|"reads remote notes"| node_webdav
node_folder -->|"uses encryption"| node_crypt
node_desktop -->|"hosts app"| node_webui
node_webui -->|"invokes native commands"| node_desktop
node_webui -->|"offers themes"| node_themes

click node_webui "https://github.com/dtnprt/todo.txt/blob/main/web/app.js"
click node_composer "https://github.com/dtnprt/todo.txt/blob/main/web/composer.js"
click node_webformat "https://github.com/dtnprt/todo.txt/blob/main/web/todotxt.js"
click node_calendar "https://github.com/dtnprt/todo.txt/blob/main/web/calendar.js"
click node_webcrypto "https://github.com/dtnprt/todo.txt/blob/main/web/crypt.js"
click node_webdavjs "https://github.com/dtnprt/todo.txt/blob/main/web/webdav.js"
click node_paste "https://github.com/dtnprt/todo.txt/blob/main/web/paste.js"
click node_android "https://github.com/dtnprt/todo.txt/blob/main/web/android.js"
click node_themes "https://github.com/dtnprt/todo.txt/tree/main/themes"
click node_cli "https://github.com/dtnprt/todo.txt/blob/main/cli/src/main.rs"
click node_tui "https://github.com/dtnprt/todo.txt/blob/main/cli/src/tui.rs"
click node_input "https://github.com/dtnprt/todo.txt/blob/main/cli/src/input.rs"
click node_list "https://github.com/dtnprt/todo.txt/blob/main/cli/src/list.rs"
click node_operations "https://github.com/dtnprt/todo.txt/blob/main/cli/src/ops.rs"
click node_format "https://github.com/dtnprt/todo.txt/blob/main/cli/src/todotxt.rs"
click node_folder "https://github.com/dtnprt/todo.txt/blob/main/cli/src/folder.rs"
click node_store "https://github.com/dtnprt/todo.txt/blob/main/cli/src/store.rs"
click node_crypt "https://github.com/dtnprt/todo.txt/blob/main/cli/src/crypt.rs"
click node_davcache "https://github.com/dtnprt/todo.txt/blob/main/cli/src/davcache.rs"
click node_webdav "https://github.com/dtnprt/todo.txt/blob/main/cli/src/webdav.rs"
click node_git "https://github.com/dtnprt/todo.txt/blob/main/cli/src/git.rs"
click node_backup "https://github.com/dtnprt/todo.txt/blob/main/cli/src/backup.rs"
click node_desktop "https://github.com/dtnprt/todo.txt/blob/main/src-tauri/src/lib.rs"

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_webui,node_composer,node_webformat,node_calendar,node_webcrypto,node_webdavjs,node_paste,node_android,node_themes,node_user toneBlue
class node_cli,node_tui,node_input,node_list,node_operations,node_format toneAmber
class node_folder,node_store,node_crypt,node_davcache,node_webdav,node_git,node_backup toneMint
class node_desktop toneRose
```

## Components

### Web client

- [Browser app](https://github.com/dtnprt/todo.txt/blob/main/web/app.js): `web/app.js`
- [Task composer](https://github.com/dtnprt/todo.txt/blob/main/web/composer.js): `web/composer.js`
- [Task format](https://github.com/dtnprt/todo.txt/blob/main/web/todotxt.js): `web/todotxt.js`
- [Date calendar](https://github.com/dtnprt/todo.txt/blob/main/web/calendar.js): `web/calendar.js`
- [Web encryption](https://github.com/dtnprt/todo.txt/blob/main/web/crypt.js): `web/crypt.js`
- [WebDAV client](https://github.com/dtnprt/todo.txt/blob/main/web/webdav.js): `web/webdav.js`
- [Paste handling](https://github.com/dtnprt/todo.txt/blob/main/web/paste.js): `web/paste.js`
- [Android bridge](https://github.com/dtnprt/todo.txt/blob/main/web/android.js): `web/android.js`
- [GUI themes](https://github.com/dtnprt/todo.txt/tree/main/themes): `themes`

### Terminal client

- [Todo CLI](https://github.com/dtnprt/todo.txt/blob/main/cli/src/main.rs): `cli/src/main.rs`
- [Terminal interface](https://github.com/dtnprt/todo.txt/blob/main/cli/src/tui.rs): `cli/src/tui.rs`
- [Input handling](https://github.com/dtnprt/todo.txt/blob/main/cli/src/input.rs): `cli/src/input.rs`
- [List and filters](https://github.com/dtnprt/todo.txt/blob/main/cli/src/list.rs): `cli/src/list.rs`
- [Task operations](https://github.com/dtnprt/todo.txt/blob/main/cli/src/ops.rs): `cli/src/ops.rs`
- [Task format](https://github.com/dtnprt/todo.txt/blob/main/cli/src/todotxt.rs): `cli/src/todotxt.rs`

### Storage and sync

- [Folders and notes](https://github.com/dtnprt/todo.txt/blob/main/cli/src/folder.rs): `cli/src/folder.rs`
- [File storage](https://github.com/dtnprt/todo.txt/blob/main/cli/src/store.rs): `cli/src/store.rs`
- [Encryption](https://github.com/dtnprt/todo.txt/blob/main/cli/src/crypt.rs): `cli/src/crypt.rs`
- [WebDAV cache](https://github.com/dtnprt/todo.txt/blob/main/cli/src/davcache.rs): `cli/src/davcache.rs`
- [WebDAV backend](https://github.com/dtnprt/todo.txt/blob/main/cli/src/webdav.rs): `cli/src/webdav.rs`
- [Git sync](https://github.com/dtnprt/todo.txt/blob/main/cli/src/git.rs): `cli/src/git.rs`
- [Backup](https://github.com/dtnprt/todo.txt/blob/main/cli/src/backup.rs): `cli/src/backup.rs`

### Desktop integration

- [Tauri wrapper](https://github.com/dtnprt/todo.txt/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`

### Other components

- **User**

## Connections

- User → Browser app: uses (evidence: `README.md`)
- User → Todo CLI: runs (evidence: `README.md`)
- Browser app → Task composer: uses (evidence: `web/app.js`)
- Browser app → Task format: uses (evidence: `web/app.js`)
- Browser app → Web encryption: uses (evidence: `web/app.js`)
- Browser app → WebDAV client: uses (evidence: `web/app.js`)
- Browser app → Paste handling: uses (evidence: `web/app.js`)
- Browser app → Date calendar: uses (evidence: `web/app.js`)
- Browser app → Android bridge: uses (evidence: `web/app.js`)
- Task composer → Task format: parses tasks (evidence: `web/composer.js`)
- Task composer → Date calendar: builds picker (evidence: `web/composer.js`)
- Todo CLI → Terminal interface: launches (evidence: `cli/src/main.rs`)
- Todo CLI → Task format: uses (evidence: `cli/src/main.rs`)
- Todo CLI → File storage: loads and saves (evidence: `cli/src/main.rs`)
- Todo CLI → Folders and notes: uses (evidence: `cli/src/main.rs`)
- Todo CLI → Git sync: syncs with (evidence: `cli/src/main.rs`)
- Todo CLI → Backup: backs up (evidence: `cli/src/main.rs`)
- Terminal interface → File storage: loads (evidence: `cli/src/tui.rs`)
- Terminal interface → Git sync: starts sync (evidence: `cli/src/tui.rs`)
- Terminal interface → Folders and notes: switches folders (evidence: `cli/src/tui.rs`)
- Terminal interface → Input handling: handles input (evidence: `cli/src/tui.rs`)
- Terminal interface → List and filters: renders list (evidence: `cli/src/tui.rs`)
- File storage → Encryption: decrypts files (evidence: `cli/src/store.rs`)
- File storage → WebDAV cache: reads and writes (evidence: `cli/src/store.rs`)
- File storage → WebDAV backend: selects server (evidence: `cli/src/store.rs`)
- WebDAV cache → WebDAV backend: fetches and uploads (evidence: `cli/src/davcache.rs`)
- Folders and notes → File storage: resolves storage (evidence: `cli/src/folder.rs`)
- Folders and notes → WebDAV backend: reads remote notes (evidence: `cli/src/folder.rs`)
- Folders and notes → Encryption: uses encryption (evidence: `cli/src/folder.rs`)
- Tauri wrapper → Browser app: hosts app (evidence: `README.md`)
- Browser app → Tauri wrapper: invokes native commands (evidence: `web/app.js`)
- Browser app → GUI themes: offers themes (evidence: `README.md`)
