๐Ÿ“˜ Library Management System API

June 24, 2025 ยท View on GitHub

This API is built with Node.js + Express and provides full CRUD functionality for managing users, books, authors, loans, reviews, and file uploads in a library system.


๐Ÿ“š Book Module

Handles all operations related to books.

MethodEndpointDescription
GET/api/booksFetch all books
GET/api/books/:idFetch a book by ID
POST/api/booksCreate a new book
PUT/api/books/:idUpdate a book by ID
DELETE/api/books/:idDelete a book by ID

โœ๏ธ Author Module

Manages author details.

MethodEndpointDescription
GET/api/authorFetch all authors
GET/api/author/:idFetch a specific author by ID
POST/api/authorCreate a new author
PUT/api/author/:idUpdate author by ID
DELETE/api/author/:idDelete author by ID

๐Ÿ‘ค User Module

Handles user account operations.

MethodEndpointDescription
POST/api/users/registerRegister a new user
POST/api/users/loginLog in a user
GET/api/users/Fetch all users
GET/api/users/:idGet user details by ID
POST/api/users/:id/upload-profile-pictureUpload user profile picture

๐Ÿ“ฆ Loan Module

Manages book borrowing and returning.

MethodEndpointDescription
GET/api/loansRetrieve all loan records
POST/api/loansCreate a new loan
GET/api/loans/:idRetrieve loan by user/book ID
PUT/api/loans/:idMark a loan as returned

๐Ÿ“ Review Module

Manages book reviews.

MethodEndpointDescription
GET/api/books/:id/reviewsFetch all reviews for a book
POST/api/books/:id/reviewsAdd a new review to a book
PUT/api/books/:id/reviews/:reviewIdEdit a review
DELETE/api/books/:id/reviews/:reviewIdDelete a review

๐Ÿ–ผ๏ธ Multer Module (Book Cover Upload)

Handles file upload using Multer (book cover image).

MethodEndpointDescription
POST/api/book/:id/upload-coverUpload a book cover by Book ID

โ„น๏ธ Each endpoint includes standard response formats (200 OK, 404 Not Found, 500 SERVER ERROR, etc.). For full request/response bodies and example payloads, refer to the Postman collection (coming soon).