# kumarianushka0024-dotcom/tabsync architecture

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

- Interactive diagram: https://gitdiagram.com/kumarianushka0024-dotcom/tabsync
- Repository: https://github.com/kumarianushka0024-dotcom/tabsync

## Overview

TabSync is a browser settings app whose main workflow loads persisted preferences, renders appearance and language settings, then saves user changes and broadcasts versioned updates to other tabs. The main module also validates and orders received updates, measures delivery time, and applies accepted settings. The README documents these capabilities; the excerpts confirm the local-storage and BroadcastChannel paths. The no-flash startup claim is documented, but the sampled code applies settings after rendering the dashboard, so that behavior is not represented as a separate implementation.

Main entry points: [`src/main.ts`](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts) (Settings dashboard), [`src/services/storage.ts`](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/services/storage.ts) (Settings persistence), [`src/types/settings.ts`](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/types/settings.ts) (Settings defaults and type)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Settings interface"]
  node_app["Settings dashboard<br/>[main.ts]"]
  node_settings_controls["Settings controls<br/>[main.ts]"]
  node_language["Language translations<br/>[main.ts]"]
end

subgraph group_sync["Cross-tab synchronization"]
  node_tab_channel["BroadcastChannel"]
  node_conflict["Update validation and ordering<br/>[main.ts]"]
  node_delivery_time["Delivery-time measurement<br/>[main.ts]"]
end

subgraph group_persistence["Settings persistence"]
  node_storage_api[("LocalStorage")]
  node_settings_storage["Settings persistence<br/>[storage.ts]"]
end

subgraph group_domain["Settings model"]
  node_settings_model["Settings defaults and type<br/>[settings.ts]"]
end

node_user(("Browser user"))
node_tab(("Other browser tabs"))

node_user -->|"changes settings"| node_settings_controls
node_settings_controls -->|"updates and renders"| node_app
node_app -->|"loads preferences"| node_settings_storage
node_settings_storage -->|"reads and writes"| node_storage_api
node_settings_storage -->|"uses defaults and type"| node_settings_model
node_app -->|"uses settings type"| node_settings_model
node_app -->|"applies translations"| node_language
node_app -->|"saves settings"| node_settings_storage
node_app -->|"broadcasts updates"| node_tab_channel
node_tab_channel -->|"delivers updates"| node_tab
node_tab -->|"sends updates"| node_tab_channel
node_tab_channel -->|"dispatches messages"| node_conflict
node_conflict -->|"measures accepted update"| node_delivery_time
node_conflict -->|"persists accepted settings"| node_settings_storage
node_conflict -->|"applies accepted settings"| node_app

click node_app "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts"
click node_settings_controls "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts"
click node_language "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts"
click node_conflict "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts"
click node_delivery_time "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts"
click node_settings_storage "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/services/storage.ts"
click node_settings_model "https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/types/settings.ts"

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_app,node_settings_controls,node_language,node_user,node_tab toneBlue
class node_tab_channel,node_conflict,node_delivery_time toneAmber
class node_storage_api,node_settings_storage toneMint
class node_settings_model toneRose
```

## Components

### Settings interface

- [Settings dashboard](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts): `src/main.ts`
- [Settings controls](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts): `src/main.ts`
- [Language translations](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts): `src/main.ts`

### Cross-tab synchronization

- **BroadcastChannel**
- [Update validation and ordering](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts): `src/main.ts`
- [Delivery-time measurement](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/main.ts): `src/main.ts`

### Settings persistence

- **LocalStorage**
- [Settings persistence](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/services/storage.ts): `src/services/storage.ts`

### Settings model

- [Settings defaults and type](https://github.com/kumarianushka0024-dotcom/tabsync/blob/main/src/types/settings.ts): `src/types/settings.ts`

### Other components

- **Browser user**
- **Other browser tabs**

## Connections

- Browser user → Settings controls: changes settings (evidence: `src/main.ts`)
- Settings controls → Settings dashboard: updates and renders (evidence: `src/main.ts`)
- Settings dashboard → Settings persistence: loads preferences (evidence: `src/main.ts`)
- Settings persistence → LocalStorage: reads and writes (evidence: `src/services/storage.ts`)
- Settings persistence → Settings defaults and type: uses defaults and type (evidence: `src/services/storage.ts`)
- Settings dashboard → Settings defaults and type: uses settings type (evidence: `src/main.ts`)
- Settings dashboard → Language translations: applies translations (evidence: `src/main.ts`)
- Settings dashboard → Settings persistence: saves settings (evidence: `src/main.ts`)
- Settings dashboard → BroadcastChannel: broadcasts updates (evidence: `src/main.ts`)
- BroadcastChannel → Other browser tabs: delivers updates (evidence: `README.md`)
- Other browser tabs → BroadcastChannel: sends updates (evidence: `README.md`)
- BroadcastChannel → Update validation and ordering: dispatches messages (evidence: `src/main.ts`)
- Update validation and ordering → Delivery-time measurement: measures accepted update (evidence: `src/main.ts`)
- Update validation and ordering → Settings persistence: persists accepted settings (evidence: `src/main.ts`)
- Update validation and ordering → Settings dashboard: applies accepted settings (evidence: `src/main.ts`)
