PDF Tracker is a web app that helps you build a personal PDF library and automatically remember where you left off. Upload a PDF, view it in the browser, and your reading progress is saved per user.
- Authentication with Credentials, Google, and GitHub (Auth.js / NextAuth v5)
- PDF uploads backed by Cloudinary
- Metadata extraction on upload (title/subject/author + total pages)
- In-browser reader with:
- full screen support
- page navigation + zoom
- auto-hiding top navigation while scrolling in full screen
- Per-user progress tracking (saved with a debounce to reduce writes)
- Responsive UI (Tailwind + daisyUI)
- Next.js (App Router, Server Actions)
- React
- Auth.js / NextAuth v5 (JWT sessions)
- MongoDB + Mongoose
- Cloudinary (file storage + cover/preview rendering)
- pdf.js (metadata extraction) +
@react-pdf-viewer/*(viewer)
src/app/— App Router pages, layouts, and API routessrc/lib/actions/— Server Actions for DB + Cloudinary workflowssrc/lib/db/— Mongoose connection and modelssrc/components/— UI components (uploader, viewer, book cards)public/pdf.worker.js— pdf.js worker used by the client
Create .env.local in the project root. You can start from .env.example.
Required:
MONGODB_URIAUTH_SECRETAUTH_GOOGLE_ID/AUTH_GOOGLE_SECRET(if using Google sign-in)AUTH_GITHUB_ID/AUTH_GITHUB_SECRET(if using GitHub sign-in)CLOUDINARY_CLOUD_NAMECLOUDINARY_API_KEYCLOUDINARY_API_SECRETNEXT_PUBLIC_CLOUDINARY_CLOUD_NAME
Prerequisites:
- Node.js 18+ (recommended)
- A MongoDB instance (Atlas or local)
- A Cloudinary account
- (Optional) Google/GitHub OAuth apps for social sign-in
Run:
npm install
npm run devThen open http://localhost:3000.
npm run dev— start dev server (Turbopack)npm run build— production buildnpm run start— run production servernpm run lint— lint
- Upload size limit: 10MB per file (client-side check)
- Upload count limit: 5 PDFs per user (enforced server-side)
- Progress is saved ~2s after the last page change (debounced)
This project works well on Vercel.
- Set the same environment variables in your hosting provider.
- Ensure your Auth.js callback URLs match your deployment URL.
Issues and PRs are welcome. If you’re proposing a change that affects data models or auth flows, include a short note on how you tested it.
GPL-3.0-only. See LICENSE.