# ersindoldur/todo-app-frontend-mentor architecture

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

- Interactive diagram: https://gitdiagram.com/ersindoldur/todo-app-frontend-mentor
- Repository: https://github.com/ersindoldur/todo-app-frontend-mentor

## Overview

##### Project type and purpose
- This is a single‐page, front-end only “Todo” app built as a coding challenge.
- There is no server‐side component or external API—everything runs in the browser and data is persisted locally (e.g., localStorage).
- It is a static site composed of HTML, CSS, JavaScript, plus design assets.

##### File structure
- Top-level files:
- index.html – the single page entry point
- README-*.md – documentation templates
- LICENSE, .gitignore, .gitattributes
- Directories:
- design/ – JPG mockups (mobile & desktop)
- No “backend,” “api,” or “src” folder – all logic lives in a script linked from index.html.

##### README for additional insights
- It outlines user stories (add/delete/complete/filter todos, theme toggle, drag-and-drop reorder).
- It points to assets and design mockups.
- It gives no mention of external services or build steps (it’s purely HTML/CSS/JS).

##### Components
a. Browser & User Interface
– index.html + CSS (light/dark theme styles) + JavaScript controller
b. Client-side state management
– In-memory JavaScript data structures (array of todo items)
– Persistence layer: localStorage
c. Design assets module
– design/ folder (for reference, not part of runtime)
d. Deployment/Hosting
– Static site hosting (GitHub Pages, Netlify, Vercel)
– CDN delivering index.html, CSS, JS, and image assets

##### Relationships and interactions
- User interacts via browser UI → JavaScript handles events (add, complete, delete, filter, reorder, theme toggle).
- JavaScript updates both the DOM and the in-memory data.
- On each change, JavaScript writes the updated state to localStorage (persistence).
- On page load, JavaScript reads from localStorage to hydrate the in-memory state & render the list.
- Static assets (CSS, JS, images) are fetched over HTTP from the hosting/CDN.

##### Architectural patterns and principles
- Separation of concerns:
- HTML for structure
- CSS for presentation (style-guide tokens, responsive breakpoints)
- JS for behavior & state
- Model-View-Controller-Lite:
- Model: the todo‐items array + localStorage
- View: DOM elements (list, filters, theme toggle)
- Controller: event handlers & state synchronization
- Progressive enhancement & responsive design: mobile & desktop layouts via CSS media queries.

##### Putting it all together
- Inside, nest three components in order of execution:
- index.html & CSS (View)
- JavaScript (Controller)
- localStorage (Model)
- On the left, list “images/” as a resource node feeding into the Browser.
- Component with the relevant technologies: HTML5, CSS3 (media queries, custom properties), vanilla JS (ES6+), localStorage API.
- HTTP GET from CDN → Browser
- UI events → JS
- JS read/write → localStorage
- Browser render → User

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interaction
    User["User"]:::user
    User -->|"interacts with"| Browser

    %% Browser Container
    subgraph "Browser" 
        direction TB
        UI["UI Layer\n(index.html, CSS)"]:::client
        JS["JavaScript Logic\n(Controller & State)"]:::client
        Storage["Persistence\n(localStorage API)"]:::client
        UI -->|"UI events"| JS
        JS -->|"read/write"| Storage
        Storage -->|"hydrate on load"| JS
        JS -->|"update DOM"| UI
    end

    %% External Assets and Hosting
    Images["images/"]:::client
    Images -->|"fetch icons & backgrounds"| Browser

    CDN["Static Hosting / CDN"]:::external
    CDN -->|"HTTP GET HTML/CSS/JS/images"| Browser

    %% Documentation & Deployment Metadata
    subgraph "Documentation & Metadata"
        direction TB
        Readme["README.md"]:::docs
        ReadmeT["README-template.md"]:::docs
        Gitignore[".gitignore"]:::docs
        Gitattributes[".gitattributes"]:::docs
        License["LICENSE"]:::docs
    end

    %% Click Events
    click UI "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/index.html"
    click UI "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/style-guide.md"
    click JS "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/index.html"
    click Images "https://github.com/ersindoldur/todo-app-frontend-mentor/tree/main/images/"
    click Readme "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/README.md"
    click ReadmeT "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/README-template.md"
    click Gitignore "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/.gitignore"
    click Gitattributes "https://github.com/ersindoldur/todo-app-frontend-mentor/blob/main/.gitattributes"
    click License "https://github.com/ersindoldur/todo-app-frontend-mentor/tree/main/LICENSE"

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0366d6,stroke-width:2px;
    classDef external fill:#D6F5D6,stroke:#28a745,stroke-width:2px;
    classDef user fill:#FFE5CC,stroke:#FF8C00,stroke-width:2px;
    classDef docs fill:#F0F0F0,stroke:#999999,stroke-width:1px;
```
