# gauravxsharma/doneit-todo architecture

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

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

## Overview

##### Project type and purpose
- This is a single-page, front-end To-Do application.
- Purpose: let users add/edit/delete tasks, track progress via a bar, and trigger a confetti effect when all tasks are done.
- It uses only HTML, CSS, Vanilla JavaScript, the browser’s LocalStorage API, and the tsParticles confetti library.

##### File structure
- Top level files:
- index.html – the main UI entry point
- style.css – styling for layout and effects
- app.js – all application logic, DOM manipulation, LocalStorage reads/writes, and integration with tsParticles
- img/ – static assets used in the UI
- No backend, build scripts, or external services beyond the confetti library.

##### Additional insights from README
- Tasks persist in LocalStorage, so there’s a client-side store only.
- A dynamic progress bar recalculates percentages on each change.
- The tsParticles library is used for the confetti celebration.

a. Main components to show
- Browser (as the container)
- UI Layer: HTML (structure) + CSS (styles)
- Application Logic: app.js – handles event listeners, task CRUD, progress calculation
- Data Store: LocalStorage API
- External Library: tsParticles Confetti
- Static Assets: img folder

b. Relationships and interactions
- User → UI Layer: clicks “Add”, “Complete”, “Delete”, “Edit”
- UI Layer ↔ Application Logic: events flow into app.js; DOM updates flow back out
- Application Logic ↔ LocalStorage: read/write on every CRUD operation and on page load
- Application Logic → tsParticles: triggers confetti when progress hits 100%
- UI Layer loads static img assets

c. Architectural patterns/Design principles
- Separation of concerns:
– HTML/CSS for presentation
– JavaScript for behavior and state management
– LocalStorage as persistent client-side store
- Event-driven updates: user actions trigger JS logic, which updates both the DOM and LocalStorage
- Single responsibility: each module (DOM manipulation, storage management, confetti effect) is clearly delineated

d. Key technologies/frameworks/libraries
- HTML5, CSS3 – static UI
- Vanilla JavaScript – core logic (no frameworks)
- LocalStorage API – persistence
- tsParticles Confetti – celebratory animation

##### Detailing and coverage
- Don’t omit any piece: show img assets loading, the static files being served by the browser, the single HTML entrypoint.
- Event triggers (add/edit/delete), data persistence, progress bar recalculation, and confetti trigger.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User"
        U[User] 
    end
    U -->|"clicks Add/Edit/Delete"| UI

    subgraph "Browser"
        direction TB
        UI["UI Layer\n(index.html)"]:::ui
        CSS["Style Layer\n(style.css)"]:::ui
        JS["Application Logic\n(app.js)"]:::logic
        ASSETS["Static Assets\n(img/)"]:::assets
    end

    UI -.->|"loads CSS"| CSS
    UI -->|"loads JS"| JS
    UI -->|"loads images"| ASSETS

    JS -->|"read/write tasks"| LS
    JS -->|"call confetti"| TS

    subgraph "Client-side Storage"
        LS[(LocalStorage API)]:::storage
    end

    subgraph "External Library"
        TS["tsParticles Confetti"]:::library
    end

    click UI "https://github.com/gauravxsharma/doneit-todo/blob/main/index.html"
    click CSS "https://github.com/gauravxsharma/doneit-todo/blob/main/style.css"
    click JS "https://github.com/gauravxsharma/doneit-todo/blob/main/app.js"
    click ASSETS "https://github.com/gauravxsharma/doneit-todo/tree/main/img/"

    classDef ui fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef logic fill:#FFA500,stroke:#333,stroke-width:1px
    classDef storage fill:#90EE90,stroke:#333,stroke-width:1px
    classDef library fill:#DDA0DD,stroke:#333,stroke-width:1px
    classDef assets fill:#D3D3D3,stroke:#333,stroke-width:1px
```
