# patni1992/cli-todo-app-in-go architecture

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

- Interactive diagram: https://gitdiagram.com/patni1992/cli-todo-app-in-go
- Repository: https://github.com/patni1992/cli-todo-app-in-go

## Overview

This is a small Go command-line todo app. Its main workflow loads saved todos, parses a command-line action, applies that action to the todo list (or prints it), then saves the list. The code also validates indexes for edit, delete, and toggle operations, and renders listings with a table library. The excerpts show the local JSON persistence and command dispatch; no separate external initiating actor is modeled.

Main entry points: [`main.go`](https://github.com/patni1992/cli-todo-app-in-go/blob/main/main.go) (Application entry), [`storage.go`](https://github.com/patni1992/cli-todo-app-in-go/blob/main/storage.go) (JSON storage), [`command.go`](https://github.com/patni1992/cli-todo-app-in-go/blob/main/command.go) (Command flags), [`todo.go`](https://github.com/patni1992/cli-todo-app-in-go/blob/main/todo.go) (Todo operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["CLI runtime"]
  node_main["Application entry<br/>[main.go]"]
  node_flags["Command flags<br/>[command.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[("todos.json")]
end

node_table_lib["Table library"]

node_main -->|"loads"| node_storage
node_main -->|"executes"| node_flags
node_main -->|"saves"| node_storage
node_flags -->|"dispatches"| node_todos
node_todos -->|"renders with"| node_table_lib
node_storage -->|"reads/writes"| node_todo_file

click node_main "https://github.com/patni1992/cli-todo-app-in-go/blob/main/main.go"
click node_flags "https://github.com/patni1992/cli-todo-app-in-go/blob/main/command.go"
click node_todos "https://github.com/patni1992/cli-todo-app-in-go/blob/main/todo.go"
click node_storage "https://github.com/patni1992/cli-todo-app-in-go/blob/main/storage.go"

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_flags toneBlue
class node_todos toneAmber
class node_storage,node_todo_file toneMint
class node_table_lib toneIndigo
```

## Components

### CLI runtime

- [Application entry](https://github.com/patni1992/cli-todo-app-in-go/blob/main/main.go): `main.go`
- [Command flags](https://github.com/patni1992/cli-todo-app-in-go/blob/main/command.go): `command.go`

### Todo domain

- [Todo operations](https://github.com/patni1992/cli-todo-app-in-go/blob/main/todo.go): `todo.go`

### Persistence

- [JSON storage](https://github.com/patni1992/cli-todo-app-in-go/blob/main/storage.go): `storage.go`
- **todos.json**

### Other components

- **Table library**

## Connections

- Application entry → JSON storage: loads (evidence: `main.go`)
- Application entry → Command flags: executes (evidence: `main.go`)
- Application entry → JSON storage: saves (evidence: `main.go`)
- Command flags → Todo operations: dispatches (evidence: `command.go`)
- Todo operations → Table library: renders with (evidence: `todo.go`)
- JSON storage → todos.json: reads/writes (evidence: `storage.go`)
