# brkahmed/taskly architecture

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

- Interactive diagram: https://gitdiagram.com/brkahmed/taskly
- Repository: https://github.com/brkahmed/taskly

## Overview

#### Purpose and Entry Point
Taskly is a local command-line TODO manager. Its primary entry point is `main()` in `taskly.py`, exposed as the `taskly` command through package configuration in `pyproject.toml`. Users invoke subcommands to add, mutate, delete, and query tasks.

#### CLI Command Boundary
`taskly.py` owns argument parsing, command validation, and dispatch. Supported command paths are add, update, mark-in-progress, mark-done, delete, and list. The CLI is the sole application interface; no web server, API, or background worker is indicated.

Paths:
- `taskly.py`
- `pyproject.toml`

#### Persistent Task Store
Tasks are persisted as JSON through `load_database(path)` and `save_database(database, path)`. Commands follow a read-modify-write lifecycle: load the database, apply an operation to the in-memory task collection, then save changes. This file-backed store is the primary state boundary and supports local, single-user operation.

Paths:
- `taskly.py`

#### Task Creation and Identity
`add_task(database, description)` creates task records with a unique ID and an initial `todo` status. Task identity is subsequently used by all mutation and deletion commands; descriptions and status are the main mutable fields.

Paths:
- `taskly.py`

#### Task Mutation Workflows
`update_task` can change description and/or status, while `mark_in_progress_task` and `mark_done_task` provide focused status-transition commands. These operations share the task-ID lookup boundary and operate on the loaded in-memory database before persistence.

Paths:
- `taskly.py`

#### Deletion and Querying
`delete_task` removes a task by ID. `list_task` is the read/query path: it displays all tasks or filters them by status (`todo`, `in-progress`, `done`, `all`) and creation-date comparisons (`<`, `>`, `=`). Listing reads stored state without requiring a mutation workflow.

Paths:
- `taskly.py`

#### Runtime and Validation
The project is Python-based, with runtime and packaging/dependency metadata in `pyproject.toml` and `requirements.txt`. `test_taskly.py` exercises the core behavior using pytest. The repository indicates no external database, cloud service, or network dependency; persistence is local JSON storage.

Paths:
- `pyproject.toml`
- `requirements.txt`
- `test_taskly.py`

Main entry points: [`taskly.py`](https://github.com/brkahmed/taskly/blob/main/taskly.py) (main() CLI), [`pyproject.toml`](https://github.com/brkahmed/taskly/blob/main/pyproject.toml) (Package command), [`requirements.txt`](https://github.com/brkahmed/taskly/blob/main/requirements.txt) (Python runtime metadata), [`test_taskly.py`](https://github.com/brkahmed/taskly/blob/main/test_taskly.py) (Pytest coverage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI Application"]
  node_package["Package command<br/>Python packaging<br/>[pyproject.toml]"]
  node_cli_entry["main&#40;&#41; CLI<br/>command dispatcher<br/>[taskly.py]"]
end

subgraph group_domain["Task Operations"]
  node_add["Add task<br/>creation operation<br/>[taskly.py]"]
  node_update["Update task<br/>mutation operation<br/>[taskly.py]"]
  node_status_commands["Status transitions<br/>mutation operations<br/>[taskly.py]"]
  node_delete["Delete task<br/>deletion operation<br/>[taskly.py]"]
  node_list["List tasks<br/>query operation<br/>[taskly.py]"]
  node_task_collection[("In-memory tasks<br/>task collection<br/>[taskly.py]")]
end

subgraph group_storage["Local Persistence"]
  node_load["load_database&#40;&#41;<br/>JSON reader<br/>[taskly.py]"]
  node_save["save_database&#40;&#41;<br/>JSON writer<br/>[taskly.py]"]
  node_json_store[("Local JSON database<br/>file-backed state<br/>[taskly.py]")]
end

node_runtime["Python runtime metadata<br/>runtime dependencies<br/>[requirements.txt]"]
node_tests["Pytest coverage<br/>test suite<br/>[test_taskly.py]"]

node_package -->|"exposes command"| node_cli_entry
node_runtime -.->|"runs"| node_cli_entry
node_cli_entry -->|"loads state"| node_load
node_load -->|"reads JSON"| node_json_store
node_load -->|"hydrates"| node_task_collection
node_cli_entry -->|"dispatches add"| node_add
node_cli_entry -->|"dispatches update"| node_update
node_cli_entry -->|"dispatches status commands"| node_status_commands
node_cli_entry -->|"dispatches delete"| node_delete
node_cli_entry -->|"dispatches list"| node_list
node_add -->|"adds record"| node_task_collection
node_update -->|"mutates by ID"| node_task_collection
node_status_commands -->|"updates status by ID"| node_task_collection
node_delete -->|"removes by ID"| node_task_collection
node_list -->|"queries and filters"| node_task_collection
node_task_collection -->|"persists mutations"| node_save
node_save -->|"writes JSON"| node_json_store
node_tests -.->|"tests core behavior"| node_cli_entry

click node_package "https://github.com/brkahmed/taskly/blob/main/pyproject.toml"
click node_cli_entry "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_add "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_update "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_status_commands "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_delete "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_list "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_task_collection "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_load "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_save "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_json_store "https://github.com/brkahmed/taskly/blob/main/taskly.py"
click node_runtime "https://github.com/brkahmed/taskly/blob/main/requirements.txt"
click node_tests "https://github.com/brkahmed/taskly/blob/main/test_taskly.py"

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_package,node_cli_entry toneBlue
class node_add,node_update,node_status_commands,node_delete,node_list,node_task_collection toneAmber
class node_load,node_save,node_json_store toneMint
class node_runtime,node_tests toneNeutral
```

## Components

### CLI Application

- [Package command](https://github.com/brkahmed/taskly/blob/main/pyproject.toml): Python packaging · Exposes the taskly command. · `pyproject.toml`
- [main() CLI](https://github.com/brkahmed/taskly/blob/main/taskly.py): command dispatcher · Parses, validates, and dispatches subcommands. · `taskly.py`

### Task Operations

- [Add task](https://github.com/brkahmed/taskly/blob/main/taskly.py): creation operation · Creates a uniquely identified todo task. · `taskly.py`
- [Update task](https://github.com/brkahmed/taskly/blob/main/taskly.py): mutation operation · Changes a task description and/or status by ID. · `taskly.py`
- [Status transitions](https://github.com/brkahmed/taskly/blob/main/taskly.py): mutation operations · Marks tasks in progress or done by ID. · `taskly.py`
- [Delete task](https://github.com/brkahmed/taskly/blob/main/taskly.py): deletion operation · Removes a task by ID. · `taskly.py`
- [List tasks](https://github.com/brkahmed/taskly/blob/main/taskly.py): query operation · Filters tasks by status or creation-date comparison. · `taskly.py`
- [In-memory tasks](https://github.com/brkahmed/taskly/blob/main/taskly.py): task collection · Loaded task records used by command operations. · `taskly.py`

### Local Persistence

- [load_database()](https://github.com/brkahmed/taskly/blob/main/taskly.py): JSON reader · `taskly.py`
- [save_database()](https://github.com/brkahmed/taskly/blob/main/taskly.py): JSON writer · `taskly.py`
- [Local JSON database](https://github.com/brkahmed/taskly/blob/main/taskly.py): file-backed state · Single-user persistent task store. · `taskly.py`

### Other components

- [Python runtime metadata](https://github.com/brkahmed/taskly/blob/main/requirements.txt): runtime dependencies · `requirements.txt`
- [Pytest coverage](https://github.com/brkahmed/taskly/blob/main/test_taskly.py): test suite · Exercises core task behavior. · `test_taskly.py`

## Connections

- Package command → main() CLI: exposes command
- Python runtime metadata → main() CLI: runs
- main() CLI → load_database(): loads state
- load_database() → Local JSON database: reads JSON
- load_database() → In-memory tasks: hydrates
- main() CLI → Add task: dispatches add
- main() CLI → Update task: dispatches update
- main() CLI → Status transitions: dispatches status commands
- main() CLI → Delete task: dispatches delete
- main() CLI → List tasks: dispatches list
- Add task → In-memory tasks: adds record
- Update task → In-memory tasks: mutates by ID
- Status transitions → In-memory tasks: updates status by ID
- Delete task → In-memory tasks: removes by ID
- List tasks → In-memory tasks: queries and filters
- In-memory tasks → save_database(): persists mutations
- save_database() → Local JSON database: writes JSON
- Pytest coverage → main() CLI: tests core behavior
