How genie-experiments/pdf-parsing works
PDF Parser turns uploaded PDFs into cleaned Markdown and layout data. Its principal SaaS workflow runs from browser upload, through API validation and queueing, to an ARQ worker that executes the Dolphin and post-processing pipeline, stores results, and exposes progress and outputs to the browser. The same pipeline also has a standalone CLI and a Streamlit interface. Edges based on the README describe the end-to-end service flow; source-level links use the supplied excerpts or SOURCE INDEX, so unsampled internals are summarized rather than inferred in detail.
Main entry points: jobs.py Job routes · post_processing Post-processing · page.tsx Job results view · tasks.py ARQ job tasks
Components 27
Web application
- Upload and job UI
frontend/app/page.tsx - Job results view
frontend/app/jobs/[id]/page.tsx - PDF viewer
frontend/components/pdf-viewer/PdfViewer.tsx - Markdown viewer
frontend/components/markdown-viewer/MarkdownPanel.tsx - API client
frontend/lib/api.ts - Login and session
frontend/app/login/page.tsx
API and jobs
- FastAPI application
backend/main.py - Auth routes
backend/api/routes/auth.py - Job routes
backend/api/routes/jobs.py - Token validation
backend/core/auth.py - Live log stream
backend/api/routes/jobs.py
Worker and pipeline
- ARQ job tasks
backend/worker/tasks.py - Pipeline runner
backend/worker/pipeline.py - Standalone CLI
pipeline/main.py - Streamlit interface
pipeline/app.py
PDF processing
- Dolphin inference
pipeline/process_pdf_files/process_pdf_files.py - Post-processing
pipeline/post_processing - OCR correction
pipeline/post_processing/fix_ocr_errors/fix_ocr_errors.py - Section hierarchy
pipeline/post_processing/markdown_sections_post_processing/section_hierarchy_from_pdf.py - Segment refinement
pipeline/post_processing/process_json_files.py - Markdown cleanup
pipeline/post_processing/fix_bullet_points/fix_bullet_points.py
Persistence and events
- Postgres job data
backend/core/database.py - User page quota
backend/models/user_quota.py - MinIO object store
backend/core/storage.py - Redis queue and logs
Other components
- PDF user
- Google OAuth
Connections 34
- PDF user → Upload and job UI: uploads PDF
README.md - Upload and job UI → API client: submits job
README.md - API client → Job routes: requests jobs
README.md - FastAPI application → Job routes: registers routes
backend/main.py - FastAPI application → Auth routes: registers routes
backend/main.py - Auth routes → Google OAuth: OAuth exchange
backend/api/routes/auth.py - Login and session → API client: checks session
- Job routes → MinIO object store: stores uploads
README.md - Job routes → Postgres job data: records jobs
README.md - Job routes → User page quota: checks quota
README.md - Job routes → Redis queue and logs: enqueues task
README.md - Job routes → ARQ job tasks: dispatches task
README.md - ARQ job tasks → MinIO object store: downloads PDF
README.md - ARQ job tasks → Pipeline runner: runs pipeline
backend/worker/tasks.py - Pipeline runner → Redis queue and logs: publishes logs
backend/worker/pipeline.py - Pipeline runner → Dolphin inference: runs inference
backend/worker/pipeline.py - Pipeline runner → Post-processing: runs cleanup
backend/worker/pipeline.py - Post-processing → OCR correction: corrects text
pipeline/main.py - Post-processing → Section hierarchy: builds hierarchy
pipeline/main.py - Post-processing → Segment refinement: refines segments
backend/worker/pipeline.py - Post-processing → Markdown cleanup: fixes formatting
pipeline/main.py - ARQ job tasks → MinIO object store: uploads results
README.md - ARQ job tasks → Postgres job data: updates status
README.md - Redis queue and logs → Live log stream: streams logs
README.md - Live log stream → Job results view: delivers log stream
README.md - Job results view → API client: polls job
README.md - Job results view → MinIO object store: fetches results
README.md - Job results view → PDF viewer: renders PDF
README.md - Job results view → Markdown viewer: renders Markdown
README.md - PDF user → Standalone CLI: runs locally
README.md - Standalone CLI → Dolphin inference: starts inference
pipeline/main.py - Standalone CLI → Post-processing: runs steps
pipeline/main.py - Streamlit interface → Dolphin inference: runs inference
pipeline/app.py - Streamlit interface → Post-processing: runs pipeline
pipeline/app.py