# saitejapuli/allpdfeditor architecture

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

- Interactive diagram: https://gitdiagram.com/saitejapuli/allpdfeditor
- Repository: https://github.com/saitejapuli/allpdfeditor

## Overview

PDF Hub is a browser-based PDF utility website: users browse and filter tools, open a tool, provide files and options, run a local operation, then download the result. The tool catalog spans organization, optimization, conversion, editing, and security; PDF processing is split across two operation modules. Routing, sitemap generation, and server-side error handling are supporting layers. The README and homepage emphasize private, on-device processing; the supplied excerpts show browser-based operations, but not every tool dispatch or the full contents of the second operations module.

Main entry points: [`src/routes/tool.$id.tsx`](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/tool.%24id.tsx) (Tool workspace), [`src/routeTree.gen.ts`](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routeTree.gen.ts) (Route tree), [`src/routes/index.tsx`](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/index.tsx) (Tool directory), [`src/lib/pdf-ops.ts`](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/pdf-ops.ts) (PDF operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Tool discovery"]
  node_catalog["Tool catalog<br/>[tools.ts]"]
  node_home["Tool directory<br/>[index.tsx]"]
  node_toolui["Tool workspace<br/>[tool.$id.tsx]"]
end

subgraph group_processing["PDF processing"]
  node_pdfops["PDF operations<br/>[pdf-ops.ts]"]
  node_pdfops2["Additional PDF operations<br/>[pdf-ops2.ts]"]
  node_browser(("Browser files"))
  node_downloads(("Download results"))
end

subgraph group_site["Site and routing"]
  node_header["Site header<br/>[SiteHeader.tsx]"]
  node_footer["Site footer<br/>[SiteFooter.tsx]"]
  node_root["Root layout<br/>[__root.tsx]"]
  node_router["Router setup<br/>[router.tsx]"]
  node_routeconfig["Route tree<br/>[routeTree.gen.ts]"]
  node_sitemaproute["Sitemap route<br/>[sitemap&#91;.&#93;xml.ts]"]
  node_sitemap["Sitemap data<br/>[sitemap.ts]"]
end

subgraph group_operations["Runtime support"]
  node_server["Server entry<br/>[server.ts]"]
  node_errorcapture["Error capture<br/>[error-capture.ts]"]
  node_errorpage["Error page<br/>[error-page.ts]"]
  node_reporting["Error reporting"]
  node_ai["AI functions<br/>[ai.functions.ts]"]
  node_aiserver["AI service<br/>[ai.server.ts]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses tools"| node_home
node_home -->|"filters catalog"| node_catalog
node_home -->|"opens tool"| node_toolui
node_toolui -->|"loads tool"| node_catalog
node_visitor -->|"selects files"| node_browser
node_toolui -->|"runs operation"| node_pdfops
node_toolui -.->|"runs operation"| node_pdfops2
node_pdfops -->|"reads files"| node_browser
node_pdfops -->|"produces files"| node_downloads
node_toolui -->|"offers downloads"| node_downloads
node_home -->|"renders"| node_header
node_toolui -->|"renders"| node_header
node_root -->|"renders"| node_footer
node_root -->|"configures reporting"| node_reporting
node_router -->|"uses routes"| node_routeconfig
node_routeconfig -->|"registers routes"| node_root
node_routeconfig -->|"registers routes"| node_home
node_routeconfig -->|"registers routes"| node_toolui
node_routeconfig -->|"registers routes"| node_sitemaproute
node_sitemaproute -->|"builds sitemap"| node_sitemap
node_sitemaproute -->|"uses tool catalog"| node_catalog
node_server -->|"captures errors"| node_errorcapture
node_server -->|"renders failures"| node_errorpage
node_ai -->|"calls service"| node_aiserver

click node_catalog "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/tools.ts"
click node_home "https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/index.tsx"
click node_toolui "https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/tool.%24id.tsx"
click node_pdfops "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/pdf-ops.ts"
click node_pdfops2 "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/pdf-ops2.ts"
click node_header "https://github.com/saitejapuli/allpdfeditor/blob/main/src/components/SiteHeader.tsx"
click node_footer "https://github.com/saitejapuli/allpdfeditor/blob/main/src/components/SiteFooter.tsx"
click node_root "https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/__root.tsx"
click node_router "https://github.com/saitejapuli/allpdfeditor/blob/main/src/router.tsx"
click node_routeconfig "https://github.com/saitejapuli/allpdfeditor/blob/main/src/routeTree.gen.ts"
click node_sitemaproute "https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/sitemap%5B.%5Dxml.ts"
click node_sitemap "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/sitemap.ts"
click node_server "https://github.com/saitejapuli/allpdfeditor/blob/main/src/server.ts"
click node_errorcapture "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/error-capture.ts"
click node_errorpage "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/error-page.ts"
click node_reporting "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/lovable-error-reporting.ts"
click node_ai "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/ai.functions.ts"
click node_aiserver "https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/ai.server.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_catalog,node_home,node_toolui toneBlue
class node_pdfops,node_pdfops2,node_browser,node_downloads toneAmber
class node_header,node_footer,node_root,node_router,node_routeconfig,node_sitemaproute,node_sitemap toneMint
class node_server,node_errorcapture,node_errorpage,node_reporting,node_ai,node_aiserver toneRose
class node_visitor toneIndigo
```

## Components

### Tool discovery

- [Tool catalog](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/tools.ts): `src/lib/tools.ts`
- [Tool directory](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/index.tsx): `src/routes/index.tsx`
- [Tool workspace](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/tool.%24id.tsx): `src/routes/tool.$id.tsx`

### PDF processing

- [PDF operations](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/pdf-ops.ts): `src/lib/pdf-ops.ts`
- [Additional PDF operations](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/pdf-ops2.ts): `src/lib/pdf-ops2.ts`
- **Browser files**
- **Download results**

### Site and routing

- [Site header](https://github.com/saitejapuli/allpdfeditor/blob/main/src/components/SiteHeader.tsx): `src/components/SiteHeader.tsx`
- [Site footer](https://github.com/saitejapuli/allpdfeditor/blob/main/src/components/SiteFooter.tsx): `src/components/SiteFooter.tsx`
- [Root layout](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/__root.tsx): `src/routes/__root.tsx`
- [Router setup](https://github.com/saitejapuli/allpdfeditor/blob/main/src/router.tsx): `src/router.tsx`
- [Route tree](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routeTree.gen.ts): `src/routeTree.gen.ts`
- [Sitemap route](https://github.com/saitejapuli/allpdfeditor/blob/main/src/routes/sitemap%5B.%5Dxml.ts): `src/routes/sitemap[.]xml.ts`
- [Sitemap data](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/sitemap.ts): `src/lib/sitemap.ts`

### Runtime support

- [Server entry](https://github.com/saitejapuli/allpdfeditor/blob/main/src/server.ts): `src/server.ts`
- [Error capture](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/error-capture.ts): `src/lib/error-capture.ts`
- [Error page](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/error-page.ts): `src/lib/error-page.ts`
- [Error reporting](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/lovable-error-reporting.ts): `src/lib/lovable-error-reporting.ts`
- [AI functions](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/ai.functions.ts): `src/lib/ai.functions.ts`
- [AI service](https://github.com/saitejapuli/allpdfeditor/blob/main/src/lib/ai.server.ts): `src/lib/ai.server.ts`

### Other components

- **Visitor**

## Connections

- Visitor → Tool directory: browses tools (evidence: `src/routes/index.tsx`)
- Tool directory → Tool catalog: filters catalog (evidence: `src/routes/index.tsx`)
- Tool directory → Tool workspace: opens tool (evidence: `src/routes/index.tsx`)
- Tool workspace → Tool catalog: loads tool (evidence: `src/routes/tool.$id.tsx`)
- Visitor → Browser files: selects files
- Tool workspace → PDF operations: runs operation (evidence: `src/routes/tool.$id.tsx`)
- Tool workspace → Additional PDF operations: runs operation
- PDF operations → Browser files: reads files (evidence: `src/lib/pdf-ops.ts`)
- PDF operations → Download results: produces files (evidence: `src/lib/pdf-ops.ts`)
- Tool workspace → Download results: offers downloads (evidence: `src/routes/tool.$id.tsx`)
- Tool directory → Site header: renders (evidence: `src/routes/index.tsx`)
- Tool workspace → Site header: renders (evidence: `src/routes/tool.$id.tsx`)
- Root layout → Site footer: renders (evidence: `src/routes/__root.tsx`)
- Root layout → Error reporting: configures reporting (evidence: `src/routes/__root.tsx`)
- Router setup → Route tree: uses routes (evidence: `src/router.tsx`)
- Route tree → Root layout: registers routes (evidence: `src/routeTree.gen.ts`)
- Route tree → Tool directory: registers routes (evidence: `src/routeTree.gen.ts`)
- Route tree → Tool workspace: registers routes (evidence: `src/routeTree.gen.ts`)
- Route tree → Sitemap route: registers routes (evidence: `src/routeTree.gen.ts`)
- Sitemap route → Sitemap data: builds sitemap (evidence: `src/routes/sitemap[.]xml.ts`)
- Sitemap route → Tool catalog: uses tool catalog (evidence: `src/routes/sitemap[.]xml.ts`)
- Server entry → Error capture: captures errors (evidence: `src/server.ts`)
- Server entry → Error page: renders failures (evidence: `src/server.ts`)
- AI functions → AI service: calls service (evidence: `src/lib/ai.functions.ts`)
