Skip to content
moah0911Public

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CURD - PDF Operating System

Enterprise-grade PDF processing. 100% client-side. No server. No limits.

Version License Build

🎯 What is CURD?

CURD is a production-ready PDF operating system that runs entirely in your browser. It provides 20+ powerful PDF tools with AI-powered command interface, all processed locally with zero server costs.

Key Features:

  • ✅ 100% Client-side processing (no API keys, no server costs)
  • ✅ 20+ PDF tools (merge, split, compress, convert, sign, protect, OCR, edit, etc.)
  • ✅ AI natural language commands ("merge these files", "compress PDF")
  • ✅ Desktop app (Linux AppImage via Tauri)
  • ✅ Pure black & white UI (minimal, professional)
  • ✅ Handles 100MB+ files via Web Workers
  • ✅ Desktop-first with resizable 3-panel layout
  • ✅ Zero configuration deployment

🚀 Quick Start

Web (Browser)

# Clone repository
git clone <repository-url>
cd curd-pdf-os

# Install dependencies
npm install

# Start development server
npm run dev

# Open http://localhost:3000

Desktop App (Linux)

# Install Tauri prerequisites (Rust + system deps)
# See DESKTOP.md for detailed instructions

# Run in development mode
npm run tauri:dev

# Build AppImage
npm run tauri:build

📦 Deployment

Vercel (Recommended)

  1. Push to GitHub

    git init
    git add .
    git commit -m "Initial commit"
    git push origin main
  2. Import to Vercel

    • Go to vercel.com
    • Click "New Project"
    • Import your GitHub repository
    • Framework: Next.js
    • Build Command: next build
    • Output Directory: dist
    • Click "Deploy"
  3. Done! Your PDF OS is live.

Netlify

  1. Build locally

    npm run build
  2. Deploy

    • Go to netlify.com
    • Drag the dist folder to the deploy dropzone
    • Or use Netlify CLI: netlify deploy --prod --dir=dist

Other Static Hosts

The dist folder contains a fully static website. Upload to any static host.

🛠️ The 20+ Tools

Core Operations

Tool Description AI Command Example
Merge Combine multiple PDFs into one "merge all PDFs"
Split Extract pages by range or count "split every 5 pages"
Compress Reduce file size (metadata removal, structure optimization) "compress the document"
Organize Rotate, delete, reorder pages "delete page 3, rotate page 2"

Content Editing

Tool Description AI Command Example
Edit Add text overlays to PDF "add text header"
Edit Content Edit existing PDF text content "edit text on page 1"
Edit Formatted Edit with formatting preserved "edit document preserving styles"
Watermark Add text/image stamps "add watermark DRAFT 50%"
Sign Digital & visual signatures "sign page 1"

Protection & Security

Tool Description AI Command Example
Protect Password encryption "protect with password"
Unlock Remove password protection "unlock the PDF"
Repair Fix corrupted PDFs "repair document"

Conversion

Tool Description AI Command Example
PDF→Images Convert pages to PNG/JPG "convert to images"
Images→PDF Combine images into PDF "images to PDF"
PDF→Office Convert to Word/Excel/PPT "convert to Word"
Office→PDF Convert documents to PDF "document to PDF"

Extraction & OCR

Tool Description AI Command Example
OCR Optical Character Recognition "extract text from scanned PDF"
Extract Content Extract pages with specific content "extract pages with 'contract'"
Extract Images Extract embedded images "get all images from PDF"
Extract Context Smart content-based extraction "extract invoices"
Extract Tables Extract tables to CSV/Excel/JSON "extract tables to Excel"

🤖 AI Commands

The AI assistant understands natural language commands with multi-tool workflows:

"merge these files"                      → Merge tool
"compress with high quality"             → Compress (high)
"split every 10 pages"                   → Split (every 10)
"add watermark CONFIDENTIAL 30%"         → Watermark
"convert to Word document"               → PDF to DOCX
"extract pages 5-10"                     → Split (range)
"protect with password secret123"        → Protect
"rotate page 3 by 90 degrees"            → Organize
"ocr this document and save as searchable" → OCR + Save
"merge then watermark then compress"     → Multi-tool workflow

Smart Features:

  • Typo correction ("mrege" → "merge")
  • Contradiction detection (prevents "merge then split")
  • Context extraction (page numbers, formats, quality levels)
  • Multi-tool workflows (chain operations)

🏗️ Architecture

Tech Stack

  • Framework: Next.js 14.2+ (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS + Custom B&W theme
  • PDF Engine: pdf-lib + pdfjs-dist
  • AI: Semantic matching with keyword groups + Fuse.js
  • Office: docx, pptxgenjs, xlsx, mammoth
  • Workers: Web Workers for background processing
  • Desktop: Tauri (Rust-based)

Design System (Monochrome)

Background: #ffffff (white)
Foreground: #000000 (black)
Borders: 1px solid black
Hover: Inverted colors
Typography: System UI + Monospace

Performance Optimizations

  • Memory: Handles 100MB+ PDFs via chunked processing
  • Workers: 3 concurrent Web Workers
  • Lazy Loading: Tools load on demand
  • Font Caching: All fonts pre-embedded once (edit-formatted.ts)
  • Page Caching: PDF pages cached for fast navigation
  • No Persistence: All in-memory, instant download

📁 Project Structure

curd-pdf-os/
├── app/                    # Next.js App Router
│   ├── page.tsx           # Main 3-panel UI
│   ├── layout.tsx         # Root layout
│   └── globals.css        # B&W styles
├── components/            # React components
│   ├── ToolBar.tsx        # Top toolbar
│   ├── ToolOptions.tsx    # Left sidebar options
│   ├── PDFViewer.tsx      # pdf.js renderer
│   ├── PDFRichEditor.tsx  # Text editor with formatting
│   ├── AIChat.tsx         # AI assistant panel
│   ├── CommandPalette.tsx # ⌘K command interface
│   ├── FileManager.tsx    # File upload/management
│   └── ...
├── hooks/                 # Custom React hooks
│   ├── usePDF.ts          # PDF operations
│   ├── useWorkers.ts      # Worker pool
│   └── useAI.ts           # AI commands
├── lib/                   # Core logic
│   ├── tools/             # All 20+ tool implementations
│   ├── ai/                # AI command parser
│   │   ├── commandParser.ts
│   │   ├── embeddings.ts
│   │   └── tools.ts
│   └── theme-provider.tsx
├── src-tauri/             # Desktop app config (Tauri)
├── public/workers/        # Web Workers
├── next.config.js         # Static export config
└── package.json

🔧 Configuration

Environment Variables (Optional)

Create .env.local:

NEXT_PUBLIC_MAX_FILE_SIZE=104857600  # 100MB
NEXT_PUBLIC_MAX_WORKERS=3            # Worker threads

Customization

Change max file size: Edit hooks/usePDF.ts:

const MAX_FILE_SIZE = 200 * 1024 * 1024; // 200MB

Add custom tool:

  1. Create lib/tools/my-tool.ts
  2. Export from lib/tools/index.ts
  3. Add to tool registry
  4. Add AI patterns in lib/ai/commandParser.ts

🧪 Testing

Manual Testing Checklist

Core Tools:

  • Upload PDF (drag & drop)
  • Merge 2+ PDFs
  • Split by page range
  • Compress (all levels)
  • Add watermark
  • Rotate pages
  • Delete pages

Advanced Tools:

  • OCR on scanned PDF
  • Edit text with formatting
  • Extract tables to Excel
  • PDF to Images
  • Images to PDF
  • Protect with password
  • Unlock protected PDF

AI Features:

  • Natural language commands
  • Multi-tool workflows
  • Typo correction
  • Context extraction

Desktop App:

  • Build AppImage
  • Run AppImage
  • Drag & drop files
  • All tools work in desktop mode

🐛 Troubleshooting

Build Errors

"Cannot resolve pdfjs-dist"

npm install [email protected]

"Worker not found" Ensure workers are in public/workers/ and referenced correctly.

Runtime Issues

Large PDF crashes

  • Reduce max file size in config
  • Enable worker processing
  • Close browser tabs to free memory

Edit feature slow

  • Fonts are now cached (edit-formatted.ts optimization)
  • Only current page is rendered (PDFRichEditor.tsx)
  • Large PDFs: Use page-by-page editing

Safari compatibility

  • Safari has stricter memory limits
  • Reduce concurrent operations
  • Use Chrome/Firefox for large files

Deployment Issues

Vercel build fails

  • Check output: 'export' in next.config.js
  • Ensure distDir: 'dist'
  • Verify no API routes exist

Desktop build fails

  • Install Rust: curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
  • Install system dependencies (see DESKTOP.md)
  • Run npm run tauri:build

📝 Browser Support

Browser Status Notes
Chrome 90+ ✅ Full Best performance
Firefox 90+ ✅ Full Recommended
Safari 15+ ✅ Full Lower memory limits
Edge 90+ ✅ Full Same as Chrome

🎓 How It Works

Client-Side Processing

  1. Files loaded via File API (never sent to server)
  2. PDF operations use pdf-lib (WASM-compiled)
  3. Heavy operations offloaded to Web Workers
  4. Results downloaded directly via Blob API

AI Command System

  1. User types natural language command
  2. Semantic matching with keyword groups
  3. Fuse.js for fuzzy matching
  4. Parameters extracted via regex/context
  5. Multi-tool workflows supported

Memory Management

  1. Files loaded as ArrayBuffer
  2. Operations streamed where possible
  3. Automatic garbage collection
  4. Workers terminated after use
  5. Page caching for fast navigation

🚫 Limitations

By Design:

  • No file persistence (in-memory only)
  • No server-side storage
  • No cloud integration
  • Desktop-optimized (not mobile-first)

Browser Limits:

  • ~100MB file size (varies by browser)
  • Memory dependent on device
  • No background processing

Compression:

  • Metadata removal and structure optimization only
  • For heavy image compression: Use PDF→Images→External Compress→Images→PDF workflow

🔐 Security

  • ✅ No data leaves your browser
  • ✅ No external API calls (except CDN workers)
  • ✅ No cookies, no tracking
  • ✅ Open source, auditable code

📄 License

MIT License - Free for personal and commercial use.

🤝 Contributing

Contributions welcome! Areas to help:

  • Additional tool implementations
  • UI improvements
  • Bug fixes
  • Documentation
  • Performance optimizations

📞 Support

Issues: GitHub Issues

Questions: Use the AI chat in the app - it understands "help" and "how do I..."


Built with ❤️ for the PDF power user.

No servers. No subscriptions. No limits.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages