# pratikmishra009/go-todo-cli architecture

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

- Interactive diagram: https://gitdiagram.com/pratikmishra009/go-todo-cli
- Repository: https://github.com/pratikmishra009/go-todo-cli

## Overview

This is a small command-line todo manager. Its workflow loads todos from a JSON file, executes one selected flag-driven action, prints the list, and saves the result. The todo model provides add, edit, delete, toggle, and table display behavior. The excerpts show the main flow and storage implementation; there is no README or evidence of additional product subsystems.

Main entry points: [`main.go`](https://github.com/pratikmishra009/go-todo-cli/blob/main/main.go) (Application Entry), [`todo.go`](https://github.com/pratikmishra009/go-todo-cli/blob/main/todo.go) (Todo Operations), [`commands.go`](https://github.com/pratikmishra009/go-todo-cli/blob/main/commands.go) (Flag Commands), [`storage.go`](https://github.com/pratikmishra009/go-todo-cli/blob/main/storage.go) (JSON Storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_main["Application Entry<br/>[main.go]"]
  node_commands["Flag Commands<br/>[commands.go]"]
end

subgraph group_domain["Todo Domain"]
  node_todos["Todo Operations<br/>[todo.go]"]
end

subgraph group_persistence["Persistence"]
  node_storage["JSON Storage<br/>[storage.go]"]
  node_todo_file["Todo JSON File<br/>[todos.json]"]
end

node_user(("CLI User"))
node_table_package["Table Package"]

node_user -->|"runs CLI"| node_main
node_main -->|"loads todos"| node_storage
node_main -->|"executes flags"| node_commands
node_main -->|"passes todos"| node_todos
node_main -->|"saves todos"| node_storage
node_storage -->|"reads JSON"| node_todo_file
node_storage -->|"writes JSON"| node_todo_file
node_commands -->|"adds or edits"| node_todos
node_commands -->|"deletes or toggles"| node_todos
node_commands -->|"prints list"| node_todos
node_main -->|"prints list"| node_todos
node_todos -->|"renders table"| node_table_package

click node_main "https://github.com/pratikmishra009/go-todo-cli/blob/main/main.go"
click node_commands "https://github.com/pratikmishra009/go-todo-cli/blob/main/commands.go"
click node_todos "https://github.com/pratikmishra009/go-todo-cli/blob/main/todo.go"
click node_storage "https://github.com/pratikmishra009/go-todo-cli/blob/main/storage.go"
click node_todo_file "https://github.com/pratikmishra009/go-todo-cli/blob/main/todos.json"

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_main,node_commands,node_user toneBlue
class node_todos toneAmber
class node_storage,node_todo_file toneMint
class node_table_package toneIndigo
```

## Components

### CLI

- [Application Entry](https://github.com/pratikmishra009/go-todo-cli/blob/main/main.go): `main.go`
- [Flag Commands](https://github.com/pratikmishra009/go-todo-cli/blob/main/commands.go): `commands.go`

### Todo Domain

- [Todo Operations](https://github.com/pratikmishra009/go-todo-cli/blob/main/todo.go): `todo.go`

### Persistence

- [JSON Storage](https://github.com/pratikmishra009/go-todo-cli/blob/main/storage.go): `storage.go`
- [Todo JSON File](https://github.com/pratikmishra009/go-todo-cli/blob/main/todos.json): `todos.json`

### Other components

- **CLI User**
- **Table Package**

## Connections

- CLI User → Application Entry: runs CLI (evidence: `main.go`)
- Application Entry → JSON Storage: loads todos (evidence: `main.go`)
- Application Entry → Flag Commands: executes flags (evidence: `main.go`)
- Application Entry → Todo Operations: passes todos (evidence: `main.go`)
- Application Entry → JSON Storage: saves todos (evidence: `main.go`)
- JSON Storage → Todo JSON File: reads JSON (evidence: `storage.go`)
- JSON Storage → Todo JSON File: writes JSON (evidence: `storage.go`)
- Flag Commands → Todo Operations: adds or edits (evidence: `commands.go`)
- Flag Commands → Todo Operations: deletes or toggles (evidence: `commands.go`)
- Flag Commands → Todo Operations: prints list (evidence: `commands.go`)
- Application Entry → Todo Operations: prints list (evidence: `main.go`)
- Todo Operations → Table Package: renders table (evidence: `todo.go`)
