Skip to content

ELABDELLAOUI-ismail/bookverse-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

******************** BookVerse API ********************

Author

Description

BookVerse API is a RESTful API for managing a collection of books and their authors. The API provides endpoints for CRUD operations on books and authors, with additional features like book rating and ISBN lookup.

Features

  • Book Management (main features)
    • Add new books
    • Update book information
    • Delete books
    • Get book by ID
    • Get book by name
    • Calculate book rating based on publication date and author
    • Get authors of a list of book (by IDs)
  • External API Integration (main features)
    • Lookup books by ISBN using OpenLibrary API
  • Author Management (additional needed features)
    • add new author
    • Delete new author

Installation

  1. Clone the repository
  • git clone
  • cd bookverse-api
  1. Install dependencies
  • npm install
  1. Create a .env file in the root directory (made a .env.example, you can copy it)

Running the Application > Start the server

  • npm start

Run tests

  • npm test

*********** API Documentation ***********

Authentication

All API requests headers must include : - api-key: aedz-151-ftyh-554

Create a Book

POST /api/books

Request body: { title: 'testyy book', author: existingAuthor_id, publicationDate: new Date('2018-01-01'), type: 'action' }

Update a Book

PUT /api/books/:id

Request body: { title: 'macha book', author: existingAuthor_id, publicationDate: new Date('2018-01-01'), type: 'cartoons' }

Delete a Book

DELETE /api/books/:id

Get Book by ID

GET /api/books/:id

Get Book by Name

GET /api/books/search?title=Book Title

Get Book Rating

GET /api/books/:id/rating

Get Authors from Book IDs

POST /api/books/authors

Request body: { "bookIds": ["id1", "id2", "id3"] }

Lookup Book by ISBN

GET /api/books/isbn/:isbn

Create Author : some top authors defined enum => constants/TOP_AUTHORS.js

POST /api/authors/create

Request body: { name: 'Guillaume Musso', age: 45, followersNumber: 159 }

Prerequisites

  • Node.js
  • MongoDB

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published