# dexxeth/todo-app architecture

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

- Interactive diagram: https://gitdiagram.com/dexxeth/todo-app
- Repository: https://github.com/dexxeth/todo-app

## Overview

##### Project Type and Purpose
- This is a single-page, client-centric web application built with Next.js (App Router) and React, styled with Tailwind CSS, persisting data in the browser’s localStorage.
- There is no backend service or external database: all data lives in the user’s browser.

##### File Structure
- Top-level files (package.json, tsconfig.json, next.config.mjs, tailwind.config.ts) define the build, linting, TypeScript, and CSS setup.
- The `app/` directory follows Next.js 13’s App Router convention:
- `app/page.tsx`: entry point for the root route
- `app/layout.tsx`: root layout (common header/footer)
- `app/globals.css`: global styles
- `app/components/`: contains reusable UI parts (AddTask, Modal, TodoList)
- `public/`: static assets (e.g., `bgVideo.mp4`).

##### README for Additional Insights
- Features: add/edit/delete tasks; persist in localStorage.
- Tech stack: Next.js, React, TypeScript, Tailwind CSS.
- No mention of server or external APIs.

##### Main Components and Their Interactions
a. Browser Client
- Renders the Next.js/React application.
- Hosts in-memory state for current session.
- Persists task data to localStorage and retrieves it on load.
b. Next.js Framework
- Routes and server-side rendering (if used), but in this app you likely rely on CSR (Client Side Rendering).
- Handles build → static asset generation.
c. React Components
- `AddTask`: UI + form logic to create a new task.
- `TodoList`: displays tasks, contains edit/delete buttons.
- `Modal`: confirmation/edit overlay.
d. Tailwind CSS
- Utility classes applied within JSX.
e. localStorage (Browser API)
- Key–value store where tasks are serialized (e.g., JSON).

##### Architectural Patterns & Design Principles
- Component‐based UI: each concern encapsulated in its own React component.
- Unidirectional data flow: parent (`page.tsx`) → children; children invoke callbacks to update parent state.
- Persistence layer is the browser (no server).
- Next.js App Router provides file-based routing and layouts.

## Diagram (Mermaid)

```mermaid
flowchart TD
  subgraph "Build & Configuration"
    direction TB
    Pkg["package.json"]:::framework
    TS["tsconfig.json"]:::framework
    NextCfg["next.config.mjs"]:::framework
    TailwindCfg["tailwind.config.ts"]:::framework
    PostCSS["postcss.config.mjs"]:::framework
    ESLint[".eslintrc.json"]:::framework
    Build["Next.js Build"]:::framework
    Pkg --> Build
    TS --> Build
    NextCfg --> Build
    TailwindCfg --> Build
    PostCSS --> Build
    ESLint --> Build
  end

  subgraph "Client Browser"
    direction TB
    Layout["Root Layout"]:::component
    Page["Root Page"]:::component
    Styles["Global Styles"]:::static
    AddTask["AddTask Component"]:::component
    TodoList["TodoList Component"]:::component
    Modal["Modal Component"]:::component
    Video["Background Video"]:::static

    Build -->|"serves app"| Layout
    Layout -->|"renders"| Page
    Layout -->|"applies styles"| Styles
    Layout -->|"displays"| Video
    Page -->|"includes"| AddTask
    Page -->|"includes"| TodoList
    Page -->|"includes"| Modal
  end

  subgraph "Browser APIs & Storage"
    direction TB
    LocalStorage["localStorage"]:::api
  end

  AddTask -->|"save/load tasks"| LocalStorage
  TodoList -->|"save/load tasks"| LocalStorage
  Modal -->|"update tasks"| LocalStorage

  %% Click Events
  click AddTask "https://github.com/dexxeth/todo-app/blob/main/app/components/AddTask.tsx"
  click TodoList "https://github.com/dexxeth/todo-app/blob/main/app/components/TodoList.tsx"
  click Modal "https://github.com/dexxeth/todo-app/blob/main/app/components/Modal.tsx"
  click Layout "https://github.com/dexxeth/todo-app/blob/main/app/layout.tsx"
  click Page "https://github.com/dexxeth/todo-app/blob/main/app/page.tsx"
  click Styles "https://github.com/dexxeth/todo-app/blob/main/app/globals.css"
  click Video "https://github.com/dexxeth/todo-app/blob/main/public/bgVideo.mp4"
  click NextCfg "https://github.com/dexxeth/todo-app/blob/main/next.config.mjs"
  click TailwindCfg "https://github.com/dexxeth/todo-app/blob/main/tailwind.config.ts"
  click PostCSS "https://github.com/dexxeth/todo-app/blob/main/postcss.config.mjs"
  click Pkg "https://github.com/dexxeth/todo-app/blob/main/package.json"
  click TS "https://github.com/dexxeth/todo-app/blob/main/tsconfig.json"
  click ESLint "https://github.com/dexxeth/todo-app/blob/main/.eslintrc.json"

  classDef framework fill:#c2f0c2,stroke:#3d7d3d,color:#000
  classDef component fill:#cce5ff,stroke:#004085,color:#000
  classDef api fill:#fff3cd,stroke:#856404,color:#000
  classDef static fill:#e2e3e5,stroke:#6c757d,color:#000
```
