# saya-ch/weblinuxos architecture

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

- Interactive diagram: https://gitdiagram.com/saya-ch/weblinuxos
- Repository: https://github.com/saya-ch/weblinuxos

## Overview

WebLinuxOS is a browser-based Linux-style desktop: users open the desktop, find or launch an application, and work within managed windows. Its major product areas include terminal commands, persistent virtual files, developer tools, live-data applications, and browser-based offline/cross-tab capabilities. The README documents these capabilities; sampled source confirms the desktop composition, lazy window rendering, app registry, storage implementation, and API fetch behavior. Individual application wiring and several platform subsystems were not sampled, so those connections are shown only where supported.

Main entry points: [`web-linux/src/components/desktop/WindowManager.tsx`](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/components/desktop/WindowManager.tsx) (Window Manager), [`web-linux/src/store/storageUtils.ts`](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/store/storageUtils.ts) (Storage Utilities), [`web-linux/src/App.tsx`](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/App.tsx) (Desktop App), [`web-linux/src/main.tsx`](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/main.tsx) (React Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Desktop Shell"]
  node_entry["React Entry<br/>[main.tsx]"]
  node_app["Desktop App<br/>[App.tsx]"]
  node_registry["App Registry<br/>[apps.tsx]"]
  node_windows["Window Manager<br/>[WindowManager.tsx]"]
  node_desktop_ui["Desktop UI"]
end

subgraph group_apps["Applications"]
  node_terminal["Terminal<br/>[Terminal.tsx]"]
  node_terminal_storage["Storage Commands<br/>[storageCommands.ts]"]
  node_file_manager["Virtual Files<br/>[FileManager.tsx]"]
  node_developer_tools["Developer Tools"]
  node_ai_tools["AI Tools"]
  node_live_apps["Live Data Apps"]
  node_productivity["Productivity Apps"]
end

subgraph group_state["Local State"]
  node_storage_utils["Storage Utilities<br/>[storageUtils.ts]"]
  node_indexeddb[("IndexedDB Files")]
  node_browser_storage[("Browser Storage")]
end

subgraph group_integrations["Browser Integrations"]
  node_browser["Browser Platform"]
  node_service_worker["Offline Worker<br/>[sw.js]"]
  node_other_tabs(("Other Tabs"))
end

subgraph group_data["Live Data"]
  node_api_service["API Service<br/>[apiService.ts]"]
  node_public_apis["Public APIs"]
end

node_user(("User"))

node_user -->|"opens"| node_entry
node_entry -->|"renders"| node_app
node_app -->|"searches apps"| node_registry
node_app -->|"renders windows"| node_windows
node_app -->|"renders shell"| node_desktop_ui
node_user -->|"uses"| node_terminal
node_user -->|"manages files"| node_file_manager
node_windows -->|"loads app"| node_terminal
node_windows -->|"loads app"| node_file_manager
node_windows -->|"loads app"| node_developer_tools
node_windows -->|"loads app"| node_ai_tools
node_windows -->|"loads app"| node_live_apps
node_windows -->|"loads app"| node_productivity
node_terminal -->|"dispatches commands"| node_terminal_storage
node_terminal_storage -->|"reads and writes"| node_storage_utils
node_file_manager -->|"persists files"| node_storage_utils
node_storage_utils -->|"reads and writes"| node_indexeddb
node_storage_utils -->|"fallback storage"| node_browser_storage
node_indexeddb -->|"uses IndexedDB"| node_browser
node_storage_utils -->|"uses Storage API"| node_browser
node_entry -->|"registers worker"| node_service_worker
node_service_worker -->|"caches offline assets"| node_browser
node_browser -.->|"syncs via channel"| node_other_tabs
node_api_service -->|"fetches live data"| node_public_apis
node_api_service -->|"uses fetch"| node_browser

click node_entry "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/main.tsx"
click node_app "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/App.tsx"
click node_registry "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps.tsx"
click node_windows "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/components/desktop/WindowManager.tsx"
click node_desktop_ui "https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/components/desktop"
click node_terminal "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps/Terminal.tsx"
click node_terminal_storage "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps/terminal/storageCommands.ts"
click node_file_manager "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps/FileManager.tsx"
click node_developer_tools "https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps"
click node_ai_tools "https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps"
click node_live_apps "https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps"
click node_productivity "https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps"
click node_storage_utils "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/store/storageUtils.ts"
click node_indexeddb "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/store/indexedDBStorage.ts"
click node_api_service "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/services/apiService.ts"
click node_service_worker "https://github.com/saya-ch/weblinuxos/blob/main/web-linux/public/sw.js"

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_entry,node_app,node_registry,node_windows,node_desktop_ui,node_user toneBlue
class node_terminal,node_terminal_storage,node_file_manager,node_developer_tools,node_ai_tools,node_live_apps,node_productivity toneAmber
class node_storage_utils,node_indexeddb,node_browser_storage toneMint
class node_browser,node_service_worker,node_other_tabs toneRose
class node_api_service,node_public_apis toneIndigo
```

## Components

### Desktop Shell

- [React Entry](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/main.tsx): `web-linux/src/main.tsx`
- [Desktop App](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/App.tsx): `web-linux/src/App.tsx`
- [App Registry](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps.tsx): `web-linux/src/apps.tsx`
- [Window Manager](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/components/desktop/WindowManager.tsx): `web-linux/src/components/desktop/WindowManager.tsx`
- [Desktop UI](https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/components/desktop): `web-linux/src/components/desktop`

### Applications

- [Terminal](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps/Terminal.tsx): `web-linux/src/apps/Terminal.tsx`
- [Storage Commands](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps/terminal/storageCommands.ts): `web-linux/src/apps/terminal/storageCommands.ts`
- [Virtual Files](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/apps/FileManager.tsx): `web-linux/src/apps/FileManager.tsx`
- [Developer Tools](https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps): `web-linux/src/apps`
- [AI Tools](https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps): `web-linux/src/apps`
- [Live Data Apps](https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps): `web-linux/src/apps`
- [Productivity Apps](https://github.com/saya-ch/weblinuxos/tree/main/web-linux/src/apps): `web-linux/src/apps`

### Local State

- [Storage Utilities](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/store/storageUtils.ts): `web-linux/src/store/storageUtils.ts`
- [IndexedDB Files](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/store/indexedDBStorage.ts): `web-linux/src/store/indexedDBStorage.ts`
- **Browser Storage**

### Browser Integrations

- **Browser Platform**
- [Offline Worker](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/public/sw.js): `web-linux/public/sw.js`
- **Other Tabs**

### Live Data

- [API Service](https://github.com/saya-ch/weblinuxos/blob/main/web-linux/src/services/apiService.ts): `web-linux/src/services/apiService.ts`
- **Public APIs**

### Other components

- **User**

## Connections

- User → React Entry: opens
- React Entry → Desktop App: renders
- Desktop App → App Registry: searches apps
- Desktop App → Window Manager: renders windows
- Desktop App → Desktop UI: renders shell
- User → Terminal: uses
- User → Virtual Files: manages files
- Window Manager → Terminal: loads app
- Window Manager → Virtual Files: loads app
- Window Manager → Developer Tools: loads app
- Window Manager → AI Tools: loads app
- Window Manager → Live Data Apps: loads app
- Window Manager → Productivity Apps: loads app
- Terminal → Storage Commands: dispatches commands
- Storage Commands → Storage Utilities: reads and writes
- Virtual Files → Storage Utilities: persists files
- Storage Utilities → IndexedDB Files: reads and writes
- Storage Utilities → Browser Storage: fallback storage
- IndexedDB Files → Browser Platform: uses IndexedDB
- Storage Utilities → Browser Platform: uses Storage API
- React Entry → Offline Worker: registers worker
- Offline Worker → Browser Platform: caches offline assets
- Browser Platform → Other Tabs: syncs via channel
- API Service → Public APIs: fetches live data
- API Service → Browser Platform: uses fetch
