# aymenghrab-2006/todolist-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/aymenghrab-2006/todolist-v2
- Repository: https://github.com/aymenghrab-2006/todolist-v2

## Overview

This is a browser-based Eisenhower Matrix task manager: visitors create or select tasks, the app classifies and displays them by urgency and importance for today and tomorrow, and schedules urgent-important work with overflow persisted to the server. The README documents editing, completion, filtering, validation, and anonymous per-browser persistence. The sampled code shows browser scheduling/API calls and server routes, validation, cookie identity, and MongoDB access; unsampled markup is represented only where the README describes it.

Main entry points: [`server.js`](https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js) (Task API routes), [`script.js`](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js) (Load quadrants), [`index.html`](https://github.com/aymenghrab-2006/todolist-v2/blob/main/index.html) (Task page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser task app"]
  node_page["Task page<br/>[index.html]"]
  node_forms["Task forms<br/>[index.html]"]
  node_task_actions["Create and edit<br/>[script.js]"]
  node_filtered_lookup["Quadrant lookup<br/>[script.js]"]
  node_task_loading["Load quadrants<br/>[script.js]"]
  node_matrix_display["Matrix display<br/>[script.js]"]
  node_day_schedule["Daily scheduling<br/>[script.js]"]
  node_start_times["Day start times<br/>[script.js]"]
end

subgraph group_backend["Task API"]
  node_task_routes["Task API routes<br/>[server.js]"]
  node_validation["Task validation<br/>[server.js]"]
end

subgraph group_persistence["Session and storage"]
  node_session_identity["Anonymous identity<br/>[server.js]"]
  node_task_collection[("Task collection<br/>[server.js]")]
  node_browser_storage[("Local storage<br/>[script.js]")]
end

node_visitor(("Visitor"))

node_visitor -->|"uses"| node_page
node_page -->|"offers"| node_forms
node_forms -->|"submits"| node_task_actions
node_task_actions -->|"posts create/edit"| node_task_routes
node_task_routes -->|"validates"| node_validation
node_task_routes -->|"writes and reads"| node_task_collection
node_task_routes -->|"scopes requests"| node_session_identity
node_visitor -->|"selects quadrant"| node_filtered_lookup
node_filtered_lookup -->|"fetches tasks"| node_task_routes
node_task_loading -->|"fetches quadrants"| node_task_routes
node_task_loading -->|"schedules urgent tasks"| node_day_schedule
node_day_schedule -->|"saves adjournments"| node_task_routes
node_task_loading -->|"renders tasks"| node_matrix_display
node_day_schedule -->|"reads start time"| node_start_times
node_start_times -->|"stores per day"| node_browser_storage
node_task_routes -->|"deletes tasks"| node_task_collection

click node_page "https://github.com/aymenghrab-2006/todolist-v2/blob/main/index.html"
click node_forms "https://github.com/aymenghrab-2006/todolist-v2/blob/main/index.html"
click node_task_actions "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js"
click node_filtered_lookup "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js"
click node_task_loading "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js"
click node_matrix_display "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js"
click node_day_schedule "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js"
click node_start_times "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js"
click node_task_routes "https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js"
click node_validation "https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js"
click node_session_identity "https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js"
click node_task_collection "https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js"
click node_browser_storage "https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.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_page,node_forms,node_task_actions,node_filtered_lookup,node_task_loading,node_matrix_display,node_day_schedule,node_start_times toneBlue
class node_task_routes,node_validation toneAmber
class node_session_identity,node_task_collection,node_browser_storage toneMint
class node_visitor toneIndigo
```

## Components

### Browser task app

- [Task page](https://github.com/aymenghrab-2006/todolist-v2/blob/main/index.html): `index.html`
- [Task forms](https://github.com/aymenghrab-2006/todolist-v2/blob/main/index.html): `index.html`
- [Create and edit](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`
- [Quadrant lookup](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`
- [Load quadrants](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`
- [Matrix display](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`
- [Daily scheduling](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`
- [Day start times](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`

### Task API

- [Task API routes](https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js): `server.js`
- [Task validation](https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js): `server.js`

### Session and storage

- [Anonymous identity](https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js): `server.js`
- [Task collection](https://github.com/aymenghrab-2006/todolist-v2/blob/main/server.js): `server.js`
- [Local storage](https://github.com/aymenghrab-2006/todolist-v2/blob/main/script.js): `script.js`

### Other components

- **Visitor**

## Connections

- Visitor → Task page: uses (evidence: `README.md`)
- Task page → Task forms: offers (evidence: `README.md`)
- Task forms → Create and edit: submits (evidence: `script.js`)
- Create and edit → Task API routes: posts create/edit (evidence: `script.js`)
- Task API routes → Task validation: validates (evidence: `server.js`)
- Task API routes → Task collection: writes and reads (evidence: `server.js`)
- Task API routes → Anonymous identity: scopes requests (evidence: `server.js`)
- Visitor → Quadrant lookup: selects quadrant (evidence: `README.md`)
- Quadrant lookup → Task API routes: fetches tasks (evidence: `script.js`)
- Load quadrants → Task API routes: fetches quadrants (evidence: `script.js`)
- Load quadrants → Daily scheduling: schedules urgent tasks (evidence: `script.js`)
- Daily scheduling → Task API routes: saves adjournments (evidence: `script.js`)
- Load quadrants → Matrix display: renders tasks (evidence: `script.js`)
- Daily scheduling → Day start times: reads start time (evidence: `script.js`)
- Day start times → Local storage: stores per day (evidence: `README.md`)
- Task API routes → Task collection: deletes tasks (evidence: `server.js`)
