How sm-joe/papershift-doc-converter works
PaperShift is a self-hosted document conversion service: a browser uses the Next.js interface to submit files to a Go API, which detects formats and runs conversions in ephemeral workspaces. The graph also preserves the documented capability-discovery and specialized PDF, image, and DOCX operations. Relationships are limited to the README and shown source references; some API-to-service links are supported by indexed API files whose excerpts were not provided.
Main entry points: service.go Job orchestration · handler.go HTTP routes · application.go Application setup · registry.go Converter registry
Components 18
Web client
- Web application
apps/web/src/app/page.tsx
API surface
- API server
apps/api/main.go - HTTP routes
internal/api/handler.go - Application setup
internal/api/application.go - Capabilities
internal/converter/capabilities.go
Conversion processing
- Format registry
internal/formats/registry.go - Format detection
internal/detection/detector.go - Job orchestration
internal/jobs/service.go - Job workspaces
internal/jobs/workspace.go - Result store
internal/jobs/store.go - Converter registry
internal/converter/registry.go
Conversion engines
- LibreOffice engine
engines/libreoffice/libreoffice.go - Image conversion
engines/imagemagick/imagemagick.go - PDF conversion
engines/pdf/pdf.go
File operations
- PDF operations
internal/pdf/merge.go - Image compression
internal/image/compress.go - DOCX compression
internal/docx/compress.go
Other components
- Browser
Connections 26
- Browser → Web application: uses
README.md - Web application → API server: submits files
README.md - API server → Application setup: configures
apps/api/main.go - API server → HTTP routes: serves
apps/api/main.go - Application setup → Converter registry: registers engines
internal/api/application.go - Application setup → Job orchestration: creates service
internal/api/application.go - Application setup → Format detection: creates detector
internal/api/application.go - Application setup → Format registry: loads formats
internal/api/application.go - Application setup → Result store: creates store
internal/api/application.go - HTTP routes → Capabilities: reports capabilities
internal/api/handler.go - Job orchestration → Format detection: detects input
internal/jobs/service.go - Job orchestration → Format registry: resolves output
internal/jobs/service.go - Job orchestration → Converter registry: selects converter
internal/jobs/service.go - Job orchestration → Job workspaces: creates workspace
internal/jobs/service.go - Converter registry → LibreOffice engine: dispatches
- Converter registry → Image conversion: dispatches
- Converter registry → PDF conversion: dispatches
- HTTP routes → Job orchestration: handles conversions
- HTTP routes → Result store: serves downloads
- HTTP routes → PDF operations: handles PDF tasks
- HTTP routes → Image compression: handles compression
- HTTP routes → DOCX compression: handles compression
- Job orchestration → PDF operations: runs PDF tasks
internal/jobs/service.go - Job orchestration → Image compression: compresses images
internal/jobs/service.go - Job orchestration → DOCX compression: compresses DOCX
internal/jobs/service.go - DOCX compression → Image compression: compresses embedded images
internal/docx/compress.go