# pankajkandpall/doxdock architecture

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

- Interactive diagram: https://gitdiagram.com/pankajkandpall/doxdock
- Repository: https://github.com/pankajkandpall/doxdock

## Overview

#### Purpose and entry points
DoxDock is an offline-first, browser-only PDF, document, and image utility suite. It is a static React/Vite application: no backend, accounts, uploads, or runtime external services. Browser-local file processing is a core security boundary.
- Application bootstrap: `src/main.jsx`, `src/App.jsx`
- Static security/offline entry: `index.html`
- Production serving: `Dockerfile`, `nginx.conf`

#### Application shell and navigation
`App` composes the tool workspace, persistent navigation, and global interaction surfaces. The user selects an operation through categorized sidebar navigation or Cmd/Ctrl+K search; the chosen operation is retained as non-sensitive UI state.
- Shell: `src/App.jsx`
- Navigation/search: `src/components/Sidebar.jsx`, `src/components/CommandPalette.jsx`
- Persistence/theme hooks: `src/hooks/useLocalStorage.js`, `src/hooks/useTheme.js`

#### Registry-driven operation plugins
The central registry discovers and exposes self-contained operation folders. Each tool conventionally supplies metadata for discovery/navigation, a JSX UI, and processing helpers. This makes operation folders the extension boundary: adding a tool should not require changing the application shell.
- Discovery/registry: `src/registry/registry.js`
- Representative plugins: `src/operations/merge-pdfs/index.jsx`, `src/operations/merge-pdfs/meta.js`, `src/operations/merge-pdfs/helpers.js`
- Other domains: `src/operations/compress-image/`, `src/operations/edit-pdf/`, `src/operations/word-to-pdf/`

#### Job, file-input, and result flow
Operations accept local `File` inputs through shared dropzone/list UI, maintain operation progress and status through a job hook, then present generated artifacts for preview and download. File bytes remain in browser memory; only theme and last-used tool are persisted.
- Input UI: `src/components/Dropzone.jsx`, `src/components/FileList.jsx`
- Job lifecycle: `src/hooks/useJob.js`, `src/components/Progress.jsx`
- Result/download UI: `src/components/ResultGallery.jsx`, `src/components/DownloadButton.jsx`

#### Local document and image processing
Operation helpers orchestrate bundled client-side libraries and browser APIs. PDF workflows include manipulation, rendering, extraction, form filling, and conversion; image workflows use Canvas/re-encoding for transforms and metadata stripping. Long-running PDF rendering and image compression use workers where supported to preserve UI responsiveness.
- PDF worker integration: `src/lib/pdfjs.js`
- Shared PDF/text/layout capabilities: `src/lib/extractText.js`, `src/lib/pdfLayout.js`, `src/lib/markdown.js`
- Shared image capabilities: `src/lib/imageCanvas.js`, `src/lib/imageFormat.js`
- Packaging/export: `src/lib/download.js`, `src/lib/zip.js`

#### Privacy and network boundary
The application’s privacy model is enforced by static delivery and CSP: `index.html` restricts connections to same origin, while all dependencies, icons, WebAssembly, and the PDF worker are locally bundled. There are no application APIs or remote processing services. The browser is the material runtime, using Canvas and Web Crypto alongside bundled PDF/document/image libraries.
- CSP/static document: `index.html`
- Local-worker boundary: `src/lib/pdfjs.js`
- Privacy status UI: `src/components/PrivacyBadge.jsx`

#### Build, PWA, and deployment
Vite builds the React application into static assets; PWA support enables offline installation and caching after initial load. Development requires Node 18+, but production is a multi-stage static image served by nginx, with Docker Compose exposing host port 8791.
- Build/runtime configuration: `vite.config.js`, `package.json`
- Container delivery: `Dockerfile`, `docker-compose.yml`
- Static-server policy: `nginx.conf`

Main entry points: [`src/operations/merge-pdfs/index.jsx`](https://github.com/pankajkandpall/doxdock/blob/main/src/operations/merge-pdfs/index.jsx) (Operation folders), [`src/App.jsx`](https://github.com/pankajkandpall/doxdock/blob/main/src/App.jsx) (App workspace), [`vite.config.js`](https://github.com/pankajkandpall/doxdock/blob/main/vite.config.js) (Vite build), [`index.html`](https://github.com/pankajkandpall/doxdock/blob/main/index.html) (Static document & CSP)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_delivery["Build &amp; Delivery"]
  node_vite{{"Vite build<br/>[vite.config.js]"}}
  node_container["Static container<br/>deployment"]
  node_nginx["nginx policy<br/>static server<br/>[nginx.conf]"]
  node_pwa["PWA support<br/>offline caching<br/>[package.json]"]
end

subgraph group_shell["Application Shell"]
  node_bootstrap["React bootstrap<br/>entry point<br/>[main.jsx]"]
  node_app["App workspace<br/>application shell<br/>[App.jsx]"]
  node_sidebar["Sidebar navigation<br/>navigation UI<br/>[Sidebar.jsx]"]
  node_command["Command palette<br/>search UI<br/>[CommandPalette.jsx]"]
  node_ui_state["Theme &amp; tool state<br/>local UI state<br/>[useLocalStorage.js]"]
  node_file_input["Local file input<br/>input UI<br/>[Dropzone.jsx]"]
  node_job["Job lifecycle<br/>operation state<br/>[useJob.js]"]
  node_results["Results &amp; download<br/>result UI<br/>[ResultGallery.jsx]"]
end

subgraph group_operations["Operation Plugins"]
  node_registry{{"Operation registry<br/>plugin discovery<br/>[registry.js]"}}
  node_plugins["Operation folders<br/>plugin boundary<br/>[index.jsx]"]
end

subgraph group_processing["Local Processing"]
  node_pdf_worker["Local PDF worker<br/>worker integration<br/>[pdfjs.js]"]
  node_pdf_tools["PDF text &amp; layout<br/>PDF capability<br/>[extractText.js]"]
  node_image_tools["Canvas image processing<br/>image capability<br/>[imageCanvas.js]"]
  node_export["Download &amp; ZIP export<br/>artifact packaging<br/>[download.js]"]
end

subgraph group_browser["Browser Boundary"]
  node_document["Static document &amp; CSP<br/>security boundary<br/>[index.html]"]
  node_privacy["Privacy badge<br/>privacy UI<br/>[PrivacyBadge.jsx]"]
end

node_vite -->|"builds"| node_bootstrap
node_vite -->|"configures"| node_pwa
node_vite -->|"static assets"| node_container
node_container -->|"serves with"| node_nginx
node_nginx -->|"delivers"| node_document
node_document -->|"loads locally"| node_bootstrap
node_document -.->|"CSP permits local worker"| node_pdf_worker
node_bootstrap -->|"mounts"| node_app
node_app -->|"includes"| node_sidebar
node_app -->|"includes"| node_command
node_app -->|"uses"| node_ui_state
node_sidebar -->|"lists tools"| node_registry
node_command -->|"searches tools"| node_registry
node_registry -->|"discovers"| node_plugins
node_app -->|"renders selected tool"| node_plugins
node_plugins -->|"accepts files through"| node_file_input
node_plugins -->|"runs via"| node_job
node_job -->|"produces artifacts"| node_results
node_plugins -->|"PDF rendering"| node_pdf_worker
node_plugins -->|"PDF processing"| node_pdf_tools
node_plugins -->|"image processing"| node_image_tools
node_plugins -->|"packages output"| node_export
node_app -->|"shows"| node_privacy

click node_vite "https://github.com/pankajkandpall/doxdock/blob/main/vite.config.js"
click node_container "https://github.com/pankajkandpall/doxdock/tree/main/Dockerfile"
click node_nginx "https://github.com/pankajkandpall/doxdock/blob/main/nginx.conf"
click node_pwa "https://github.com/pankajkandpall/doxdock/blob/main/package.json"
click node_document "https://github.com/pankajkandpall/doxdock/blob/main/index.html"
click node_bootstrap "https://github.com/pankajkandpall/doxdock/blob/main/src/main.jsx"
click node_app "https://github.com/pankajkandpall/doxdock/blob/main/src/App.jsx"
click node_sidebar "https://github.com/pankajkandpall/doxdock/blob/main/src/components/Sidebar.jsx"
click node_command "https://github.com/pankajkandpall/doxdock/blob/main/src/components/CommandPalette.jsx"
click node_ui_state "https://github.com/pankajkandpall/doxdock/blob/main/src/hooks/useLocalStorage.js"
click node_registry "https://github.com/pankajkandpall/doxdock/blob/main/src/registry/registry.js"
click node_plugins "https://github.com/pankajkandpall/doxdock/blob/main/src/operations/merge-pdfs/index.jsx"
click node_file_input "https://github.com/pankajkandpall/doxdock/blob/main/src/components/Dropzone.jsx"
click node_job "https://github.com/pankajkandpall/doxdock/blob/main/src/hooks/useJob.js"
click node_results "https://github.com/pankajkandpall/doxdock/blob/main/src/components/ResultGallery.jsx"
click node_pdf_worker "https://github.com/pankajkandpall/doxdock/blob/main/src/lib/pdfjs.js"
click node_pdf_tools "https://github.com/pankajkandpall/doxdock/blob/main/src/lib/extractText.js"
click node_image_tools "https://github.com/pankajkandpall/doxdock/blob/main/src/lib/imageCanvas.js"
click node_export "https://github.com/pankajkandpall/doxdock/blob/main/src/lib/download.js"
click node_privacy "https://github.com/pankajkandpall/doxdock/blob/main/src/components/PrivacyBadge.jsx"

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_vite,node_container,node_nginx,node_pwa toneBlue
class node_bootstrap,node_app,node_sidebar,node_command,node_ui_state,node_file_input,node_job,node_results toneAmber
class node_registry,node_plugins toneMint
class node_pdf_worker,node_pdf_tools,node_image_tools,node_export toneRose
class node_document,node_privacy toneIndigo
```

## Components

### Build & Delivery

- [Vite build](https://github.com/pankajkandpall/doxdock/blob/main/vite.config.js): build · Builds the React app into static assets. · `vite.config.js`
- [Static container](https://github.com/pankajkandpall/doxdock/tree/main/Dockerfile): deployment · Multi-stage production image served by nginx. · `Dockerfile`
- [nginx policy](https://github.com/pankajkandpall/doxdock/blob/main/nginx.conf): static server · `nginx.conf`
- [PWA support](https://github.com/pankajkandpall/doxdock/blob/main/package.json): offline caching · Enables installation and offline use after initial load. · `package.json`

### Application Shell

- [React bootstrap](https://github.com/pankajkandpall/doxdock/blob/main/src/main.jsx): entry point · `src/main.jsx`
- [App workspace](https://github.com/pankajkandpall/doxdock/blob/main/src/App.jsx): application shell · Composes navigation, the selected tool, and global surfaces. · `src/App.jsx`
- [Sidebar navigation](https://github.com/pankajkandpall/doxdock/blob/main/src/components/Sidebar.jsx): navigation UI · `src/components/Sidebar.jsx`
- [Command palette](https://github.com/pankajkandpall/doxdock/blob/main/src/components/CommandPalette.jsx): search UI · `src/components/CommandPalette.jsx`
- [Theme & tool state](https://github.com/pankajkandpall/doxdock/blob/main/src/hooks/useLocalStorage.js): local UI state · Only theme and last-used tool are persisted. · `src/hooks/useLocalStorage.js`
- [Local file input](https://github.com/pankajkandpall/doxdock/blob/main/src/components/Dropzone.jsx): input UI · Accepts browser-local File objects. · `src/components/Dropzone.jsx`
- [Job lifecycle](https://github.com/pankajkandpall/doxdock/blob/main/src/hooks/useJob.js): operation state · Tracks operation status and progress. · `src/hooks/useJob.js`
- [Results & download](https://github.com/pankajkandpall/doxdock/blob/main/src/components/ResultGallery.jsx): result UI · Previews and downloads generated local artifacts. · `src/components/ResultGallery.jsx`

### Operation Plugins

- [Operation registry](https://github.com/pankajkandpall/doxdock/blob/main/src/registry/registry.js): plugin discovery · Discovers tool metadata and exposes operation modules. · `src/registry/registry.js`
- [Operation folders](https://github.com/pankajkandpall/doxdock/blob/main/src/operations/merge-pdfs/index.jsx): plugin boundary · Self-contained UI, metadata, and helpers implement each operation. · `src/operations/merge-pdfs/index.jsx`

### Local Processing

- [Local PDF worker](https://github.com/pankajkandpall/doxdock/blob/main/src/lib/pdfjs.js): worker integration · Uses the bundled PDF worker for responsive rendering. · `src/lib/pdfjs.js`
- [PDF text & layout](https://github.com/pankajkandpall/doxdock/blob/main/src/lib/extractText.js): PDF capability · Shared extraction, layout, and markdown capabilities. · `src/lib/extractText.js`
- [Canvas image processing](https://github.com/pankajkandpall/doxdock/blob/main/src/lib/imageCanvas.js): image capability · Transforms, re-encodes, and strips metadata locally. · `src/lib/imageCanvas.js`
- [Download & ZIP export](https://github.com/pankajkandpall/doxdock/blob/main/src/lib/download.js): artifact packaging · `src/lib/download.js`

### Browser Boundary

- [Static document & CSP](https://github.com/pankajkandpall/doxdock/blob/main/index.html): security boundary · Restricts connections to same origin and loads local assets. · `index.html`
- [Privacy badge](https://github.com/pankajkandpall/doxdock/blob/main/src/components/PrivacyBadge.jsx): privacy UI · Communicates local-only processing. · `src/components/PrivacyBadge.jsx`

## Connections

- Vite build → React bootstrap: builds
- Vite build → PWA support: configures
- Vite build → Static container: static assets
- Static container → nginx policy: serves with
- nginx policy → Static document & CSP: delivers
- Static document & CSP → React bootstrap: loads locally
- Static document & CSP → Local PDF worker: CSP permits local worker
- React bootstrap → App workspace: mounts
- App workspace → Sidebar navigation: includes
- App workspace → Command palette: includes
- App workspace → Theme & tool state: uses
- Sidebar navigation → Operation registry: lists tools
- Command palette → Operation registry: searches tools
- Operation registry → Operation folders: discovers
- App workspace → Operation folders: renders selected tool
- Operation folders → Local file input: accepts files through
- Operation folders → Job lifecycle: runs via
- Job lifecycle → Results & download: produces artifacts
- Operation folders → Local PDF worker: PDF rendering
- Operation folders → PDF text & layout: PDF processing
- Operation folders → Canvas image processing: image processing
- Operation folders → Download & ZIP export: packages output
- App workspace → Privacy badge: shows
