# josuedhg/todo architecture

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

- Interactive diagram: https://gitdiagram.com/josuedhg/todo
- Repository: https://github.com/josuedhg/todo

## Overview

##### Main Components
- Library Core: Represented by the “lib” directory with source files handling task management, todo operations (e.g., task.c, todo.c, todotxt.c), and associated headers.
- Command-Line Interface (CLI): Shown by the “bin” directory – it contains main.c, command implementations (commands.c, commands.h), and the configuration files needed to drive the CLI. This component is the consumer of the core library.
- Test Suite: Encapsulated by the “tests” directory, with separate tests for the CLI (tests/bin) and for the library functionality (tests/lib). This ensures that both parts are validated independently.
- Build & CI Infrastructure: Indicate the CMake-based build system (CMakeLists.txt at various levels and cmake directory scripts) along with the CI/CD pipeline configured using GitHub Actions (in .github/workflows).

##### Relationships and Interactions
- Build system (CMake) as a facilitator that compiles both the CLI and the library, with annotations that detail this relationship.

##### Architectural Patterns and Design Principles
- Modular design: note that the core logic (e.g., task tracking) is separated from the interface (CLI), promoting reusability and easier testing.
- Mention the focus on automated testing and continuous integration, which is central to the development workflow.
- Reinforce separation of concerns – the library is independent and can potentially be used in other contexts beyond the CLI.

##### Relevant Technologies and Frameworks
- C language – the project’s main language.
- CMake – for building and managing dependencies.
- GitHub Actions – for continuous integration.
- Testing frameworks (embedded in the tests folder) – though not explicitly named, show that unit testing is a core part of the architecture.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["CI/CD Pipeline (GitHub Actions)"]:::ci
    B["Build System (CMake)"]:::build
    subgraph "Application Components"
        C["Command-Line Interface (CLI)"]:::cli
        D["Library Core"]:::lib
        C -->|"calls"| D
    end
    E["Test Suite"]:::test

    A -->|"triggers"| B
    A -->|"triggers"| E
    B -->|"builds"| C
    B -->|"builds"| D
    C -->|"tested_by"| E
    D -->|"tested_by"| E

    click A "https://github.com/josuedhg/todo/tree/master/.github/workflows/"
    click B "https://github.com/josuedhg/todo/blob/master/CMakeLists.txt"
    click C "https://github.com/josuedhg/todo/tree/master/bin/"
    click D "https://github.com/josuedhg/todo/tree/master/lib/"
    click E "https://github.com/josuedhg/todo/tree/master/tests/"

    classDef ci fill:#F9A,stroke:#333,stroke-width:2px;
    classDef build fill:#9CF,stroke:#333,stroke-width:2px;
    classDef cli fill:#CFC,stroke:#333,stroke-width:2px;
    classDef lib fill:#FC9,stroke:#333,stroke-width:2px;
    classDef test fill:#CFF,stroke:#333,stroke-width:2px;
```
