Skip to content

feat: implement PDF upload support and text extraction#126

Merged
Rayan9064 merged 1 commit into
mainfrom
feat/pdf-upload
Jul 21, 2026
Merged

feat: implement PDF upload support and text extraction#126
Rayan9064 merged 1 commit into
mainfrom
feat/pdf-upload

Conversation

@Rayan9064

@Rayan9064 Rayan9064 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added PDF uploads as a new resource type.
    • Supports optional titles, notes, visibility settings, and collection assignment.
    • Extracts and indexes readable PDF content for search and discovery.
    • Enforces a 10 MB file-size limit and validates PDF files.
    • Displays PDF-specific labels and styling in the resource dashboard.
  • Bug Fixes

    • Provides clear handling for invalid, empty, corrupted, or protected PDFs.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dumpit Ready Ready Preview, Comment Jul 21, 2026 4:07pm

@Rayan9064
Rayan9064 merged commit 38ffc04 into main Jul 21, 2026
4 of 5 checks passed
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bc5ea5c7-5810-4e3e-82bc-71ac4a1e1cc3

📥 Commits

Reviewing files that changed from the base of the PR and between c3a18ed and 795ae7d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • app/api/_utils/pdfExtractor.ts
  • app/api/resources/pdf/route.ts
  • app/components/AddResource.tsx
  • app/components/Dashboard.tsx
  • package.json

📝 Walkthrough

Walkthrough

Adds PDF upload support across the interface and API. PDFs are validated, parsed into text, stored as resources with metadata, indexed asynchronously, and displayed with PDF-specific dashboard labels and styling.

Changes

PDF resource upload

Layer / File(s) Summary
PDF extraction utility
app/api/_utils/pdfExtractor.ts, package.json
Adds extractTextFromPdf with whitespace cleanup, character truncation, page metadata, and parsing error handling; adds PDF parsing dependencies.
PDF upload API
app/api/resources/pdf/route.ts
Adds authenticated, rate-limited PDF upload handling with file validation, text extraction, Firestore persistence, background indexing, and error responses.
PDF upload interface
app/components/AddResource.tsx
Adds PDF selection, size validation, title and note fields, FormData submission, state reset, and PDF-specific form controls.
PDF resource display
app/components/Dashboard.tsx
Adds PDF-specific tag styling and fallback labels for resources without external links.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AddResource
  participant PDFRoute
  participant PDFExtractor
  participant Firestore
  participant Indexer

  User->>AddResource: Select PDF and submit form
  AddResource->>PDFRoute: Send authenticated FormData
  PDFRoute->>PDFExtractor: Extract text and metadata
  PDFExtractor-->>PDFRoute: Return cleaned PDF content
  PDFRoute->>Firestore: Store resource and indexing state
  PDFRoute->>Indexer: Start background indexing
  PDFRoute-->>AddResource: Return stored resource
  AddResource-->>User: Reset form and open share modal
Loading

Possibly related PRs

  • Rayan9064/dumpit#120: Adds the authenticated rate-limiting utilities used by the new PDF upload endpoint.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/pdf-upload

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Rayan9064
Rayan9064 deleted the feat/pdf-upload branch July 23, 2026 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant