A full-stack MERN application for discovering books, publishing chapters, and managing reader reviews — designed with a strong focus on backend architecture, API design, and real-world application flow.
- Browse books from the Explore page
- Filter, sort, and paginate results
- Select page size (
6,12,24) with proper navigation controls - View detailed book pages with chapter reading and reviews
- Create, edit, and delete reviews
- Add books with metadata and optional cover upload
- Automatically continue to edit flow after creation
- Manage personal catalog (
My Books) - Edit and delete books
- Publish chapters incrementally
-
JWT Authentication (
/auth/register,/auth/login,/auth/me) -
Role-based authorization and ownership guards — authenticated users can manage their own books, chapters, and reviews; admins can manage all resources
-
Advanced query handling:
- filtering
- sorting
- pagination
- field selection
-
Aggregation pipelines:
- trending books
- review statistics
-
Nested routes for reviews
-
Chapter publishing system
-
Image uploads using Multer (stored locally in
/uploads/covers)
- Node.js
- Express
- MongoDB + Mongoose
- JWT (
jsonwebtoken) - bcrypt
- multer
- React (Vite)
- React Router
- Axios
- Tailwind CSS
MERN-BookApp/
├── backend/
│ ├── index.js
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ └── utils/
│
└── frontend/
├── index.html
├── vite.config.js
└── src/
├── api/
├── components/
├── pages/
└── utils/
MONGO_URI=your_mongodb_connection_string
PORT=5555
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=7d
📌 Cover uploads are stored locally in backend/uploads/covers.
VITE_API_URL=http://localhost:5555
git clone https://github.com/NuhaG/BookApp.git
cd BookAppcd backend
npm install
npm run dev
cd frontend
npm install
npm run dev
Full API documentation with route details and request/response examples is available in API.md.
Contributions are welcome!
If you'd like to improve the project:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a Pull Request
Suggestions, improvements, and bug fixes are appreciated.
This project is licensed under the MIT License.