๐ PDF Annotator - Full Stack Application
A full-stack application to upload, view, and annotate PDF documents with persistent highlights. Built with React, Node.js, and MongoDB.
๐ Features
๐ Authentication โ Secure JWT-based login & registration
๐ PDF Upload & Storage โ UUID-based local storage
๐ PDF Viewer โ Render PDFs with pagination & zoom (PDF.js)
โ๏ธ Text Highlighting โ Select & highlight text with color options
๐ Highlight Management โ Save, view, and delete highlights
๐ User Dashboard โ Manage uploaded PDFs
๐ Search โ Find PDFs and highlights
๐ฑ Responsive Design โ Works on desktop, tablet, and mobile
๐๏ธ Architecture Frontend (React) โ Backend (Node.js + Express) โ Database (MongoDB) PDF.js Viewer โ Auth / File / Highlight APIs โ Users, PDFs, Highlights
โ๏ธ Tech Stack
Frontend: React 18, React Router, PDF.js, Axios, Context API
Backend: Node.js, Express, JWT, Multer, bcryptjs, Mongoose
Database: MongoDB (local or Atlas)
Other: UUID, Helmet, dotenv
๐ ๏ธ Setup Instructions
- Backend cd pdf-annotator-backend npm install cp .env.example .env # configure MongoDB + JWT_SECRET npm run dev
Runs on http://localhost:5000
- Frontend cd pdf-annotator-frontend npm install cp .env.example .env # set REACT_APP_API_URL=http://localhost:5000/api npm start
Runs on http://localhost:3000
๐ Key API Endpoints
POST /api/auth/register โ Register user
POST /api/auth/login โ Login user
POST /api/pdfs/upload โ Upload PDF
GET /api/pdfs โ Get all PDFs
POST /api/highlights โ Create highlight
GET /api/highlights/:pdfUuid โ Get highlights for a PDF
๐ฆ Project Structure pdf-annotator-backend/ โโโ models/ # User, PDF, Highlight โโโ routes/ # Auth, PDFs, Highlights โโโ middleware/ # Auth, Error handler โโโ server.js
pdf-annotator-frontend/ โโโ src/components/ # Auth, Dashboard, PDFViewer, UI โโโ src/contexts/ # Auth, PDF, Toast contexts โโโ src/App.js
๐ฎ Future Enhancements
Drawing tools (freehand, arrows, shapes)
Notes and tagging for highlights
Cloud storage (Google Drive, Dropbox)
Real-time collaboration & sharing