How debanjan110d/pdf-toolbox works
PDF Toolbox serves browser and Telegram users through a shared document-processing engine. In the web workflow, a user selects a PDF, the workspace reads metadata locally, and tool-specific hooks process and return files in the browser; compression is routed to the worker. In Telegram, updates reach the bot, which manages commands, uploads and action state, then returns processed documents. The README documents image conversion and other tools; unsampled wiring is shown only where supported by that documentation. The worker and webhook details are based on sampled routes and server code.
Main entry points: DashboardHome.tsx Dashboard tools · index.ts PDF operations · bot.ts Bot runtime · server.ts PDF worker
Components 23
Browser app
- Tool interface
apps/web/src/app/page.tsx - Dashboard tools
apps/web/src/components/DashboardHome.tsx - File workspace
apps/web/src/hooks/usePDFWorkspace.ts - Compression tool
apps/web/src/hooks/usePDFCompress.ts - Conversion tool
apps/web/src/hooks/usePDFConvert.ts - Merge tool
apps/web/src/hooks/usePDFMerge.ts - Split tool
apps/web/src/hooks/usePDFSplit.ts - Page organizer
apps/web/src/hooks/usePDFOrganize.ts - Text extraction
apps/web/src/hooks/usePDFExtractText.ts - Compression proxy
apps/web/src/app/api/compress/route.ts - Update relay
apps/web/src/app/api/telegram-webhook/route.ts
Telegram bot
- Bot runtime
apps/telegram-bot/src/bot.ts - Command handlers
apps/telegram-bot/src/handlers/commandHandlers.ts - Action handlers
apps/telegram-bot/src/handlers/actionHandlers.ts - Document handlers
apps/telegram-bot/src/handlers/messageHandlers.ts
PDF engine
- PDF operations
packages/pdf-core/src/index.ts - Shared types
packages/shared/src/index.ts
Worker service
- PDF worker
services/pdf-worker/src/server.ts
Other components
- Browser user
- Telegram user
- Telegram service
- Ghostscript
- Poppler tools
Connections 25
- Browser user → Tool interface: uses
- Tool interface → Dashboard tools: shows
- Dashboard tools → File workspace: loads files
- File workspace → PDF operations: reads metadata
- Dashboard tools → Compression tool: selects tool
- Dashboard tools → Conversion tool: selects tool
- Dashboard tools → Merge tool: selects tool
- Dashboard tools → Split tool: selects tool
- Dashboard tools → Page organizer: selects tool
- Dashboard tools → Text extraction: selects tool
- Conversion tool → PDF operations: converts locally
- Page organizer → PDF operations: organizes locally
- Compression tool → Compression proxy: submits file
- Compression proxy → PDF worker: forwards file
- Telegram user → Telegram service: sends updates
- Telegram service → Update relay: posts update
- Update relay → Bot runtime: forwards update
- Bot runtime → Command handlers: dispatches commands
- Bot runtime → Action handlers: dispatches actions
- Bot runtime → Document handlers: dispatches messages
- Document handlers → PDF operations: processes locally
- Command handlers → PDF operations: merges documents
- Document handlers → PDF worker: requests image export
- PDF worker → Ghostscript: compresses with
- PDF worker → Poppler tools: renders with