# nimaaskarian/c3 architecture

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

- Interactive diagram: https://gitdiagram.com/nimaaskarian/c3
- Repository: https://github.com/nimaaskarian/c3

## Overview

##### Project type and purpose
- This is a single‐binary, Rust-based to-do list application that runs entirely on the user’s machine. It offers both an interactive terminal UI (TUI) mode and a non‐interactive CLI mode, storing data in files using the Calcurse format and extending it into a tree of to-dos with dependencies and notes.
- There is no remote server or database—the “backend” is simply domain logic plus file I/O.

##### File structure
- Top‐level scripts (release.sh, bump-version.sh, init-aur.sh, clean-aur.sh, etc.) support packaging and CI, not runtime.
- Cargo.toml / src/: a single Rust crate broken into modules:
- cli_app.rs and tui_app.rs (entry points for the two user-facing interfaces)
- lib.rs pulls together sub-modules: date.rs (date calculations), fileio.rs (read/write Calcurse files), todo_app (core domain types: Todo, Note, Schedule, Dependency, TodoList), tui_app sub-modules (potato timer integration, buffer management, tree search).
- benches/ and tests/: performance and correctness suites.
- config.toml: user configuration.

##### README
- Describes modes (TUI vs CLI), keybinds, usage, and performance tips.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Presentation Layer"
        Main["Main / Mode Selection"]:::presentation
        CLI["CLI Mode<br/>Parser & Dispatcher"]:::presentation
        TUI["TUI Mode<br/>Interactive Engine"]:::presentation
    end

    subgraph "Domain Layer"
        Core["Core Todo Model"]:::domain
        Date["Date Module"]:::domain
        Config["Configuration Loader"]:::domain
    end

    subgraph "Infrastructure Layer"
        FileIO["File I/O Module"]:::infra
        FS["Local File System"]:::infra
    end

    subgraph "External Tools"
        NNN["nnn File Picker"]:::external
        Potato["Potato-timer Integration"]:::external
    end

    subgraph "Support Artifacts"
        Benches["Performance Benchmarks"]:::support
        Tests["Correctness Tests"]:::support
        Scripts["Packaging & CI Scripts"]:::support
    end

    Main --> CLI
    Main --> TUI
    CLI -->|"dispatch commands"| Core
    TUI -->|"send events"| Core
    Core -->|"use date math"| Date
    Core -->|"load config"| Config
    Core --> FileIO
    FileIO -->|"read/write Calcurse files"| FS
    FS -->|"startup load"| FileIO
    TUI -->|"invoke file picker"| NNN
    TUI -->|"invoke pomodoro"| Potato

    click Main "https://github.com/nimaaskarian/c3/blob/master/src/main.rs"
    click CLI "https://github.com/nimaaskarian/c3/blob/master/src/cli_app.rs"
    click TUI "https://github.com/nimaaskarian/c3/blob/master/src/tui_app.rs"
    click TUI "https://github.com/nimaaskarian/c3/blob/master/src/tui_app/todo_buffer.rs"
    click TUI "https://github.com/nimaaskarian/c3/blob/master/src/tui_app/tree_search.rs"
    click Potato "https://github.com/nimaaskarian/c3/blob/master/src/tui_app/potato.rs"
    click Core "https://github.com/nimaaskarian/c3/blob/master/src/todo_app.rs"
    click Core "https://github.com/nimaaskarian/c3/blob/master/src/todo_app/todo.rs"
    click Core "https://github.com/nimaaskarian/c3/blob/master/src/todo_app/todo/dependency.rs"
    click Core "https://github.com/nimaaskarian/c3/blob/master/src/todo_app/todo/note.rs"
    click Core "https://github.com/nimaaskarian/c3/blob/master/src/todo_app/todo/schedule.rs"
    click Core "https://github.com/nimaaskarian/c3/blob/master/src/todo_app/todo_list.rs"
    click Date "https://github.com/nimaaskarian/c3/blob/master/src/date.rs"
    click FileIO "https://github.com/nimaaskarian/c3/blob/master/src/fileio.rs"
    click Config "https://github.com/nimaaskarian/c3/blob/master/config.toml"
    click Benches "https://github.com/nimaaskarian/c3/blob/master/benches/bench_500k.rs"
    click Tests "https://github.com/nimaaskarian/c3/tree/master/tests/TODO_LIST"

    classDef presentation fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef domain fill:#90EE90,stroke:#000,stroke-width:1px
    classDef infra fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef external fill:#FFA500,stroke:#000,stroke-width:1px
    classDef support fill:#E0E0E0,stroke:#000,stroke-width:1px
```
