A full-stack PDF editor application with React Native frontend and Flask backend.
- Upload PDF - Upload and store PDF files
- View PDFs - Browse and view your PDF documents
- Merge PDFs - Combine multiple PDF files into one
- Split PDF - Extract specific pages from a PDF
- Rotate Pages - Rotate pages in your PDF documents
- Delete Documents - Remove PDF documents from the system
- Rename Documents - Update document metadata and filenames
- Add Watermark - Add text watermarks with custom position and opacity
- Encrypt PDF - Password-protect PDF files with encryption
- Decrypt PDF - Remove password protection from PDFs
- Compress PDF - Reduce file size with quality control (low, medium, high)
- PDF to Images - Convert PDF pages to PNG/JPG images
- Images to PDF - Create PDF from multiple image files
- OCR Text Extraction - Extract text from scanned PDFs using OCR
- Page Reordering - Reorder, duplicate, or remove specific pages
- PDF Thumbnails - Generate preview thumbnails for PDF pages
- Search & Filter - Search documents by name and filter results
- Sort Documents - Sort by name, size, pages, or date
- Document Statistics - View total documents, storage used, and page counts
- Metadata Editor - View and edit PDF metadata (title, author, subject, etc.)
- User Authentication - Register and login with JWT tokens
- User Accounts - Personal document library per user
- Session Management - Secure session handling with Redis
- Flask - Python web framework
- PostgreSQL - Database for storing document metadata
- Redis - Caching, session management, and job queue
- PyPDF2 - PDF manipulation library
- PyMuPDF (fitz) - Advanced PDF operations and rendering
- reportlab - PDF generation and watermarking
- pikepdf - PDF encryption and security
- pdf2image - PDF to image conversion
- pytesseract - OCR text extraction
- img2pdf - Image to PDF conversion
- Flask-JWT-Extended - JWT authentication
- Flask-Bcrypt - Password hashing
- Celery - Background task processing
- React Native - Cross-platform mobile framework
- Expo - Development platform
- React Native Paper - Material Design components
- React Navigation - Navigation library
- Docker - Containerization
- Docker Compose - Multi-container orchestration
- Docker and Docker Compose
- Node.js 18+ (for frontend development)
- Python 3.11+ (for local backend development)
- Tesseract OCR (for OCR functionality)
- Windows: Download from GitHub
- Mac:
brew install tesseract - Linux:
sudo apt-get install tesseract-ocr
- Poppler (for PDF to image conversion)
- Windows: Download from GitHub
- Mac:
brew install poppler - Linux:
sudo apt-get install poppler-utils
git clone <repository-url>
cd pdf_editor_projectCreate a .env file in the backend directory:
# Database
DATABASE_URL=postgresql://postgres:postgres@db:5432/pdfeditor
# Redis
REDIS_HOST=redis
CELERY_BROKER_URL=redis://redis:6379/0
CELERY_RESULT_BACKEND=redis://redis:6379/0
# Security
JWT_SECRET_KEY=your-secret-key-change-in-production
# File Upload
MAX_CONTENT_LENGTH=104857600 # 100MBdocker-compose up -dThis will start:
- PostgreSQL database on port 5432
- Redis on port 6379
- Flask backend on port 5000
curl http://localhost:5000/healthYou should see:
{
"status": "healthy",
"database": "connected",
"redis": "connected"
}cd frontend
npm installEdit frontend/src/services/api.js and update the API_BASE_URL:
// For local development
const API_BASE_URL = 'http://localhost:5000/api';
// For Android emulator
// const API_BASE_URL = 'http://10.0.2.2:5000/api';
// For iOS simulator
// const API_BASE_URL = 'http://localhost:5000/api';
// For physical device (replace with your computer's IP)
// const API_BASE_URL = 'http://192.168.1.XXX:5000/api';npm startThen:
- Press
wfor web - Press
afor Android - Press
ifor iOS - Scan QR code with Expo Go app on your phone
GET /health- Check backend health status
POST /api/auth/register- Register a new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user info (requires JWT)
POST /api/upload- Upload a PDF fileGET /api/documents- List all documents (supports search, sort, filter)GET /api/documents/<id>- Get document detailsPUT /api/documents/<id>- Update document metadata (rename)DELETE /api/documents/<id>- Delete a documentGET /api/documents/<id>/download- Download a documentGET /api/documents/<id>/thumbnail?page=1- Get page thumbnailGET /api/documents/stats- Get document statistics
POST /api/merge- Merge multiple PDFsPOST /api/split- Split a PDF by pagesPOST /api/rotate- Rotate PDF pagesPOST /api/reorder- Reorder PDF pagesGET /api/operations- List all operationsGET /api/operations/<id>- Get operation status
POST /api/watermark- Add watermark to PDFPOST /api/encrypt- Encrypt PDF with passwordPOST /api/decrypt- Decrypt PDFPOST /api/compress- Compress PDF filePOST /api/pdf-to-images- Convert PDF pages to imagesPOST /api/images-to-pdf- Convert images to PDFPOST /api/ocr- Extract text using OCR
Redis is used for:
- Caching - Document metadata caching (1 hour TTL) ✅
- Session Management - JWT token management and user sessions ✅
- Job Queue - Celery broker for background task processing ✅
- Rate Limiting - API rate limiting (future feature)
# Start all services
docker-compose up -d
# Stop all services
docker-compose down
# View logs
docker-compose logs -f backend
# Rebuild backend
docker-compose up -d --build backend
# Access database
docker exec -it pdf_editor_db psql -U postgres -d pdfeditor
# Access Redis CLI
docker exec -it pdf_editor_redis redis-clicd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.pycd frontend
npm startpdf_editor_project/
├── backend/
│ ├── app.py # Flask application
│ ├── requirements.txt # Python dependencies
│ ├── Dockerfile # Backend Docker image
│ └── .env.example # Environment variables template
├── frontend/
│ ├── src/
│ │ ├── screens/ # React Native screens
│ │ └── services/ # API service layer
│ ├── App.js # Main app component
│ ├── package.json # Node dependencies
│ └── app.json # Expo configuration
├── docker-compose.yml # Docker orchestration
└── README.md # This file
- Ensure PostgreSQL container is healthy:
docker-compose ps - Check logs:
docker-compose logs db
- Verify backend is running:
curl http://localhost:5000/health - Update API_BASE_URL in
frontend/src/services/api.js - For Android emulator, use
10.0.2.2instead oflocalhost - For physical device, use your computer's local IP address
- Check Redis is running:
docker-compose ps redis - Test connection:
docker exec -it pdf_editor_redis redis-cli ping
- Add watermark functionality
- User authentication and authorization
- PDF compression
- OCR text extraction
- PDF encryption/decryption
- PDF to image conversion
- Image to PDF conversion
- Page reordering
- PDF preview thumbnails
- Document search and filtering
- Document statistics dashboard
- Metadata editor
- Delete and rename documents
- PDF annotation tools (highlights, comments, drawings)
- Cloud storage integration (Google Drive, Dropbox, OneDrive)
- Advanced batch processing with progress tracking
- PDF comparison tool
- Form filling and extraction
- Digital signatures
- PDF/A conversion for archiving
- Advanced OCR with language selection
- Collaborative editing
- API rate limiting
- Email PDF documents
- Schedule automated PDF operations
- Quick Start Guide - Get started in 5 minutes! ⚡
- API Documentation - Complete API reference with examples
- Testing Guide - Comprehensive testing instructions
- Implementation Summary - Feature overview and deployment guide
MIT