# francodoce12/task_mananger_ext architecture

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

- Interactive diagram: https://gitdiagram.com/francodoce12/task_mananger_ext
- Repository: https://github.com/francodoce12/task_mananger_ext

## Overview

##### Project type and purpose
- This is a Chrome Extension (“Task Manager Extension”) built with React, React Flow, Tailwind CSS, and Webpack.
- It provides two primary user interfaces:
- A lightweight action popup (src/action)
- A full “Editor” UI (src/editor) for interactive tree-based task management
- It also includes multiple service‐worker scripts for scheduling alarms and sending notifications (src/serviceWorkers).

##### File structure
- Top-level build/config files
- webpack.config.js, webpack.dev.js, webpack.prod.js – compile/bundle React code into the build folder
- tailwind.config.js, postcss.config.js – CSS processing
- package.json – NPM scripts, dependencies
- src/action – HTML + JS for the Chrome “browser_action” popup
- src/editor – React-based editor app
- editorApp.js – root of the editor
- editorComponents – modular React components (baseInput, sideBar, task tree viewer, task form, etc.)
- src/hooks – reusable React hooks (business logic for tasks, nodes, main container)
- src/serviceWorkers – background scripts
- alarmServices.js – schedule alarms via chrome.alarms
- notyServices.js – send chrome.notifications
- taskServices.js – sync with chrome.storage
- startUp.js – initialize or migrate storage on install/update
- src/constants – enums and other constants
- src/static – fonts & manifest.json
- Tailwind CSS entry (tailwind.css)
- Build artifacts in build/ (not shown)

##### README for additional insights
- Confirms use of React + React Flow for node-based UI
- Data is persisted in Chrome extension local storage (chrome.storage.local)
- Two major use cases: quick popup vs. full editor
- Developer workflow uses webpack dev server (port 3000) and auto-reload

a. Main components
1. Chrome Extension Host
2. Action Popup UI
3. Editor UI
4. Background Service Worker
5. Browser Storage (chrome.storage.local)
6. Chrome APIs (chrome.alarms, chrome.notifications)
7. Bundling & Build Pipeline (Webpack, PostCSS/Tailwind)
b. Relationships & interactions
- From popup: “Open Editor” → Editor UI opens in a new tab/popup
- Both UIs read/write tasks via Messaging API to Background Service Worker
- Service Worker persists data in chrome.storage.local
- Service Worker schedules alarms (chrome.alarms API) based on task deadlines
- On alarm trigger, service worker issues notifications (chrome.notifications API)
- Editor UI uses React Flow to render task tree, uses hooks to fetch/update tasks
c. Architectural patterns & design principles
- Modular React component hierarchy (editorComponents)
- Separation of concerns: UI layers vs. background logic vs. storage
- Pub/Sub style via chrome.runtime messaging
- Build-time CSS processing (Tailwind + PostCSS)
d. Key technologies & libraries
- React, React Flow (tree UI)
- Tailwind CSS, PostCSS
- Webpack (dev & prod configs)
- Chrome Extension APIs (storage, runtime messaging, alarms, notifications)

##### Key takeaways
- Three runtimes: Popup, Editor, Service Worker
- How React/React Flow and hooks power the Editor UI
- Chrome API interactions in the background script
- Build pipeline feeding into the final extension package

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Actors and external
    User["User"]:::external
    ChromeAlarms["chrome.alarms API"]:::external
    ChromeNotifications["chrome.notifications API"]:::external
    ChromeStorage["chrome.storage.local"]:::storage

    %% Build Pipeline
    subgraph "Build & Bundling Pipeline"
        direction TB
        Webpack["Webpack (webpack.config.js,<br>webpack.dev.js,webpack.prod.js)"]:::build
        TailwindCSS["PostCSS & Tailwind CSS<br>(postcss.config.js,<br>tailwind.config.js,src/tailwind.css)"]:::build
        NPM["package.json"]:::build
    end

    Webpack -->|bundles assets| TailwindCSS
    TailwindCSS -->|generates CSS| NPM
    NPM -->|produces extension package| ExtensionBoundary

    %% Chrome Extension Boundary
    subgraph "Chrome Extension" 
        direction TB
        ExtensionBoundary["Extension Package"]:::external

        subgraph "Action Popup UI" 
            direction TB
            ActionHTML["action.html"]:::ui
            ActionJS["action.js"]:::ui
            ActionButton["actionButton.js"]:::ui
        end

        subgraph "Editor UI"
            direction TB
            EditorHTML["editor.html"]:::ui
            EditorApp["editorApp.js"]:::ui
            EditorJS["editor.js"]:::ui
            subgraph "editorComponents" 
                direction TB
                BaseInput["baseInput.js"]:::ui
                SharedComponents["sharedComponents.js"]:::ui
                SideBar["sideBar.js"]:::ui
                CreateNewTask["CreateNewTask.js"]:::ui
                ShowTaskTreeView["ShowTaskTreeView.js"]:::ui
                SideBarTask["SideBarTask.js"]:::ui
                TaskForm["TaskForm.js"]:::ui
                IsActiveButton["isActiveButton.js"]:::ui
                TaskDetail["taskDetail.js"]:::ui
                TaskViewer["taskViewer.js"]:::ui
            end
        end

        subgraph "Background Service Worker"
            direction TB
            StartUp["startUp.js"]:::logic
            AlarmServices["alarmServices.js"]:::logic
            NotyServices["notyServices.js"]:::logic
            TaskServices["taskServices.js"]:::logic
        end

        subgraph "Reusable Hooks"
            direction TB
            MainContainerLogic["useMainContainerLogic.js"]:::logic
            NodesLogic["useNodesLogic.js"]:::logic
            TasksHook["useTasks.js"]:::logic
        end

        Constants["enums.js"]:::logic

        %% Internal interactions
        User -->|clicks toolbar icon| ActionHTML
        ActionHTML -->|loads script| ActionJS
        ActionButton -->|UI action| TaskServices

        ActionJS -->|message| TaskServices
        EditorApp -->|message| TaskServices
        EditorJS -->|loads root| EditorApp

        EditorApp -->|uses hooks| MainContainerLogic
        EditorApp -->|uses hooks| NodesLogic
        EditorApp -->|uses hooks| TasksHook

        TaskServices -->|persist data| ChromeStorage
        StartUp -->|migrate/init| ChromeStorage
        AlarmServices -->|schedule| ChromeAlarms
        ChromeAlarms -->|trigger events| AlarmServices
        AlarmServices -->|invoke| NotyServices
        NotyServices -->|notify| ChromeNotifications
        ChromeNotifications -->|alert| User

        Constants -->|shared| EditorApp
        Constants -->|shared| StartUp

        %% Editor UI tree
        EditorApp --> EditorHTML
        EditorApp --> EditorJS
        EditorApp --> BaseInput
        EditorApp --> SharedComponents
        EditorApp --> SideBar
        EditorApp --> CreateNewTask
        EditorApp --> ShowTaskTreeView
        EditorApp --> SideBarTask
        EditorApp --> TaskForm
        EditorApp --> IsActiveButton
        EditorApp --> TaskDetail
        EditorApp --> TaskViewer

        %% UI to Service Worker messaging
        ActionJS --> TaskServices
        EditorApp --> TaskServices

        %% Build pipeline to extension
        ExtensionBoundary --> ActionHTML
        ExtensionBoundary --> EditorHTML
        ExtensionBoundary --> StartUp
        ExtensionBoundary --> AlarmServices
        ExtensionBoundary --> NotyServices
        ExtensionBoundary --> TaskServices

    end

    %% Click events
    click ActionHTML "https://github.com/francodoce12/task_mananger_ext/blob/master/src/action/action.html"
    click ActionJS "https://github.com/francodoce12/task_mananger_ext/blob/master/src/action/action.js"
    click ActionButton "https://github.com/francodoce12/task_mananger_ext/blob/master/src/action/actionButton.js"
    click EditorHTML "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editor.html"
    click EditorApp "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorApp.js"
    click EditorJS "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editor.js"
    click BaseInput "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/baseInput.js"
    click SharedComponents "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/sharedComponents.js"
    click SideBar "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/sideBar.js"
    click CreateNewTask "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskComponents/CreateNewTask.js"
    click ShowTaskTreeView "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskComponents/ShowTaskTreeView.js"
    click SideBarTask "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskComponents/SideBarTask.js"
    click TaskForm "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskComponents/TaskForm.js"
    click IsActiveButton "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskComponents/isActiveButton.js"
    click TaskDetail "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskComponents/taskDetail.js"
    click TaskViewer "https://github.com/francodoce12/task_mananger_ext/blob/master/src/editor/editorComponents/taskViewer.js"
    click StartUp "https://github.com/francodoce12/task_mananger_ext/blob/master/src/serviceWorkers/startUp.js"
    click AlarmServices "https://github.com/francodoce12/task_mananger_ext/blob/master/src/serviceWorkers/alarmServices.js"
    click NotyServices "https://github.com/francodoce12/task_mananger_ext/blob/master/src/serviceWorkers/notyServices.js"
    click TaskServices "https://github.com/francodoce12/task_mananger_ext/blob/master/src/serviceWorkers/taskServices.js"
    click MainContainerLogic "https://github.com/francodoce12/task_mananger_ext/blob/master/src/hooks/useMainContainerLogic.js"
    click NodesLogic "https://github.com/francodoce12/task_mananger_ext/blob/master/src/hooks/useNodesLogic.js"
    click TasksHook "https://github.com/francodoce12/task_mananger_ext/blob/master/src/hooks/useTasks.js"
    click Constants "https://github.com/francodoce12/task_mananger_ext/blob/master/src/constants/enums.js"
    click TailwindCSS "https://github.com/francodoce12/task_mananger_ext/blob/master/postcss.config.js"
    click TailwindCSS "https://github.com/francodoce12/task_mananger_ext/blob/master/tailwind.config.js"
    click TailwindCSS "https://github.com/francodoce12/task_mananger_ext/blob/master/src/tailwind.css"
    click Webpack "https://github.com/francodoce12/task_mananger_ext/blob/master/webpack.config.js"
    click Webpack "https://github.com/francodoce12/task_mananger_ext/blob/master/webpack.dev.js"
    click Webpack "https://github.com/francodoce12/task_mananger_ext/blob/master/webpack.prod.js"
    click NPM "https://github.com/francodoce12/task_mananger_ext/blob/master/package.json"

    %% Styles
    classDef ui fill:#D0E8FF,stroke:#0053A0,color:#0053A0;
    classDef logic fill:#D4F7D4,stroke:#2E8B57,color:#2E8B57;
    classDef external fill:#FFE5B4,stroke:#FF8C00,color:#FF8C00;
    classDef storage fill:#E0E0E0,stroke:#7F7F7F,color:#7F7F7F;
    classDef build fill:#F2D7FF,stroke:#9B30FF,color:#9B30FF;
```
