# utkarsh-singhal-26/todo-extension architecture

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

- Interactive diagram: https://gitdiagram.com/utkarsh-singhal-26/todo-extension
- Repository: https://github.com/utkarsh-singhal-26/todo-extension

## Overview

##### Main System Components

a) Web Application (packages/webapp)
b) Browser Extension (packages/extension)

##### Architecture Representation

A. Web Application (Left Side)
- React Frontend (indicated by App.tsx, main.tsx)
- Vite Build System
- Utils Layer (containing interfaces)
- TailwindCSS Styling Layer

B. Browser Extension (Right Side)
- Extension UI (React-based)
- Content Script
- Service Worker
- Extension Manifest
- Browser Integration Points

##### Component Relationships

- Communication between the webapp and extension
- Internal extension communication:
- Service Worker ↔ Content Script
- Extension UI ↔ Service Worker
- Content Script ↔ Webpage

**┌─────────────────┐    ┌─────────────────┐**
- Web App       │    │ Browser         │
- ┌─────────┐   │    │  ┌─────────┐   │
- React UI │   │    │  │Extension│   │
- ┘   │    │  │   UI    │   │
- ┌─────────┐   │    │  └─────────┘   │
- Utils   │   │    │  ┌─────────┐   │
- ┘   │    │  │Service  │   │
- ┘    │  │Worker   │   │
- ┘   │
- ┌─────────┐   │
- Content  │   │
- Script   │   │
- ┘   │
- ┘

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Monorepo
        direction TB
        
        subgraph WebApp[Web Application]
            direction TB
            ReactFE[React Frontend]:::frontend
            Utils[Utils Layer]:::utils
            TailwindCSS[TailwindCSS Styling]:::styling
            ViteBuild[Vite Build System]:::build
        end

        subgraph Extension[Browser Extension]
            direction TB
            ExtUI[Extension UI]:::frontend
            ServiceWorker{{Service Worker}}:::worker
            ContentScript[Content Script]:::script
            ExtManifest[Extension Manifest]:::config
            BrowserInt[Browser Integration]:::integration
        end

        subgraph BuildTools[Development & Build Tools]
            direction TB
            ESLint[ESLint]:::tool
            PostCSS[PostCSS]:::tool
            TypeScript[TypeScript]:::tool
            Lerna[Lerna]:::tool
            PNPM[PNPM Workspace]:::tool
        end
    end

    %% Relationships
    ReactFE --> Utils
    ReactFE --> TailwindCSS
    ReactFE --> ViteBuild
    
    ExtUI --> ServiceWorker
    ServiceWorker --> ContentScript
    ContentScript --> BrowserInt
    ExtManifest --> BrowserInt
    
    %% Click events for component mapping
    click WebApp "https://github.com/Utkarsh-Singhal-26/todo-extension/tree/main/packages/webapp/"
    click ReactFE "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/src/App.tsx"
    click Utils "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/src/utils/interfaces.ts"
    click TailwindCSS "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/tailwind.config.js"
    click ViteBuild "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/vite.config.ts"
    
    click Extension "https://github.com/Utkarsh-Singhal-26/todo-extension/tree/main/packages/extension/"
    click ExtUI "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/extension/src/App.tsx"
    click ContentScript "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/extension/src/scripts/content_script.ts"
    click ServiceWorker "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/extension/src/scripts/service_worker.ts"
    click ExtManifest "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/extension/public/manifest.json"
    click BrowserInt "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/extension/public/manifest.json"
    
    click Lerna "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/lerna.json"
    click PNPM "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/pnpm-workspace.yaml"
    click ESLint "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/eslint.config.js"
    click PostCSS "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/postcss.config.js"
    click TypeScript "https://github.com/Utkarsh-Singhal-26/todo-extension/blob/main/packages/webapp/tsconfig.json"

    %% Styling
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef utils fill:#9b59b6,stroke:#8e44ad,color:white
    classDef styling fill:#1abc9c,stroke:#16a085,color:white
    classDef build fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef worker fill:#e67e22,stroke:#d35400,color:white
    classDef script fill:#f1c40f,stroke:#f39c12,color:black
    classDef config fill:#34495e,stroke:#2c3e50,color:white
    classDef integration fill:#2ecc71,stroke:#27ae60,color:white
    classDef tool fill:#95a5a6,stroke:#7f8c8d,color:white
```
