# aswin-svg/fileroom architecture

> Architecture diagram of the GitHub repository aswin-svg/fileroom, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aswin-svg/fileroom
- Repository: https://github.com/aswin-svg/fileroom

## Overview

Fileroom is a browser-based file utility site: users choose an image or PDF tool from the site and work with that tool’s page. The tree exposes image operations, PDF operations, and OCR/background-removal capabilities. The only sampled source is the service worker, which precaches the tool pages and app assets, and caches optional OCR/background assets on demand. The application logic and individual tool-page behavior were not sampled, so their processing relationships cannot be verified here.

Main entry points: [`site/sw.js`](https://github.com/aswin-svg/fileroom/blob/main/site/sw.js) (Service worker), [`site/index.html`](https://github.com/aswin-svg/fileroom/blob/main/site/index.html) (Home page), [`site/assets/app.js`](https://github.com/aswin-svg/fileroom/blob/main/site/assets/app.js) (App script), [`site/assets/styles.css`](https://github.com/aswin-svg/fileroom/blob/main/site/assets/styles.css) (Stylesheet)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shell["Site shell"]
  node_home["Home page<br/>[index.html]"]
  node_app["App script<br/>[app.js]"]
  node_styles["Stylesheet<br/>[styles.css]"]
end

subgraph group_image["Image tools"]
  node_crop["Crop image<br/>[index.html]"]
  node_compress_image["Compress image<br/>[index.html]"]
  node_resize["Resize image<br/>[index.html]"]
  node_convert["Convert image<br/>[index.html]"]
  node_background["Remove background<br/>[index.html]"]
end

subgraph group_pdf["PDF tools"]
  node_merge["Merge PDF<br/>[index.html]"]
  node_split["Split PDF<br/>[index.html]"]
  node_organize["Organize PDF<br/>[index.html]"]
  node_compress_pdf["Compress PDF<br/>[index.html]"]
  node_sign["Sign PDF<br/>[index.html]"]
  node_jpg_pdf["JPG to PDF<br/>[index.html]"]
  node_pdf_jpg["PDF to JPG<br/>[index.html]"]
  node_watermark["Watermark PDF<br/>[index.html]"]
  node_extract["Extract text<br/>[index.html]"]
end

subgraph group_offline["Offline runtime"]
  node_worker["Service worker<br/>[sw.js]"]
  node_cache[("Browser cache")]
  node_ocr_assets["OCR assets"]
  node_background_assets["Background model"]
end

node_user(("Site user"))

node_worker -->|"opens and updates"| node_cache
node_worker -->|"precaches"| node_home
node_worker -->|"precaches"| node_app
node_worker -->|"precaches"| node_styles
node_worker -->|"precaches"| node_crop
node_worker -->|"precaches"| node_compress_image
node_worker -->|"precaches"| node_resize
node_worker -->|"precaches"| node_convert
node_worker -->|"precaches"| node_background
node_worker -->|"precaches"| node_merge
node_worker -->|"precaches"| node_split
node_worker -->|"precaches"| node_organize
node_worker -->|"precaches"| node_compress_pdf
node_worker -->|"precaches"| node_sign
node_worker -->|"precaches"| node_jpg_pdf
node_worker -->|"precaches"| node_pdf_jpg
node_worker -->|"precaches"| node_watermark
node_worker -->|"precaches"| node_extract
node_worker -->|"caches on demand"| node_ocr_assets
node_worker -->|"caches on demand"| node_background_assets

click node_home "https://github.com/aswin-svg/fileroom/blob/main/site/index.html"
click node_app "https://github.com/aswin-svg/fileroom/blob/main/site/assets/app.js"
click node_styles "https://github.com/aswin-svg/fileroom/blob/main/site/assets/styles.css"
click node_crop "https://github.com/aswin-svg/fileroom/blob/main/site/crop-image/index.html"
click node_compress_image "https://github.com/aswin-svg/fileroom/blob/main/site/compress-image/index.html"
click node_resize "https://github.com/aswin-svg/fileroom/blob/main/site/resize-image/index.html"
click node_convert "https://github.com/aswin-svg/fileroom/blob/main/site/convert-image/index.html"
click node_background "https://github.com/aswin-svg/fileroom/blob/main/site/background-remover/index.html"
click node_merge "https://github.com/aswin-svg/fileroom/blob/main/site/merge-pdf/index.html"
click node_split "https://github.com/aswin-svg/fileroom/blob/main/site/split-pdf/index.html"
click node_organize "https://github.com/aswin-svg/fileroom/blob/main/site/organize-pdf/index.html"
click node_compress_pdf "https://github.com/aswin-svg/fileroom/blob/main/site/compress-pdf/index.html"
click node_sign "https://github.com/aswin-svg/fileroom/blob/main/site/sign-pdf/index.html"
click node_jpg_pdf "https://github.com/aswin-svg/fileroom/blob/main/site/jpg-to-pdf/index.html"
click node_pdf_jpg "https://github.com/aswin-svg/fileroom/blob/main/site/pdf-to-jpg/index.html"
click node_watermark "https://github.com/aswin-svg/fileroom/blob/main/site/watermark/index.html"
click node_extract "https://github.com/aswin-svg/fileroom/blob/main/site/extract-text/index.html"
click node_worker "https://github.com/aswin-svg/fileroom/blob/main/site/sw.js"
click node_ocr_assets "https://github.com/aswin-svg/fileroom/tree/main/site/assets/ocr"
click node_background_assets "https://github.com/aswin-svg/fileroom/tree/main/site/assets/background"

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_home,node_app,node_styles,node_user toneBlue
class node_crop,node_compress_image,node_resize,node_convert,node_background toneAmber
class node_merge,node_split,node_organize,node_compress_pdf,node_sign,node_jpg_pdf,node_pdf_jpg,node_watermark,node_extract toneMint
class node_worker,node_cache,node_ocr_assets,node_background_assets toneRose
```

## Components

### Site shell

- [Home page](https://github.com/aswin-svg/fileroom/blob/main/site/index.html): `site/index.html`
- [App script](https://github.com/aswin-svg/fileroom/blob/main/site/assets/app.js): `site/assets/app.js`
- [Stylesheet](https://github.com/aswin-svg/fileroom/blob/main/site/assets/styles.css): `site/assets/styles.css`

### Image tools

- [Crop image](https://github.com/aswin-svg/fileroom/blob/main/site/crop-image/index.html): `site/crop-image/index.html`
- [Compress image](https://github.com/aswin-svg/fileroom/blob/main/site/compress-image/index.html): `site/compress-image/index.html`
- [Resize image](https://github.com/aswin-svg/fileroom/blob/main/site/resize-image/index.html): `site/resize-image/index.html`
- [Convert image](https://github.com/aswin-svg/fileroom/blob/main/site/convert-image/index.html): `site/convert-image/index.html`
- [Remove background](https://github.com/aswin-svg/fileroom/blob/main/site/background-remover/index.html): `site/background-remover/index.html`

### PDF tools

- [Merge PDF](https://github.com/aswin-svg/fileroom/blob/main/site/merge-pdf/index.html): `site/merge-pdf/index.html`
- [Split PDF](https://github.com/aswin-svg/fileroom/blob/main/site/split-pdf/index.html): `site/split-pdf/index.html`
- [Organize PDF](https://github.com/aswin-svg/fileroom/blob/main/site/organize-pdf/index.html): `site/organize-pdf/index.html`
- [Compress PDF](https://github.com/aswin-svg/fileroom/blob/main/site/compress-pdf/index.html): `site/compress-pdf/index.html`
- [Sign PDF](https://github.com/aswin-svg/fileroom/blob/main/site/sign-pdf/index.html): `site/sign-pdf/index.html`
- [JPG to PDF](https://github.com/aswin-svg/fileroom/blob/main/site/jpg-to-pdf/index.html): `site/jpg-to-pdf/index.html`
- [PDF to JPG](https://github.com/aswin-svg/fileroom/blob/main/site/pdf-to-jpg/index.html): `site/pdf-to-jpg/index.html`
- [Watermark PDF](https://github.com/aswin-svg/fileroom/blob/main/site/watermark/index.html): `site/watermark/index.html`
- [Extract text](https://github.com/aswin-svg/fileroom/blob/main/site/extract-text/index.html): `site/extract-text/index.html`

### Offline runtime

- [Service worker](https://github.com/aswin-svg/fileroom/blob/main/site/sw.js): `site/sw.js`
- **Browser cache**
- [OCR assets](https://github.com/aswin-svg/fileroom/tree/main/site/assets/ocr): `site/assets/ocr`
- [Background model](https://github.com/aswin-svg/fileroom/tree/main/site/assets/background): `site/assets/background`

### Other components

- **Site user**

## Connections

- Service worker → Browser cache: opens and updates (evidence: `site/sw.js`)
- Service worker → Home page: precaches (evidence: `site/sw.js`)
- Service worker → App script: precaches (evidence: `site/sw.js`)
- Service worker → Stylesheet: precaches (evidence: `site/sw.js`)
- Service worker → Crop image: precaches (evidence: `site/sw.js`)
- Service worker → Compress image: precaches (evidence: `site/sw.js`)
- Service worker → Resize image: precaches (evidence: `site/sw.js`)
- Service worker → Convert image: precaches (evidence: `site/sw.js`)
- Service worker → Remove background: precaches (evidence: `site/sw.js`)
- Service worker → Merge PDF: precaches (evidence: `site/sw.js`)
- Service worker → Split PDF: precaches (evidence: `site/sw.js`)
- Service worker → Organize PDF: precaches (evidence: `site/sw.js`)
- Service worker → Compress PDF: precaches (evidence: `site/sw.js`)
- Service worker → Sign PDF: precaches (evidence: `site/sw.js`)
- Service worker → JPG to PDF: precaches (evidence: `site/sw.js`)
- Service worker → PDF to JPG: precaches (evidence: `site/sw.js`)
- Service worker → Watermark PDF: precaches (evidence: `site/sw.js`)
- Service worker → Extract text: precaches (evidence: `site/sw.js`)
- Service worker → OCR assets: caches on demand (evidence: `site/sw.js`)
- Service worker → Background model: caches on demand (evidence: `site/sw.js`)
