Project Overview
BookHub is a comprehensive library management system built with the MERN stack (MongoDB, Express.js, React.js, Node.js) to provide a seamless platform for book enthusiasts, authors, and library staff. Users can browse, download, rate, and review books, manage personal notes in a Notion-like environment, and bookmark favorites, while admins oversee books, users, and activity via a dashboard.
The system supports aspiring authors by allowing them to draft and publish novels, with features like file uploads (via Multer) for books and images, email notifications (via Nodemailer) for updates, and secure authentication (via JWT). Tailwind CSS ensures a responsive, modern UI, and MongoDB handles flexible data storage, making BookHub an intuitive and feature-rich platform for real-world library and publishing needs.
Technical Highlights
Performance Optimization
- Efficient MongoDB queries
- Asynchronous API endpoints
- Lightweight React rendering
- Scalable file uploads
Security Features
- JWT-based user authentication
- Input data sanitization
- Protected route access
- Encrypted session management
Project Gallery




Frequently Asked Questions
We built BookHub using the MERN stack, with MongoDB storing data for books, users, notes, and
staff in flexible collections, and Express.js powering RESTful APIs for routes like /api/books
,
/api/notes
, and /api/auth
to handle CRUD operations and authentication. React.js,
styled with Tailwind CSS, created a dynamic, responsive frontend for features like book browsing, rating, and
Notion-like note editing, with components for user profiles and admin dashboards.
Key features were implemented using Multer for book and image uploads, Nodemailer for email notifications, and JWT for secure user login, ensuring seamless integration of book downloads, note management, and admin oversight, all accessible via dedicated API endpoints for a smooth user experience.
The main challenge in BookHub was fixing key space errors in the TipTap editor, which disrupted
review comments and Notion-like notes by causing unwanted line breaks or formatting loss due to ProseMirror’s
whitespace handling. After exploring GitHub discussions and testing fixes, we implemented a custom sanitization
step using editor.commands.setContent(cleanText, false, { preserveWhitespace: "full" })
to preserve spaces,
ensuring seamless integration with image and emoji nodes.
Storing mixed notes (text, images, emojis, files) in MongoDB was also challenging, as direct string insertion
caused corrupted entries. We serialized TipTap’s output to JSON, representing text as paragraphs, images/emojis
as custom nodes, and files as links or base64 data, then stored it in MongoDB using Mongoose object-type schemas.
Multer handled file uploads, storing paths in JSON nodes, enabling reliable CRUD operations with $elemMatch
queries for partial updates.
To ensure scalability, we designed BookHub with MongoDB’s flexible schema to handle growing datasets, like thousands of books and notes, and optimized Express.js APIs for asynchronous performance to support high user traffic. The platform supports aspiring authors by providing a Notion-like note editor for drafting and publishing novels, with review and rating systems to attract booksellers seeking fresh content, enhancing its real-world utility as a publishing hub.
For user-friendliness, we implemented a single login page with JWT authentication to redirect users to tailored interfaces (user, staff, or admin), used Tailwind CSS for a responsive, intuitive UI, and ensured features like book downloads and note management were accessible and easy to use, making BookHub a practical platform for diverse educational and publishing needs.