Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bookstore API

Description

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.

Installation

  1. Clone the repository
git clone git@github.com:Labrahmi/Bookstore-API.git
cd Bookstore-API
  1. Install the dependencies
npm install
  1. Create an environment file
cp .env.example .env
  1. Start the server
npm start

Usage

The API provides the following endpoints:

Authors

  • 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

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

Orders

  • 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

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages