Add PDF editing module
ProtonPDF is an all-in-one document workspace designed as a modern alternative to tools like Adobe Acrobat and iLovePDF, but with cutting edge AI capabilities baked natively into the interface.
The application is split into two primary engines:
- The AI Reader: A split-screen document viewer with a persistent, context-aware AI assistant powered by Groq and Llama-3. Simply upload a document, and the AI acts as an instant study-buddy, summarizing pages, answering questions, and extracting data in real-time.
- The PDF Toolkit: A suite of 17+ document utilities (Merge, Split, Compress, Watermark, etc.).
The Toolkit operates on a zero-storage, in-memory ByteStream architecture. Documents are processed entirely in RAM on the backend and streamed directly back to the user.
Backend for this project is at /proton-server
- Lightning-fast LLM Inference: Powered by the Groq API (Llama 3 70B/8B).
- Context-Aware Chat: Ask questions directly related to the PDF you are currently reading.
- Persistent Conversations: Chat history is persistently saved to the database.
Includes 17 highly optimized, RAM-only PDF utilities:
- Compress PDF: Aggressive size reduction with 4 adjustable quality levels (includes image downsampling).
- Split & Merge: Extract specific page ranges or stitch multiple documents together.
- Format Conversions: Convert PDF to high-quality Images (PNG), Word (
.docx), Excel (.xlsx), and turn JPG/PNGs into PDFs. - Security: Apply AES-256 password protection, or unlock existing documents.
- Markup & Editing: Add highly-customizable watermarks, redact sensitive text, crop margins, and insert page numbers.
- Utilities: Extract embedded images, repair corrupted documents, rotate pages, and freely reorganize page ordering.
Frontend
- React (Create React App / Vite)
- TailwindCSS for rapid, responsive styling
- Lucide React for ultra-clean iconography
- React-PDF / Embedded Object rendering
Backend
- FastAPI (Python 3) for blazing-fast asynchronous endpoints
- PyMuPDF (
fitz) for low-level, high-performance document manipulation - Groq API +
llama3-70b-8192for AI responses - SQLite for minimalist, portable user and chat history storage
- PyJWT & Google OAuth 2.0 for secure authentication
Want to run ProtonPDF on your own machine? Follow these steps:
- Node.js (
v18or higher) - Python (
3.9or higher) - A free API key from Groq
- A Google OAuth Client ID for authentication
git clone https://github.com/YOUR_USERNAME/ProtonPDF.git
cd ProtonPDFcd backend
# Create a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Environment Setup
# Create a .env file in the backend directory and add:
GROQ_API_KEY=your_groq_api_key
JWT_SECRET=super_secret_string_change_me
DB_PATH=./data/protonpdf.db
GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
FRONTEND_URL=http://localhost:3000
# Start the FastAPI server
python -m uvicorn main:app --reload --port 8000Open a new terminal window:
cd protonpdf
npm install
REACT_APP_GOOGLE_CLIENT_ID=your_google_client_id
REACT_APP_API_URL=http://localhost:8000
npm startIf you want to help expand ProtonPDF, contributions are wide open.
Areas:
- Integrating advanced open-source OCR engines (e.g. Tesseract) for scanned documents.
- Creating a visual PDF-to-Word structural reflow algorithm.
- UI enhancements and accessibility improvements.
