# harsh-codes-77/to-do-app architecture

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

- Interactive diagram: https://gitdiagram.com/harsh-codes-77/to-do-app
- Repository: https://github.com/harsh-codes-77/to-do-app

## Overview

##### Project Type and Purpose
- This is a lightweight, client-side web application: a static “To-Do List” app built with plain HTML, CSS, and JavaScript.
- There is no dedicated backend API or database; persistence is likely handled in the browser (e.g., via LocalStorage).

##### File Structure Analysis
- Root:
- index.html – main UI shell
- style.css – styling rules
- script.js – app logic and event handling
- No server code or configuration files (e.g., package.json), confirming a purely front-end implementation.

##### Key Components
a. Static File Server (or CDN)
– Hosts index.html, style.css, script.js, and images/
b. Client (Browser)
– Fetches static assets over HTTP(S)
– Renders UI, applies styles, executes JS
c. UI Layer
– HTML structure (task list, input form, buttons)
– CSS styling
d. Application Logic
– JavaScript modules/functions in script.js
– DOM event listeners (add, remove, toggle tasks)
e. Persistence Layer
– Browser’s LocalStorage (or similar) for saving task list state

##### Interactions and Data Flow
1) Browser → Static File Server: HTTP GET index.html, CSS, JS, image assets
2) Browser renders page, CSS applies, JS initializes
3) On load: JS reads tasks from LocalStorage → UI Layer
4) User actions (add/delete/complete): UI Layer triggers JS event handlers
5) JS updates in-memory task list and writes back to LocalStorage
6) JS updates DOM to reflect changes

##### Architectural Patterns & Principles
- Single-Page Application (SPA) style: all UI updates happen client-side without page reloads
- Separation of Concerns:
- Presentation (HTML/CSS)
- Behavior (JavaScript)
- Storage (LocalStorage API)
- Progressive Enhancement: even without JavaScript, basic content (HTML form) can appear

##### Technologies and Frameworks
- HTML5, CSS3, Vanilla JavaScript
- Web Storage API (LocalStorage)
- No external libraries/frameworks

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Infrastructure Layer
    Srv["Static File Server"]:::infra

    %% Client Browser Layer
    subgraph "Browser (Client)" 
        subgraph "Presentation"
            HTML["HTML Structure"]:::presentation
            CSS["CSS Styling"]:::presentation
        end
        subgraph "Application Logic"
            JS["JavaScript Logic"]:::logic
        end
        subgraph "Persistence"
            LS["LocalStorage"]:::datastore
        end
    end

    %% Asset Flow from Server to Browser
    Srv -->|"HTTP GET index.html"| HTML
    Srv -->|"HTTP GET style.css"| CSS
    Srv -->|"HTTP GET script.js"| JS
    Srv -->|"HTTP GET images/*"| Images

    %% User Interaction Flow
    HTML -->|"click event"| JS
    JS -->|"DOM update"| HTML

    %% Persistence Flow
    JS -->|"readItem()/setItem()"| LS
    LS -->|"return tasks"| JS

    %% Asset Node for Images
    Images["Images (Icons/Graphics)"]:::presentation

    %% Click Events
    click Srv "https://github.com/harsh-codes-77/to-do-app/tree/main/New To-Do list App/"
    click HTML "https://github.com/harsh-codes-77/to-do-app/blob/main/New To-Do list App/index.html"
    click CSS "https://github.com/harsh-codes-77/to-do-app/blob/main/New To-Do list App/style.css"
    click JS "https://github.com/harsh-codes-77/to-do-app/blob/main/New To-Do list App/script.js"
    click LS "https://github.com/harsh-codes-77/to-do-app/blob/main/New To-Do list App/script.js"
    click Images "https://github.com/harsh-codes-77/to-do-app/tree/main/New To-Do list App/images/"

    %% Styles
    classDef infra fill:#add8e6,stroke:#333,stroke-width:1px
    classDef presentation fill:#ffcc99,stroke:#333,stroke-width:1px
    classDef logic fill:#ffff99,stroke:#333,stroke-width:1px
    classDef datastore fill:#90ee90,stroke:#333,stroke-width:1px
```
