# ice-machine/to-do-list architecture

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

- Interactive diagram: https://gitdiagram.com/ice-machine/to-do-list
- Repository: https://github.com/ice-machine/to-do-list

## Overview

##### Project Type and Purpose
- This is a single-page TO-DO list web application (frontend-only).
- Purpose: let users add and remove tasks in their browser, with all logic and data management done in the client.

##### File Structure Analysis
- Top level
- index.html – entry point
- dist/ – compiled output (main.js, main.js.map)
- src/main.ts – application logic in TypeScript
- styles/globale.css – global stylesheet
- tsconfig.json – TypeScript compiler settings
- No backend or server folders, so it’s purely client-side.

##### Key Components
a. User Interface
- Browser (renders index.html + CSS + JS)
- HTML Document (index.html)
- CSS Styles (styles/globale.css)
b. Application Logic
- Compiled Script (dist/main.js)
- TypeScript Source (src/main.ts) – show as dev artifact
c. Data Storage
- In-memory JS array OR browser localStorage (if implemented)
d. Build Tooling
- Node.js & npm (dev environment)
- TypeScript compiler (tsc)

##### Relationships and Data Flows
- Browser loads index.html →
- pulls in globale.css
- pulls in main.js
- main.js initializes the Task Manager module (from main.ts) →
- renders existing tasks to the DOM
- listens for “add” and “delete” events
- updates the in-memory list (or localStorage)
- re-renders the task list
User → Browser UI → App Logic → Data Store → App Logic → UI

##### Architectural Patterns & Design Principles
- Separation of concerns:
- Presentation (HTML + CSS)
- Business logic (TypeScript module)
- Data state (in-memory or localStorage)
- Single responsibility:
- main.ts handles only task operations + DOM updates
- Build step:
- TS source → tsc → dist/main.js

##### Final Checklist
- [ ] Optionally annotate the build step outside the runtime flow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Runtime Flow
    Browser["Browser"]:::ui
    Browser -->|"loads"| HTML
    HTML["index.html"]:::static
    HTML -->|"links CSS"| CSS
    CSS["globale.css"]:::static
    HTML -->|"loads script"| JS
    JS["main.js"]:::logic
    JS -->|"initializes"| TaskManager
    TaskManager["Task Manager Module"]:::logic
    TaskManager -->|"reads/writes"| DataStore
    DataStore[(In-memory Data / localStorage)]:::data
    TaskManager -->|"updates DOM"| Browser

    %% Build Toolchain
    Node["Node.js & npm"]:::devtool
    Node -->|"runs"| TSC
    TSC["TypeScript Compiler (tsc)"]:::devtool
    TSC -->|"compiles TS"| JS
    TSC -->|"generates map"| Map
    TSC -->|"reads config"| Config
    TS["src/main.ts"]:::dev
    TS -->|"source for compile"| TSC
    Map["dist/main.js.map"]:::dev
    Config["tsconfig.json"]:::dev

    %% Legend
    subgraph "Legend"
        UI["UI Component"]:::ui
        Static["Static Asset"]:::static
        Logic["Logic Component"]:::logic
        Data["Data Store"]:::data
        Dev["Dev Artifact"]:::dev
        Tooling["Build Tool"]:::devtool
    end

    %% Click Events
    click HTML "https://github.com/ice-machine/to-do-list/blob/main/index.html"
    click CSS "https://github.com/ice-machine/to-do-list/blob/main/styles/globale.css"
    click TS "https://github.com/ice-machine/to-do-list/blob/main/src/main.ts"
    click JS "https://github.com/ice-machine/to-do-list/blob/main/dist/main.js"
    click Map "https://github.com/ice-machine/to-do-list/blob/main/dist/main.js.map"
    click Config "https://github.com/ice-machine/to-do-list/blob/main/tsconfig.json"

    %% Styles
    classDef ui fill:#cfe8ff,stroke:#000,stroke-width:1px
    classDef static fill:#a2cffe,stroke:#000,stroke-width:1px
    classDef logic fill:#b3e6b0,stroke:#000,stroke-width:1px
    classDef data fill:#f9c784,stroke:#000,stroke-width:1px
    classDef dev fill:#d3d3d3,stroke:#000,stroke-width:1px
    classDef devtool fill:#e0b3ff,stroke:#000,stroke-width:1px
```
