This is a RESTful API for a bookstore. The API is built using Node.js, Express.js, and MongoDB. The API provides endpoints for managing books, authors, and orders.
- Clone the repository
git clone git@github.com:Labrahmi/Bookstore-API.git
cd Bookstore-API- Install the dependencies
npm install- Create an environment file
cp .env.example .env- Start the server
npm startThe API provides the following endpoints:
- Return all authors (* support pagination)
GET: /api/authors
- Add author
POST: /api/authors/add
- Update of author
PUT: /api/authors/update
- Returning all books by author (* support pagination)
GET: /api/authors/:id/books
- Adding one or more books in one request.
POST: /api/books/add
- Deleting a book
DELETE: /api/books/:id/delete
- return all books (* support pagination)
GET: /api/books
- Returning books according to values that appear under the name (* support pagination)
GET: /api/books/search
- Returning books by genre (* support pagination)
GET: /api/books/genre/:genre
- Returning books by publishingYear in the range (* support pagination)
GET: /api/books/publishingYear
- Returning books according to the country of the author (* support pagination)
GET: /api/books/author/country/:country
- Returning all orders
GET: /api/orders
- Adding an Order
POST: /api/orders/add
- Finding the Order with Maximum totalPrice in a Date Range
GET: /api/orders/maxTotalPrice
- Finding the 3 Most Popular Genres in a Date Range
GET: /api/orders/genres/popular
- Finding Total Profit in a Date Range
GET: /api/orders/profit
- Finding the 5 Most Bought Authors in a Date Range
GET: /api/orders/authors/popular