# eriklujan/to-do-list-app architecture

> Architecture diagram of the GitHub repository eriklujan/to-do-list-app, 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/eriklujan/to-do-list-app
- Repository: https://github.com/eriklujan/to-do-list-app

## Overview

##### Main Components
- User Interface (HTML): Represented by the "HTML/index.html" file. This component is responsible for structuring the page where users interact with tasks.
- Styling (CSS): Represented by "CSS/style.css". This handles the layouts, animations, and responsiveness.
- Application Logic (JavaScript): The "JS/script.js" file contains the logic for task management (adding, deleting, and marking tasks).
- Data Persistence: Although there's no backend, the project leverages localStorage for saving tasks locally.

##### Relationships and Interactions
- The HTML component renders the structure and interactive elements (e.g., lists, buttons).
- The JavaScript component listens for user events (clicks for adding, deleting, or completing tasks) and updates the HTML DOM accordingly.
- The JavaScript module interacts with localStorage to save and retrieve tasks, ensuring data persists even after the browser is closed.
- CSS styles are applied to the HTML elements to provide a responsive and visually appealing interface.

##### Architectural Patterns and Design Principles
- Separation of Concerns: The project separates structure (HTML), style (CSS), and behavior (JavaScript).
- Data Binding: Although not using advanced frameworks, there is an implicit data binding between localStorage data, JS updates, and UI rendering.

##### Relevant Technologies and Frameworks
- HTML5 for markup.
- CSS3 for styling and animations.
- JavaScript for handling user interactions, logic, and persistence via localStorage.

##### Elements
- From the "User" to the "HTML" component to indicate interaction.
- From the "HTML" component to "JavaScript" to show event handling.
- From "JavaScript" to "localStorage" to denote data saving and retrieval.
- From "JavaScript" back to "HTML" to demonstrate updating of the user interface.

- Branch out to the JavaScript component which connects via event listeners and DOM manipulation.
- LocalStorage as a storage mechanism that reads/writes data in response to JS events.
- Assets folder as a supporting component that the HTML/CSS can reference.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Global Nodes
    User["User"]:::user

    %% Presentation Layer
    subgraph "Presentation Layer"
        HTML["HTML (index.html)"]:::presentation
        CSS["CSS (style.css)"]:::css
        Assets["Assets"]:::asset
    end

    %% Logic Layer
    subgraph "Logic Layer"
        JS["JavaScript (script.js)"]:::logic
    end

    %% Storage Component
    Storage["localStorage"]:::storage

    %% Connections
    User -->|"interacts"| HTML
    HTML -->|"triggers"| JS
    JS -->|"updates"| HTML
    JS -->|"reads/writes"| Storage
    CSS -->|"styles"| HTML
    HTML -->|"references"| Assets
    CSS -->|"references"| Assets

    %% Click Events
    click HTML "https://github.com/eriklujan/to-do-list-app/blob/master/HTML/index.html"
    click CSS "https://github.com/eriklujan/to-do-list-app/blob/master/CSS/style.css"
    click JS "https://github.com/eriklujan/to-do-list-app/blob/master/JS/script.js"
    click Assets "https://github.com/eriklujan/to-do-list-app/tree/master/assets"

    %% Styles
    classDef user fill:#DAE8FC,stroke:#6C8EBF,stroke-width:2px;
    classDef presentation fill:#D5E8D4,stroke:#82B366,stroke-width:2px;
    classDef css fill:#FCE5CD,stroke:#E69138,stroke-width:2px;
    classDef asset fill:#E1D5E7,stroke:#9673A6,stroke-width:2px;
    classDef logic fill:#FFF2CC,stroke:#D6B656,stroke-width:2px;
    classDef storage fill:#F8CECC,stroke:#B85450,stroke-width:2px;
```
