# hritik-6918/task-manager-limetray architecture

> Architecture diagram of the GitHub repository hritik-6918/task-manager-limetray, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hritik-6918/task-manager-limetray
- Repository: https://github.com/hritik-6918/task-manager-limetray

## Overview

- Entry Point & Build Tool: Start with the entry HTML file (index.html) and the main entry point (src/main.tsx), which bootstraps the React application using Vite.
- Application Shell: Represent src/App.tsx as the central component that orchestrates rendering the different UI parts.
- TaskForm: Handles adding new tasks.
- TaskList: Displays tasks and allows reordering, completing, or deleting.
- TaskFilter: Provides filtering options for tasks.
- ThemeToggle: Manages the UI theme switch (dark/light mode).
- State Management: Include blocks for each context:
- TaskContext (src/context/TaskContext.tsx): Manages all task-related state.
- ThemeContext (src/context/ThemeContext.tsx): Manages theme (light/dark mode) state.
- Custom Hooks: Include the useLocalStorage hook (src/hooks/useLocalStorage.ts), which likely manages local storage persistence for tasks or theme settings.
- Type Definitions: Although not a runtime component, represent the types (src/types/task.ts) that enforce data structures across the application.

##### Relationships and Data Flow
- App.tsx acts as a container and composes the individual UI components (TaskForm, TaskList, TaskFilter, ThemeToggle).
- That the TaskContext also interacts with the custom hook (useLocalStorage) to persist tasks locally.
- Similarly, TaskFilter, TaskList, and TaskForm should be associated with TaskContext indicating data flow (e.g., add, delete, reorder operations).

##### Architectural Patterns
- Component-based Architecture: Clearly distinguish each React component as a modular, reusable unit.
- Context-based State Management: Highlight that state is managed and shared using Context, indicating a centralized management of the application’s core state.
- Separation of Concerns: The separation among components, hooks, and context files demonstrates the emphasis on keeping concerns separated (UI handling, state management, type safety).

##### Technologies & Frameworks
- Frontend Framework: React (components and virtual DOM).
- Language: TypeScript (with type definitions as seen in the types directory).
- Build Tool: Vite (as supported by vite.config.ts).
- Code Quality: ESLint configuration (eslint.config.js) and TypeScript linting are integrated for code quality.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Entry & Bootstrap"
        indexHTML("index.html"):::entry
        mainTSX("main.tsx"):::entry
        indexHTML -->|"loads"| mainTSX
    end

    subgraph "Application Shell"
        app("App Component"):::shell
    end

    subgraph "UI Components"
        taskForm("TaskForm"):::ui
        taskList("TaskList"):::ui
        taskFilter("TaskFilter"):::ui
        themeToggle("ThemeToggle"):::ui
    end

    subgraph "State Management"
        taskContext("TaskContext"):::context
        themeContext("ThemeContext"):::context
    end

    subgraph "Utilities"
        localStorage("useLocalStorage"):::hook
        taskTypes("Task Types"):::types
    end

    mainTSX -->|"renders"| app
    app -->|"composes"| taskForm
    app -->|"composes"| taskList
    app -->|"composes"| taskFilter
    app -->|"composes"| themeToggle

    taskForm -->|"uses"| taskContext
    taskList -->|"uses"| taskContext
    taskFilter -->|"uses"| taskContext
    themeToggle -->|"toggles"| themeContext
    taskContext -->|"persists"| localStorage

    %% Click Events
    click indexHTML "https://github.com/hritik-6918/task-manager-limetray/blob/main/index.html"
    click mainTSX "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/main.tsx"
    click app "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/App.tsx"
    click taskForm "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/components/TaskForm.tsx"
    click taskList "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/components/TaskList.tsx"
    click taskFilter "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/components/TaskFilter.tsx"
    click themeToggle "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/components/ThemeToggle.tsx"
    click taskContext "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/context/TaskContext.tsx"
    click themeContext "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/context/ThemeContext.tsx"
    click localStorage "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/hooks/useLocalStorage.ts"
    click taskTypes "https://github.com/hritik-6918/task-manager-limetray/blob/main/src/types/task.ts"

    %% Styles
    classDef entry fill:#f9d5bb,stroke:#d9534f,stroke-width:2px;
    classDef shell fill:#d1ecf1,stroke:#0c5460,stroke-width:2px;
    classDef ui fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef context fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef hook fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef types fill:#d6d8d9,stroke:#1b1e21,stroke-width:2px;
```
