Skip to content

NuhaG/BookApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📘 MERN Book App

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.


✨ Features

👨‍🎓 Reader Experience

  • 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

✍️ Author Experience

  • 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

⚙️ Backend Capabilities

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


🛠️ Tech Stack

🧩 Backend

  • Node.js
  • Express
  • MongoDB + Mongoose
  • JWT (jsonwebtoken)
  • bcrypt
  • multer

🎨 Frontend

  • React (Vite)
  • React Router
  • Axios
  • Tailwind CSS

📂 Project Structure

MERN-BookApp/
├── backend/
│   ├── index.js
│   ├── controllers/
│   ├── middleware/
│   ├── models/
│   ├── routes/
│   └── utils/
│
└── frontend/
    ├── index.html
    ├── vite.config.js
    └── src/
        ├── api/
        ├── components/
        ├── pages/
        └── utils/

⚙️ Environment Variables

🔐 Backend (.env)

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.


🌐 Frontend (.env)

VITE_API_URL=http://localhost:5555

▶️ Running Locally

Clone The Repo

git clone https://github.com/NuhaG/BookApp.git
cd BookApp

Backend

cd backend
npm install
npm run dev

Frontend

cd frontend
npm install
npm run dev

📖 Documentation

Full API documentation with route details and request/response examples is available in API.md.


🤝 Contributing

Contributions are welcome!

If you'd like to improve the project:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a Pull Request

Suggestions, improvements, and bug fixes are appreciated.


📄 License

This project is licensed under the MIT License.

About

MERN-based book discovery and publishing platform with authentication, reviews, and scalable backend design.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors