# vallimuthuraja-git/focus-exe architecture

> Architecture diagram of the GitHub repository vallimuthuraja-git/focus-exe, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vallimuthuraja-git/focus-exe
- Repository: https://github.com/vallimuthuraja-git/focus-exe

## Overview

Focus Exe is an on-demand Manifest V3 Pomodoro extension. The user summons a page widget; its content script loads and reconciles persisted state, coordinates timer actions and audio, renders focus/break and deadline clocks, and reports completed sessions to the service worker for notification. Settings also route users to the product page or repository. The graph covers the documented product-page capability, but its HTML behavior was not sampled; the runtime wiring shown here is based on the README and source excerpts.

Main entry points: [`src/background.ts`](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/background.ts) (Service worker), [`src/content.ts`](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/content.ts) (Content controller), [`src/widget.ts`](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/widget.ts) (Widget shell), [`src/settings.ts`](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/settings.ts) (Settings panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Extension entry"]
  node_background["Service worker<br/>[background.ts]"]
  node_content["Content controller<br/>[content.ts]"]
end

subgraph group_runtime["Widget runtime"]
  node_config["Timer configuration<br/>[config.ts]"]
  node_state["Timer state<br/>[state.ts]"]
  node_browser["API wrappers<br/>[browser.ts]"]
  node_audio["Audio engine<br/>[audio.ts]"]
end

subgraph group_presentation["Widget presentation"]
  node_widget["Widget shell<br/>[widget.ts]"]
  node_clock["Flip clocks<br/>[clock.ts]"]
  node_settings["Settings panel<br/>[settings.ts]"]
  node_ui["Shared UI builders<br/>[ui.ts]"]
end

subgraph group_platform["Platform services"]
  node_storage[("Extension storage")]
  node_browser_api["Browser extension APIs"]
  node_notifications["Desktop notifications"]
end

subgraph group_support["Support"]
  node_product_page["Product page<br/>[index.html]"]
  node_repository["Source repository"]
end

node_user(("User"))

node_user -->|"summons widget"| node_background
node_background -->|"injects script"| node_browser_api
node_background -->|"injects or toggles"| node_content
node_content -->|"loads and saves"| node_state
node_state -->|"reads and writes"| node_browser
node_browser -->|"accesses"| node_storage
node_content -->|"creates and renders"| node_widget
node_content -->|"unlocks and syncs"| node_audio
node_content -->|"sends completion"| node_background
node_background -->|"creates notification"| node_notifications
node_widget -->|"creates and updates"| node_clock
node_widget -->|"creates panels"| node_settings
node_settings -->|"builds controls"| node_ui
node_widget -->|"builds controls"| node_ui
node_user -->|"opens about"| node_product_page
node_settings -.->|"routes link action"| node_content
node_content -->|"requests support link"| node_background
node_background -->|"opens support page"| node_product_page
node_background -->|"opens GitHub"| node_repository
node_background -->|"queries tabs"| node_browser_api

click node_background "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/background.ts"
click node_content "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/content.ts"
click node_config "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/config.ts"
click node_state "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/state.ts"
click node_browser "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/browser.ts"
click node_audio "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/audio.ts"
click node_widget "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/widget.ts"
click node_clock "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/clock.ts"
click node_settings "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/settings.ts"
click node_ui "https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/ui.ts"
click node_product_page "https://github.com/vallimuthuraja-git/focus-exe/blob/main/page/index.html"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_background,node_content,node_user toneBlue
class node_config,node_state,node_browser,node_audio toneAmber
class node_widget,node_clock,node_settings,node_ui toneMint
class node_storage,node_browser_api,node_notifications toneRose
class node_product_page,node_repository toneIndigo
```

## Components

### Extension entry

- [Service worker](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/background.ts): `src/background.ts`
- [Content controller](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/content.ts): `src/content.ts`

### Widget runtime

- [Timer configuration](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/config.ts): `src/config.ts`
- [Timer state](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/state.ts): `src/state.ts`
- [API wrappers](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/browser.ts): `src/browser.ts`
- [Audio engine](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/audio.ts): `src/audio.ts`

### Widget presentation

- [Widget shell](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/widget.ts): `src/widget.ts`
- [Flip clocks](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/clock.ts): `src/clock.ts`
- [Settings panel](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/settings.ts): `src/settings.ts`
- [Shared UI builders](https://github.com/vallimuthuraja-git/focus-exe/blob/main/src/ui.ts): `src/ui.ts`

### Platform services

- **Extension storage**
- **Browser extension APIs**
- **Desktop notifications**

### Support

- [Product page](https://github.com/vallimuthuraja-git/focus-exe/blob/main/page/index.html): `page/index.html`
- **Source repository**

### Other components

- **User**

## Connections

- User → Service worker: summons widget (evidence: `README.md`)
- Service worker → Browser extension APIs: injects script (evidence: `src/background.ts`)
- Service worker → Content controller: injects or toggles (evidence: `src/background.ts`)
- Content controller → Timer state: loads and saves (evidence: `src/content.ts`)
- Timer state → API wrappers: reads and writes (evidence: `src/state.ts`)
- API wrappers → Extension storage: accesses (evidence: `src/browser.ts`)
- Content controller → Widget shell: creates and renders (evidence: `src/content.ts`)
- Content controller → Audio engine: unlocks and syncs (evidence: `src/content.ts`)
- Content controller → Service worker: sends completion (evidence: `src/content.ts`)
- Service worker → Desktop notifications: creates notification (evidence: `src/background.ts`)
- Widget shell → Flip clocks: creates and updates (evidence: `src/widget.ts`)
- Widget shell → Settings panel: creates panels (evidence: `src/widget.ts`)
- Settings panel → Shared UI builders: builds controls (evidence: `src/settings.ts`)
- Widget shell → Shared UI builders: builds controls (evidence: `src/widget.ts`)
- User → Product page: opens about (evidence: `README.md`)
- Settings panel → Content controller: routes link action
- Content controller → Service worker: requests support link (evidence: `src/content.ts`)
- Service worker → Product page: opens support page (evidence: `src/background.ts`)
- Service worker → Source repository: opens GitHub (evidence: `src/background.ts`)
- Service worker → Browser extension APIs: queries tabs (evidence: `src/background.ts`)
