Skip to content

Manik2375/pdf-tracker

Repository files navigation

PDF Tracker

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.

Features

  • 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)

Tech stack

  • 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)

Project structure (high level)

  • src/app/ — App Router pages, layouts, and API routes
  • src/lib/actions/ — Server Actions for DB + Cloudinary workflows
  • src/lib/db/ — Mongoose connection and models
  • src/components/ — UI components (uploader, viewer, book cards)
  • public/pdf.worker.js — pdf.js worker used by the client

Environment variables

Create .env.local in the project root. You can start from .env.example.

Required:

  • MONGODB_URI
  • AUTH_SECRET
  • AUTH_GOOGLE_ID / AUTH_GOOGLE_SECRET (if using Google sign-in)
  • AUTH_GITHUB_ID / AUTH_GITHUB_SECRET (if using GitHub sign-in)
  • CLOUDINARY_CLOUD_NAME
  • CLOUDINARY_API_KEY
  • CLOUDINARY_API_SECRET
  • NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME

Local development

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 dev

Then open http://localhost:3000.

Scripts

  • npm run dev — start dev server (Turbopack)
  • npm run build — production build
  • npm run start — run production server
  • npm run lint — lint

Notes / limits

  • 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)

Deployment

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.

Contributing

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.

License

GPL-3.0-only. See LICENSE.

About

Track your pdf reading progress and sync across all devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published