# omarhanfi/todo-list architecture

> Architecture diagram of the GitHub repository omarhanfi/todo-list, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omarhanfi/todo-list
- Repository: https://github.com/omarhanfi/todo-list

## Overview

Listly is a browser-based to-do app. Users add, complete, delete, and clear tasks; task state is persisted in Local Storage, while the interface localizes labels and counts for English or Arabic. Settings control language and theme. The README also documents responsive styling, sound effects, and PWA installation and offline support. The sampled JavaScript shows task, settings, storage, localization, and service-worker behavior; HTML, CSS, manifest, and asset details are represented only where the README or tree supports them.

Main entry points: [`js/main.js`](https://github.com/omarhanfi/todo-list/blob/main/js/main.js) (Task actions), [`js/i18n.js`](https://github.com/omarhanfi/todo-list/blob/main/js/i18n.js) (Localization), [`service-worker.js`](https://github.com/omarhanfi/todo-list/blob/main/service-worker.js) (Offline worker), [`index.html`](https://github.com/omarhanfi/todo-list/blob/main/index.html) (App page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Task app"]
  node_task_flow["Task actions<br/>[main.js]"]
  node_task_view["Task display<br/>[main.js]"]
  node_settings["App settings<br/>[main.js]"]
  node_storage[("Task storage<br/>[localstorage.js]")]
end

subgraph group_experience["Interface and assets"]
  node_localization["Localization<br/>[i18n.js]"]
  node_locale_data["Locale data"]
  node_page["App page<br/>[index.html]"]
  node_styles["Responsive themes<br/>[style.css]"]
  node_sound["Action sounds"]
end

subgraph group_pwa["PWA support"]
  node_manifest["Install manifest<br/>[manifest.json]"]
  node_registration["Worker registration<br/>[main.js]"]
  node_worker["Offline worker<br/>[service-worker.js]"]
  node_shell["Cached app shell<br/>[service-worker.js]"]
end

node_user(("User"))
node_browser(("Browser platform"))

node_user -->|"manages tasks"| node_task_flow
node_task_flow -->|"loads and saves"| node_storage
node_task_flow -->|"renders tasks"| node_task_view
node_task_flow -->|"plays effects"| node_sound
node_settings -->|"sets language"| node_localization
node_task_flow -->|"translates labels"| node_localization
node_localization -->|"fetches locales"| node_locale_data
node_user -->|"chooses preferences"| node_settings
node_user -->|"uses app"| node_page
node_page -.->|"uses styling"| node_styles
node_registration -->|"registers worker"| node_worker
node_worker -->|"caches resources"| node_shell
node_browser -->|"provides storage"| node_storage
node_browser -->|"runs worker"| node_worker
node_browser -->|"installs app"| node_manifest

click node_task_flow "https://github.com/omarhanfi/todo-list/blob/main/js/main.js"
click node_task_view "https://github.com/omarhanfi/todo-list/blob/main/js/main.js"
click node_settings "https://github.com/omarhanfi/todo-list/blob/main/js/main.js"
click node_storage "https://github.com/omarhanfi/todo-list/blob/main/js/localstorage.js"
click node_localization "https://github.com/omarhanfi/todo-list/blob/main/js/i18n.js"
click node_locale_data "https://github.com/omarhanfi/todo-list/tree/main/assets/Lang"
click node_page "https://github.com/omarhanfi/todo-list/blob/main/index.html"
click node_styles "https://github.com/omarhanfi/todo-list/blob/main/css/style.css"
click node_sound "https://github.com/omarhanfi/todo-list/tree/main/assets/sounds"
click node_manifest "https://github.com/omarhanfi/todo-list/blob/main/assets/manifest.json"
click node_registration "https://github.com/omarhanfi/todo-list/blob/main/js/main.js"
click node_worker "https://github.com/omarhanfi/todo-list/blob/main/service-worker.js"
click node_shell "https://github.com/omarhanfi/todo-list/blob/main/service-worker.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_task_flow,node_task_view,node_settings,node_storage,node_user,node_browser toneBlue
class node_localization,node_locale_data,node_page,node_styles,node_sound toneAmber
class node_manifest,node_registration,node_worker,node_shell toneMint
```

## Components

### Task app

- [Task actions](https://github.com/omarhanfi/todo-list/blob/main/js/main.js): `js/main.js`
- [Task display](https://github.com/omarhanfi/todo-list/blob/main/js/main.js): `js/main.js`
- [App settings](https://github.com/omarhanfi/todo-list/blob/main/js/main.js): `js/main.js`
- [Task storage](https://github.com/omarhanfi/todo-list/blob/main/js/localstorage.js): `js/localstorage.js`

### Interface and assets

- [Localization](https://github.com/omarhanfi/todo-list/blob/main/js/i18n.js): `js/i18n.js`
- [Locale data](https://github.com/omarhanfi/todo-list/tree/main/assets/Lang): `assets/Lang`
- [App page](https://github.com/omarhanfi/todo-list/blob/main/index.html): `index.html`
- [Responsive themes](https://github.com/omarhanfi/todo-list/blob/main/css/style.css): `css/style.css`
- [Action sounds](https://github.com/omarhanfi/todo-list/tree/main/assets/sounds): `assets/sounds`

### PWA support

- [Install manifest](https://github.com/omarhanfi/todo-list/blob/main/assets/manifest.json): `assets/manifest.json`
- [Worker registration](https://github.com/omarhanfi/todo-list/blob/main/js/main.js): `js/main.js`
- [Offline worker](https://github.com/omarhanfi/todo-list/blob/main/service-worker.js): `service-worker.js`
- [Cached app shell](https://github.com/omarhanfi/todo-list/blob/main/service-worker.js): `service-worker.js`

### Other components

- **User**
- **Browser platform**

## Connections

- User → Task actions: manages tasks (evidence: `README.md`)
- Task actions → Task storage: loads and saves (evidence: `js/main.js`)
- Task actions → Task display: renders tasks (evidence: `js/main.js`)
- Task actions → Action sounds: plays effects (evidence: `js/main.js`)
- App settings → Localization: sets language (evidence: `js/main.js`)
- Task actions → Localization: translates labels (evidence: `js/main.js`)
- Localization → Locale data: fetches locales (evidence: `js/i18n.js`)
- User → App settings: chooses preferences (evidence: `README.md`)
- User → App page: uses app (evidence: `README.md`)
- App page → Responsive themes: uses styling
- Worker registration → Offline worker: registers worker (evidence: `js/main.js`)
- Offline worker → Cached app shell: caches resources (evidence: `service-worker.js`)
- Browser platform → Task storage: provides storage (evidence: `README.md`)
- Browser platform → Offline worker: runs worker (evidence: `README.md`)
- Browser platform → Install manifest: installs app (evidence: `README.md`)
