# zaloog/kanban-tui architecture

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

- Interactive diagram: https://gitdiagram.com/zaloog/kanban-tui
- Repository: https://github.com/zaloog/kanban-tui

## Overview

#### Purpose and entry points
`kanban-tui` is a Python terminal Kanban/task manager built on Textual. It supports an interactive TUI, automation-oriented CLI commands, optional browser serving, and an optional local MCP server. The application bootstrap is `src/kanban_tui/app.py`; command surfaces are organized in `src/kanban_tui/cli/`, notably `general_commands.py` and `mcp_commands.py`.

#### Application shell and presentation
The Textual app owns screen navigation, keyboard/mouse interactions, backend selection, and lifecycle. Board and overview views are distinct presentation stages, while modal screens capture mutations such as task, board, category, authentication, and settings edits.
Paths: `src/kanban_tui/app.py`, `src/kanban_tui/screens/board_screen.py`, `src/kanban_tui/screens/overview_screen.py`.

#### Domain model and workflow rules
Core entities are boards, columns, tasks, categories, and audit events. Boards define workflow columns and special reset/start/finish columns; task movement and dependency constraints are domain-level behavior. SQLite persists task dependency edges and audit history.
Paths: `src/kanban_tui/classes/board.py`, `src/kanban_tui/classes/task.py`, `src/kanban_tui/classes/column.py`.

#### Backend abstraction and selection boundary
All interfaces operate through a backend layer rather than directly against storage or remote systems. The base/auth modules define the common boundary; backend implementations provide different capability sets. This isolates TUI and CLI behavior from SQLite persistence, Jira synchronization/querying, and Claude task-file ingestion.
Paths: `src/kanban_tui/backends/base.py`, `src/kanban_tui/backends/auth.py`, `src/kanban_tui/backends/__init__.py`.

#### Local persistence and migrations
SQLite is the default, full-featured backend. Its database layer owns schema initialization and version migration; the backend maps application operations to database operations. Persistent locations are configured through XDG-oriented settings, separating user configuration from data/database storage.
Paths: `src/kanban_tui/backends/sqlite/database.py`, `src/kanban_tui/backends/sqlite/backend.py`, `src/kanban_tui/backends/sqlite/migrations/migration_v0_19_0.sql`.

#### External backend integrations
The Jira backend authenticates to a Jira instance and obtains tasks via its API/JQL; Jira transitions define columns. The Claude backend reads task JSON under the user’s Claude task directory and organizes boards by session ID. These are read/remote-system boundaries with more limited feature support than SQLite.
Paths: `src/kanban_tui/backends/jira/backend.py`, `src/kanban_tui/backends/jira/jira_api.py`, `src/kanban_tui/backends/claude/backend.py`.

#### Automation interfaces and flow
CLI command groups perform task, board, column, category, demo, skills, and general operations through the same application/backend concepts. MCP optionally exposes the task/board/column CLI capabilities to agent clients via `pycli-mcp`; skill-file management supports agent discovery. Typical flow is command or UI event → backend operation → model/persistence or external backend → refreshed screen/widget state.
Paths: `src/kanban_tui/cli/task_commands.py`, `src/kanban_tui/cli/board_commands.py`, `src/kanban_tui/skills.py`.

#### Runtime and infrastructure
Primary runtime is Python with Textual; styling is TCSS. Optional `textual-serve` enables web delivery, while plotext/textual-plotext power overview charts. Configuration uses pydantic-settings and XDG base directories. Development automation is GitHub Actions CI and Docker Compose is present for local infrastructure.
Paths: `src/kanban_tui/assets/style.tcss`, `src/kanban_tui/config.py`, `.github/workflows/ci.yaml`.

Main entry points: [`src/kanban_tui/backends/base.py`](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/base.py) (Backend abstraction), [`src/kanban_tui/app.py`](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/app.py) (Textual TUI shell), [`src/kanban_tui/classes/board.py`](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/board.py) (Kanban domain), [`src/kanban_tui/backends/sqlite/backend.py`](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/backend.py) (SQLite backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User &amp; automation"]
  node_tui["Textual TUI shell<br/>interactive app<br/>[app.py]"]
  node_board_view["Board view<br/>screen<br/>[board_screen.py]"]
  node_overview_view["Overview view<br/>screen<br/>[overview_screen.py]"]
  node_cli["Automation CLI<br/>command groups<br/>[task_commands.py]"]
  node_mcp["MCP server commands<br/>agent interface<br/>[mcp_commands.py]"]
  node_skills["Skill-file management<br/>agent discovery<br/>[skills.py]"]
end

subgraph group_application["Application core"]
  node_backend_boundary{{"Backend abstraction<br/>service boundary<br/>[base.py]"}}
  node_backend_registry["Backend selection<br/>backend registry<br/>[__init__.py]"]
  node_domain["Kanban domain<br/>models &amp; rules<br/>[board.py]"]
  node_task_model["Task model<br/>domain entity<br/>[task.py]"]
  node_column_model["Column model<br/>domain entity<br/>[column.py]"]
end

subgraph group_backends["Backend implementations"]
  node_sqlite_backend["SQLite backend<br/>full-featured backend<br/>[backend.py]"]
  node_sqlite_database[("SQLite database layer<br/>persistence<br/>[database.py]")]
  node_migration["Schema migration<br/>SQL migration"]
  node_jira_backend["Jira backend<br/>remote backend<br/>[backend.py]"]
  node_jira_api{{"Jira API / JQL<br/>external API client<br/>[jira_api.py]"}}
  node_claude_backend["Claude task backend<br/>file-backed integration<br/>[backend.py]"]
end

subgraph group_runtime["Runtime &amp; delivery"]
  node_config["XDG settings<br/>configuration<br/>[config.py]"]
  node_styling["TCSS styling<br/>presentation assets<br/>[style.tcss]"]
  node_ci["GitHub Actions CI<br/>development automation<br/>[ci.yaml]"]
end

node_tui -->|"navigates to"| node_board_view
node_tui -->|"navigates to"| node_overview_view
node_tui -->|"selects backend"| node_backend_registry
node_tui -->|"loads"| node_styling
node_board_view -->|"reads and mutates through"| node_backend_boundary
node_overview_view -->|"reads through"| node_backend_boundary
node_cli -->|"operates through"| node_backend_boundary
node_mcp -->|"exposes capabilities from"| node_cli
node_skills -.->|"supports agent discovery"| node_mcp
node_backend_registry -->|"provides implementations for"| node_backend_boundary
node_backend_boundary -->|"implemented by"| node_sqlite_backend
node_backend_boundary -->|"implemented by"| node_jira_backend
node_backend_boundary -->|"implemented by"| node_claude_backend
node_sqlite_backend -->|"maps operations to"| node_domain
node_sqlite_backend -->|"persists via"| node_sqlite_database
node_sqlite_database -->|"applies"| node_migration
node_sqlite_backend -.->|"uses data location"| node_config
node_domain -->|"includes"| node_task_model
node_domain -->|"includes"| node_column_model
node_jira_backend -->|"queries through"| node_jira_api
node_jira_backend -->|"maps remote tasks to"| node_domain
node_claude_backend -->|"maps task JSON to"| node_domain
node_tui -.->|"loads settings"| node_config

click node_tui "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/app.py"
click node_board_view "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/screens/board_screen.py"
click node_overview_view "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/screens/overview_screen.py"
click node_cli "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/cli/task_commands.py"
click node_mcp "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/cli/mcp_commands.py"
click node_skills "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/skills.py"
click node_backend_boundary "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/base.py"
click node_backend_registry "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/__init__.py"
click node_domain "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/board.py"
click node_task_model "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/task.py"
click node_column_model "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/column.py"
click node_sqlite_backend "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/backend.py"
click node_sqlite_database "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/database.py"
click node_migration "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/migrations/migration_v0_19_0.sql"
click node_jira_backend "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/jira/backend.py"
click node_jira_api "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/jira/jira_api.py"
click node_claude_backend "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/claude/backend.py"
click node_config "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/config.py"
click node_styling "https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/assets/style.tcss"
click node_ci "https://github.com/zaloog/kanban-tui/blob/main/.github/workflows/ci.yaml"

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_tui,node_board_view,node_overview_view,node_cli,node_mcp,node_skills toneBlue
class node_backend_boundary,node_backend_registry,node_domain,node_task_model,node_column_model toneAmber
class node_sqlite_backend,node_sqlite_database,node_migration,node_jira_backend,node_jira_api,node_claude_backend toneMint
class node_config,node_styling,node_ci toneRose
```

## Components

### User & automation

- [Textual TUI shell](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/app.py): interactive app · Owns navigation, input, backend selection, and lifecycle. · `src/kanban_tui/app.py`
- [Board view](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/screens/board_screen.py): screen · `src/kanban_tui/screens/board_screen.py`
- [Overview view](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/screens/overview_screen.py): screen · Presents board overview and charts. · `src/kanban_tui/screens/overview_screen.py`
- [Automation CLI](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/cli/task_commands.py): command groups · Task, board, column, category, demo, skills, and general operations. · `src/kanban_tui/cli/task_commands.py`
- [MCP server commands](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/cli/mcp_commands.py): agent interface · Optionally exposes CLI task, board, and column capabilities. · `src/kanban_tui/cli/mcp_commands.py`
- [Skill-file management](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/skills.py): agent discovery · `src/kanban_tui/skills.py`

### Application core

- [Backend abstraction](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/base.py): service boundary · Common interface and authentication boundary for all clients. · `src/kanban_tui/backends/base.py`
- [Backend selection](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/__init__.py): backend registry · `src/kanban_tui/backends/__init__.py`
- [Kanban domain](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/board.py): models & rules · Boards, columns, tasks, categories, workflow movement, and dependencies. · `src/kanban_tui/classes/board.py`
- [Task model](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/task.py): domain entity · Encodes task behavior and dependency constraints. · `src/kanban_tui/classes/task.py`
- [Column model](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/classes/column.py): domain entity · Defines workflow column semantics. · `src/kanban_tui/classes/column.py`

### Backend implementations

- [SQLite backend](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/backend.py): full-featured backend · Maps application operations to local database operations. · `src/kanban_tui/backends/sqlite/backend.py`
- [SQLite database layer](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/database.py): persistence · Owns schema initialization, migrations, dependencies, and audit history. · `src/kanban_tui/backends/sqlite/database.py`
- [Schema migration](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/sqlite/migrations/migration_v0_19_0.sql): SQL migration · `src/kanban_tui/backends/sqlite/migrations/migration_v0_19_0.sql`
- [Jira backend](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/jira/backend.py): remote backend · Provides limited-feature Jira task and transition access. · `src/kanban_tui/backends/jira/backend.py`
- [Jira API / JQL](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/jira/jira_api.py): external API client · Authenticates and queries Jira; transitions become columns. · `src/kanban_tui/backends/jira/jira_api.py`
- [Claude task backend](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/backends/claude/backend.py): file-backed integration · Reads Claude task JSON and groups boards by session ID. · `src/kanban_tui/backends/claude/backend.py`

### Runtime & delivery

- [XDG settings](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/config.py): configuration · Separates user configuration from data and database locations. · `src/kanban_tui/config.py`
- [TCSS styling](https://github.com/zaloog/kanban-tui/blob/main/src/kanban_tui/assets/style.tcss): presentation assets · `src/kanban_tui/assets/style.tcss`
- [GitHub Actions CI](https://github.com/zaloog/kanban-tui/blob/main/.github/workflows/ci.yaml): development automation · `.github/workflows/ci.yaml`

## Connections

- Textual TUI shell → Board view: navigates to
- Textual TUI shell → Overview view: navigates to
- Textual TUI shell → Backend selection: selects backend
- Textual TUI shell → TCSS styling: loads
- Board view → Backend abstraction: reads and mutates through
- Overview view → Backend abstraction: reads through
- Automation CLI → Backend abstraction: operates through
- MCP server commands → Automation CLI: exposes capabilities from
- Skill-file management → MCP server commands: supports agent discovery
- Backend selection → Backend abstraction: provides implementations for
- Backend abstraction → SQLite backend: implemented by
- Backend abstraction → Jira backend: implemented by
- Backend abstraction → Claude task backend: implemented by
- SQLite backend → Kanban domain: maps operations to
- SQLite backend → SQLite database layer: persists via
- SQLite database layer → Schema migration: applies
- SQLite backend → XDG settings: uses data location
- Kanban domain → Task model: includes
- Kanban domain → Column model: includes
- Jira backend → Jira API / JQL: queries through
- Jira backend → Kanban domain: maps remote tasks to
- Claude task backend → Kanban domain: maps task JSON to
- Textual TUI shell → XDG settings: loads settings
