Skip to content

ShreyashChilip/python

Repository files navigation

Book Management System - Node.js & Express

This project implements a complete book management system with user authentication and review functionality for the Coursera "Developing Back-End Apps with Node.js and Express" course.

Features Implemented

General Users (Tasks 1-5):

  • ✅ Task 1: Get the book list available in the shop
  • ✅ Task 2: Get books based on ISBN
  • ✅ Task 3: Get all books by Author
  • ✅ Task 4: Get all books based on Title
  • ✅ Task 5: Get book Reviews

User Authentication (Tasks 6-7):

  • ✅ Task 6: Register New user
  • ✅ Task 7: Login as a Registered user

Registered Users (Tasks 8-9):

  • ✅ Task 8: Add/Modify a book review
  • ✅ Task 9: Delete book review

Node.js Client with Axios (Tasks 10-13):

  • ✅ Task 10: Get all books – Using async callback function
  • ✅ Task 11: Search by ISBN – Using Promises
  • ✅ Task 12: Search by Author – Using Async/Await
  • ✅ Task 13: Search by Title – Using Promises

Installation & Setup

  1. Install dependencies:
npm install
  1. Start the server:
npm start
  1. For development with auto-restart:
npm run dev
  1. Test the client methods:
npm test

API Endpoints

Public Endpoints

  • GET /books - Get all books
  • GET /books/isbn/:isbn - Get book by ISBN
  • GET /books/author/:author - Get books by author
  • GET /books/title/:title - Get books by title
  • GET /books/:id/reviews - Get book reviews
  • POST /register - Register new user
  • POST /login - User login

Protected Endpoints (Require Authentication)

  • PUT /books/:id/reviews - Add/modify book review
  • DELETE /books/:id/reviews - Delete book review

Testing with Screenshots

For peer review, test each endpoint using:

  1. Postman
  2. Browser (for GET requests)
  3. The provided test client (npm test)

Sample Test Data

  • ISBN: 9781593279509
  • Author: David Flanagan
  • Title: JavaScript
  • User credentials: username: testuser, password: testpass123

Project Structure

├── package.json          # Dependencies and scripts
├── index.js             # Main Express server
├── test_client.js       # Node.js client with Axios
├── README.md           # This file
└── screenshots/        # Screenshots for peer review

Technologies Used

  • Node.js
  • Express.js
  • JWT for authentication
  • bcryptjs for password hashing
  • Axios for HTTP requests
  • CORS for cross-origin requests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published