A free, privacy-first PDF compression web app. Upload a PDF, pick a compression level, and download a smaller file — no sign-up, no cloud storage, files are deleted immediately after processing.
Live demo: (add your Vercel URL here after deployment)
- Drag & drop PDF upload (up to 50 MB)
- Three compression levels: Low / Medium / High
- Before & after file size with savings percentage
- Instant download — no email, no account
- Files processed in-memory and deleted immediately
- Works on any modern browser
| Level | PDFSETTINGS | DPI | Typical reduction |
|---|---|---|---|
| Low | /printer |
300 | 0–10% |
| Medium | /ebook |
150 | 50–65% |
| High | /screen |
72 | 75–90% |
| Layer | Technology |
|---|---|
| Frontend | React 18 + Vite 5 |
| Styling | TailwindCSS 3 |
| File upload | react-dropzone |
| HTTP client | axios |
| Serverless API | Vercel Node.js functions |
| Compression (primary) | Ghostscript (gs -dPDFSETTINGS) |
| Compression (fallback) | MuPDF WASM (saveToBuffer compress,garbage=4) |
| Tests | Vitest + Testing Library (21 tests) |
├── api/
│ └── compress.js # Vercel serverless function (POST /api/compress)
├── src/
│ ├── components/
│ │ ├── Compressor.jsx # Main orchestrator component
│ │ ├── DropZone.jsx # Drag & drop file input
│ │ ├── CompressionLevelPicker.jsx
│ │ ├── FileSizeDisplay.jsx # Before/after + savings bar
│ │ └── ProgressBar.jsx
│ ├── hooks/
│ │ └── useCompress.js # Upload → compress → download lifecycle
│ └── test/ # 21 Vitest unit tests
├── server.dev.js # Local API dev server (mirrors Vercel function)
├── vercel.json # Vercel deployment config
├── ARCHITECTURE.md # Detailed architecture & code reference
└── package.json
- Node.js 20+
- Ghostscript (for full compression — optional, falls back to MuPDF)
# macOS
brew install ghostscript
# Ubuntu/Debian
sudo apt-get install ghostscriptnpm install# Start both the Vite frontend (port 5173) and API server (port 3001)
npm run dev:all
# Or start separately:
node server.dev.js # API on :3001
npm run dev # Frontend on :5173Open http://localhost:5173.
npm test # run once
npm run test:watch # watch modenpx vercel --prodNote: Standard Vercel deployments do not include Ghostscript. The API automatically falls back to MuPDF compression. For full Ghostscript performance, deploy using a Docker-based Vercel runtime or a VPS.
No environment variables are required for the MVP.
| Branch | Purpose |
|---|---|
dev |
Active development — all feature branches merge here |
staging |
Pre-production integration testing |
main |
Production — deployed to Vercel |
Workflow:
feature/my-feature → dev → PR to staging → PR to main
Request: multipart/form-data
| Field | Type | Required | Description |
|---|---|---|---|
file |
PDF file | Yes | Max 50 MB |
level |
low | medium | high |
No | Default: medium |
Response (success): 200 application/pdf
| Header | Description |
|---|---|
X-Original-Size |
Original file size in bytes |
X-Compressed-Size |
Compressed file size in bytes |
X-Engine |
ghostscript or mupdf |
Response (error): 400 / 413 / 500 JSON { "error": "..." }
MIT