How papermerge/papermerge-core works
Papermerge OSS is a self-hosted scanned-document management system. Users browse and organize documents in the web UI, upload supported files, and use document/page operations and metadata; OCR and indexing support full-text search. The backend exposes REST endpoints and persists domain data through SQLAlchemy, with configurable file storage. The README documents major capabilities beyond the sampled implementation. The graph therefore shows documented product-level links where source excerpts do not establish specific frontend-to-endpoint calls.
Main entry points: app.py REST application · src Web UI · nodes/router.py Folders and nodes · document/router.py Documents and pages
Components 25
Web experience
- Web UI
frontend/apps/ui/src - UI entry
frontend/apps/ui/src/main.tsx - Document viewer
frontend/packages/viewer/src/components - Search interface
frontend/apps/ui/src/features/search
Document workflows
- Document controls
frontend/apps/ui/src/features/document - File handling
frontend/apps/ui/src/features/files/fileManager.ts - Folders and nodes
papermerge/core/features/nodes/router.py - Documents and pages
papermerge/core/features/document/router.py - Full-text search
papermerge/core/features/search/router.py - Custom fields
papermerge/core/features/custom_fields/router.py - Document types
papermerge/core/features/document_types/router.py
API and access
- REST application
papermerge/app.py - Authentication and scopes
papermerge/core/features/auth - Users and groups
papermerge/core/features/users - Sharing and ownership
papermerge/core/features/shared_nodes - Audit logging
papermerge/core/features/audit/db/audit_context.py - API schemas
papermerge/core/schema.py - Runtime configuration
papermerge/core/config.py
Persistence and storage
- SQL database
- Database engine
papermerge/core/db/engine.py - Domain ORM
papermerge/core/orm.py - Ownership data access
papermerge/core/features/ownership/db/api.py - Storage backends
papermerge/storage - Media path layout
papermerge/core/pathlib.py
Other components
- User
Connections 29
- User → Web UI: uses
README.md - Web UI → UI entry: starts at
frontend/apps/ui/src/main.tsx - Web UI → REST application: uses REST API
README.md - User → REST application: requests API
README.md - Web UI → Document viewer: views documents
README.md - Web UI → Search interface: searches
README.md - Web UI → Document controls: manages pages
README.md - File handling → REST application: uploads
- REST application → Folders and nodes: registers feature routes
- REST application → Documents and pages: registers feature routes
- REST application → Full-text search: registers feature routes
- REST application → Custom fields: registers feature routes
- REST application → Document types: registers feature routes
- REST application → Runtime configuration: reads settings
papermerge/app.py - Database engine → Runtime configuration: reads settings
papermerge/core/db/engine.py - Folders and nodes → API schemas: uses schemas
papermerge/core/features/nodes/router.py - Documents and pages → API schemas: uses schemas
papermerge/core/features/document/router.py - Custom fields → API schemas: uses schemas
papermerge/core/features/custom_fields/router.py - Database engine → SQL database: connects
- Domain ORM → SQL database: maps domain data
- Ownership data access → Domain ORM: uses domain models
papermerge/core/features/ownership/db/api.py - Folders and nodes → Ownership data access: checks ownership
- Documents and pages → Storage backends: reads and writes files
papermerge/core/features/document/router.py - Storage backends → Media path layout: uses media paths
papermerge/storage/backends/cloudfront.py - Runtime configuration → Storage backends: selects backend
papermerge/storage/backends/cloudfront.py - REST application → Authentication and scopes: applies feature permissions
- REST application → Users and groups: serves user features
- REST application → Sharing and ownership: serves sharing features
- REST application → Audit logging: records audit context