# ben8368/unas architecture

> Architecture diagram of the GitHub repository ben8368/unas, 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/ben8368/unas
- Repository: https://github.com/ben8368/unas

## Overview

uNAS is a local-first Manifest V3 browser-extension workspace. The main user flow begins at the New Tab desktop, launches a workspace tool, and uses browser or WebDAV-backed capabilities to manage files and tasks. Separate product branches provide downloads, media/archive tools, Link Apps, password-vault access, and ad blocking. The README documents several capabilities whose implementation was not sampled; those branches are represented at the supported directory level. Edges are limited to shown imports/calls or explicit README statements.

Main entry points: [`apps/extension/src/runtime/workspaceRouter.ts`](https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/workspaceRouter.ts) (Workspace Router), [`apps/extension/src/apps/FileManagerApp.tsx`](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/FileManagerApp.tsx) (File Manager), [`apps/extension/src/modules/adblock/engine/filter-updater.ts`](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/filter-updater.ts) (Filter Updates), [`apps/extension/src/modules/adblock/engine/repository-updater.ts`](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/repository-updater.ts) (Repository Rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop and Workspace"]
  node_desktop["New Tab Desktop<br/>[App.tsx]"]
  node_launcher["App Launcher<br/>[AppLauncher.tsx]"]
  node_workspace["Workspace Router<br/>[workspaceRouter.ts]"]
  node_linkapps["Link Apps<br/>[linkApps.ts]"]
end

subgraph group_files["Files and Downloads"]
  node_fileapp["File Manager<br/>[FileManagerApp.tsx]"]
  node_localfiles["Local Files"]
  node_davfiles["WebDAV Files<br/>[DavFilesPane.tsx]"]
  node_downloadsfiles["Browser Downloads"]
  node_cachefiles["Cache and Trash<br/>[TempCachePane.tsx]"]
  node_webdav["WebDAV Client<br/>[client.ts]"]
end

subgraph group_tools["Tool Apps"]
  node_downloader["Downloader App<br/>[DownloaderApp.tsx]"]
  node_downloadtasks["Download Task Data"]
  node_psd["PSD Tool<br/>[PsdApp.tsx]"]
  node_transcode["Transcode Tool<br/>[TranscodeApp.tsx]"]
  node_archive["Archive Worker"]
  node_music["Music Tool<br/>[MusicApp.tsx]"]
  node_musicworker["Music Worker"]
  node_password["Password Vault<br/>[client.ts]"]
end

subgraph group_security["Browser Security"]
  node_adworker["Adblock Service Worker<br/>[service-worker.ts]"]
  node_blocker["Blocking Engine<br/>[blocker.ts]"]
  node_filterupdate["Filter Updates<br/>[filter-updater.ts]"]
  node_repo["Repository Rules"]
  node_cosmetic[("Cosmetic Rules<br/>[cosmetic-store.ts]")]
  node_coscompiler["Cosmetic Compiler"]
end

node_user(("User"))
node_remote[("WebDAV Server")]
node_rulesdata["Rule Sources"]

node_user -->|"opens"| node_desktop
node_desktop -.->|"launches apps"| node_launcher
node_launcher -.->|"opens workspace"| node_workspace
node_desktop -.->|"offers shortcuts"| node_linkapps
node_workspace -.->|"hosts tools"| node_fileapp
node_fileapp -->|"renders"| node_localfiles
node_fileapp -->|"renders"| node_davfiles
node_fileapp -->|"renders"| node_downloadsfiles
node_fileapp -->|"renders"| node_cachefiles
node_davfiles -.->|"uses"| node_webdav
node_webdav -.->|"requests"| node_remote
node_downloader -.->|"loads task data"| node_downloadtasks
node_downloadtasks -.->|"observes downloads"| node_downloadsfiles
node_workspace -.->|"hosts tool"| node_psd
node_workspace -.->|"hosts tool"| node_transcode
node_workspace -.->|"uses worker"| node_archive
node_workspace -.->|"hosts tool"| node_music
node_music -.->|"uses worker"| node_musicworker
node_password -.->|"accesses vault"| node_remote
node_adworker -->|"dispatches"| node_blocker
node_adworker -->|"refreshes subscriptions"| node_filterupdate
node_adworker -->|"updates repository"| node_repo
node_filterupdate -->|"updates alongside"| node_repo
node_filterupdate -->|"builds rules"| node_cosmetic
node_repo -->|"refreshes effects"| node_cosmetic
node_cosmetic -->|"compiles filters"| node_coscompiler
node_filterupdate -->|"fetches subscriptions"| node_rulesdata
node_repo -->|"fetches repository rules"| node_rulesdata

click node_desktop "https://github.com/ben8368/unas/blob/main/apps/extension/src/App.tsx"
click node_launcher "https://github.com/ben8368/unas/blob/main/apps/extension/src/AppLauncher.tsx"
click node_workspace "https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/workspaceRouter.ts"
click node_linkapps "https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/linkApps.ts"
click node_fileapp "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/FileManagerApp.tsx"
click node_localfiles "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/LocalDirectoryPane.tsx"
click node_davfiles "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/DavFilesPane.tsx"
click node_downloadsfiles "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/BrowserDownloadsPane.tsx"
click node_cachefiles "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/TempCachePane.tsx"
click node_webdav "https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/webdav/client.ts"
click node_downloader "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/DownloaderApp.tsx"
click node_downloadtasks "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/downloader/useDownloaderTaskData.ts"
click node_psd "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/PsdApp.tsx"
click node_transcode "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/TranscodeApp.tsx"
click node_archive "https://github.com/ben8368/unas/blob/main/apps/extension/src/workers/archiveExtraction.worker.ts"
click node_music "https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/real/MusicApp.tsx"
click node_musicworker "https://github.com/ben8368/unas/blob/main/apps/extension/src/workers/musicDecrypt.worker.ts"
click node_password "https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/webdav/client.ts"
click node_adworker "https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/background/service-worker.ts"
click node_blocker "https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/blocker.ts"
click node_filterupdate "https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/filter-updater.ts"
click node_repo "https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/repository-updater.ts"
click node_cosmetic "https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/cosmetic-store.ts"
click node_coscompiler "https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/cosmetic-compiler.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_desktop,node_launcher,node_workspace,node_linkapps,node_user toneBlue
class node_fileapp,node_localfiles,node_davfiles,node_downloadsfiles,node_cachefiles,node_webdav,node_remote toneAmber
class node_downloader,node_downloadtasks,node_psd,node_transcode,node_archive,node_music,node_musicworker,node_password toneMint
class node_adworker,node_blocker,node_filterupdate,node_repo,node_cosmetic,node_coscompiler toneRose
class node_rulesdata toneIndigo
```

## Components

### Desktop and Workspace

- [New Tab Desktop](https://github.com/ben8368/unas/blob/main/apps/extension/src/App.tsx): `apps/extension/src/App.tsx`
- [App Launcher](https://github.com/ben8368/unas/blob/main/apps/extension/src/AppLauncher.tsx): `apps/extension/src/AppLauncher.tsx`
- [Workspace Router](https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/workspaceRouter.ts): `apps/extension/src/runtime/workspaceRouter.ts`
- [Link Apps](https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/linkApps.ts): `apps/extension/src/runtime/linkApps.ts`

### Files and Downloads

- [File Manager](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/FileManagerApp.tsx): `apps/extension/src/apps/FileManagerApp.tsx`
- [Local Files](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/LocalDirectoryPane.tsx): `apps/extension/src/apps/file-manager/LocalDirectoryPane.tsx`
- [WebDAV Files](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/DavFilesPane.tsx): `apps/extension/src/apps/file-manager/DavFilesPane.tsx`
- [Browser Downloads](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/BrowserDownloadsPane.tsx): `apps/extension/src/apps/file-manager/BrowserDownloadsPane.tsx`
- [Cache and Trash](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/file-manager/TempCachePane.tsx): `apps/extension/src/apps/file-manager/TempCachePane.tsx`
- [WebDAV Client](https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/webdav/client.ts): `apps/extension/src/runtime/webdav/client.ts`

### Tool Apps

- [Downloader App](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/DownloaderApp.tsx): `apps/extension/src/apps/DownloaderApp.tsx`
- [Download Task Data](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/downloader/useDownloaderTaskData.ts): `apps/extension/src/apps/downloader/useDownloaderTaskData.ts`
- [PSD Tool](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/PsdApp.tsx): `apps/extension/src/apps/PsdApp.tsx`
- [Transcode Tool](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/TranscodeApp.tsx): `apps/extension/src/apps/TranscodeApp.tsx`
- [Archive Worker](https://github.com/ben8368/unas/blob/main/apps/extension/src/workers/archiveExtraction.worker.ts): `apps/extension/src/workers/archiveExtraction.worker.ts`
- [Music Tool](https://github.com/ben8368/unas/blob/main/apps/extension/src/apps/real/MusicApp.tsx): `apps/extension/src/apps/real/MusicApp.tsx`
- [Music Worker](https://github.com/ben8368/unas/blob/main/apps/extension/src/workers/musicDecrypt.worker.ts): `apps/extension/src/workers/musicDecrypt.worker.ts`
- [Password Vault](https://github.com/ben8368/unas/blob/main/apps/extension/src/runtime/webdav/client.ts): `apps/extension/src/runtime/webdav/client.ts`

### Browser Security

- [Adblock Service Worker](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/background/service-worker.ts): `apps/extension/src/modules/adblock/background/service-worker.ts`
- [Blocking Engine](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/blocker.ts): `apps/extension/src/modules/adblock/engine/blocker.ts`
- [Filter Updates](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/filter-updater.ts): `apps/extension/src/modules/adblock/engine/filter-updater.ts`
- [Repository Rules](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/repository-updater.ts): `apps/extension/src/modules/adblock/engine/repository-updater.ts`
- [Cosmetic Rules](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/cosmetic-store.ts): `apps/extension/src/modules/adblock/engine/cosmetic-store.ts`
- [Cosmetic Compiler](https://github.com/ben8368/unas/blob/main/apps/extension/src/modules/adblock/engine/cosmetic-compiler.ts): `apps/extension/src/modules/adblock/engine/cosmetic-compiler.ts`

### Other components

- **User**
- **WebDAV Server**
- **Rule Sources**

## Connections

- User → New Tab Desktop: opens (evidence: `README.md`)
- New Tab Desktop → App Launcher: launches apps (evidence: `README.md`)
- App Launcher → Workspace Router: opens workspace (evidence: `README.md`)
- New Tab Desktop → Link Apps: offers shortcuts (evidence: `README.md`)
- Workspace Router → File Manager: hosts tools (evidence: `README.md`)
- File Manager → Local Files: renders (evidence: `apps/extension/src/apps/FileManagerApp.tsx`)
- File Manager → WebDAV Files: renders (evidence: `apps/extension/src/apps/FileManagerApp.tsx`)
- File Manager → Browser Downloads: renders (evidence: `apps/extension/src/apps/FileManagerApp.tsx`)
- File Manager → Cache and Trash: renders (evidence: `apps/extension/src/apps/FileManagerApp.tsx`)
- WebDAV Files → WebDAV Client: uses
- WebDAV Client → WebDAV Server: requests
- Downloader App → Download Task Data: loads task data (evidence: `README.md`)
- Download Task Data → Browser Downloads: observes downloads
- Workspace Router → PSD Tool: hosts tool (evidence: `README.md`)
- Workspace Router → Transcode Tool: hosts tool (evidence: `README.md`)
- Workspace Router → Archive Worker: uses worker (evidence: `README.md`)
- Workspace Router → Music Tool: hosts tool (evidence: `README.md`)
- Music Tool → Music Worker: uses worker
- Password Vault → WebDAV Server: accesses vault (evidence: `README.md`)
- Adblock Service Worker → Blocking Engine: dispatches (evidence: `apps/extension/src/modules/adblock/background/service-worker.ts`)
- Adblock Service Worker → Filter Updates: refreshes subscriptions (evidence: `apps/extension/src/modules/adblock/background/service-worker.ts`)
- Adblock Service Worker → Repository Rules: updates repository (evidence: `apps/extension/src/modules/adblock/background/service-worker.ts`)
- Filter Updates → Repository Rules: updates alongside (evidence: `apps/extension/src/modules/adblock/engine/filter-updater.ts`)
- Filter Updates → Cosmetic Rules: builds rules (evidence: `apps/extension/src/modules/adblock/engine/filter-updater.ts`)
- Repository Rules → Cosmetic Rules: refreshes effects (evidence: `apps/extension/src/modules/adblock/engine/repository-updater.ts`)
- Cosmetic Rules → Cosmetic Compiler: compiles filters (evidence: `apps/extension/src/modules/adblock/engine/cosmetic-store.ts`)
- Filter Updates → Rule Sources: fetches subscriptions (evidence: `apps/extension/src/modules/adblock/engine/filter-updater.ts`)
- Repository Rules → Rule Sources: fetches repository rules (evidence: `apps/extension/src/modules/adblock/engine/repository-updater.ts`)
