# alyssaxuu/omni architecture

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

- Interactive diagram: https://gitdiagram.com/alyssaxuu/omni
- Repository: https://github.com/alyssaxuu/omni

## Overview

##### Main Components

a) Browser Extension Components:
- Popup Interface (content.html, content.js, content.css)
- Background Service (background.js)
- New Tab Integration (newtab.html)
- Event Handlers (focus.js)

b) Browser API Integrations:
- Tabs Management
- Bookmarks System
- History API
- Commands System

c) External Integrations:
- Notion
- Figma
- Docs
- Asana

**┌─ User Interface Layer ─────────────────────┐**
- Command Interface (content.html)         │
- Styling (content.css)                   │
- New Tab Interface (newtab.html)         │
- ┬───────────────────────┘
- ↓
**┌─ Application Logic Layer ──────────────────┐**
- Content Script (content.js)             │
- Focus Management (focus.js)             │
- Background Service (background.js)       │
- ┬───────────────────────┘
- ↓
**┌─ Browser API Integration Layer ────────────┐**
- Tabs API                                │
- Bookmarks API                           │
- History API                             │
- Commands API                            │
- ┬───────────────────────┘
- ↓
**┌─ External Services Layer ─────────────────┐**
- Notion Integration                      │
- Figma Integration                       │
- Docs Integration                        │
- Asana Integration                       │
- ┘

##### Important Elements to Highlight

a) Command Flow:
- How user commands are processed from the UI through the application logic
- How commands are routed to different APIs

b) Event Handling:
- Background service's role in managing browser events
- How focus management works with the UI

c) Data Flow:
- Demonstrate how data moves between the extension and browser APIs
- Interaction patterns with external services

##### Technical Details

- jQuery dependency for DOM manipulation
- dom-focus-lock integration for input field focus
- Browser-specific manifest configurations
- Asset management (nice-select.css)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph UI["User Interface Layer"]
        CMD["Command Interface"]
        STYLE["UI Styling"]
        NTAB["New Tab Interface"]
    end

    subgraph AL["Application Logic Layer"]
        CS["Content Script"]
        FM["Focus Management"]
        BS["Background Service"]
        JQ["jQuery DOM Manipulation"]
    end

    subgraph API["Browser API Integration Layer"]
        TABS["Tabs API"]
        BOOK["Bookmarks API"]
        HIST["History API"]
        COMM["Commands API"]
    end

    subgraph EXT["External Services Layer"]
        NOT["Notion Integration"]
        FIG["Figma Integration"]
        DOC["Docs Integration"]
        ASA["Asana Integration"]
    end

    %% Connections
    CMD --> CS
    STYLE --> CMD
    NTAB --> CS
    CS --> FM
    CS --> BS
    CS --> JQ
    BS --> TABS
    BS --> BOOK
    BS --> HIST
    BS --> COMM
    TABS --> NOT
    TABS --> FIG
    TABS --> DOC
    TABS --> ASA

    %% Click Events
    click CMD "https://github.com/alyssaxuu/omni/blob/master/src/content.html"
    click STYLE "https://github.com/alyssaxuu/omni/blob/master/src/content.css"
    click NTAB "https://github.com/alyssaxuu/omni/blob/master/src/newtab.html"
    click CS "https://github.com/alyssaxuu/omni/blob/master/src/content.js"
    click FM "https://github.com/alyssaxuu/omni/blob/master/src/focus.js"
    click BS "https://github.com/alyssaxuu/omni/blob/master/src/background.js"
    click JQ "https://github.com/alyssaxuu/omni/blob/master/src/jquery.js"

    %% Styling
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef logic fill:#2ecc71,stroke:#27ae60,color:white
    classDef api fill:#e67e22,stroke:#d35400,color:white
    classDef external fill:#9b59b6,stroke:#8e44ad,color:white

    class CMD,STYLE,NTAB ui
    class CS,FM,BS,JQ logic
    class TABS,BOOK,HIST,COMM api
    class NOT,FIG,DOC,ASA external

    %% Legend
    subgraph Legend
        UI_L["UI Component"]:::ui
        LOG_L["Logic Component"]:::logic
        API_L["Browser API"]:::api
        EXT_L["External Service"]:::external
    end
```
