Skip to content

sitansusubudhi/React-MyReads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyReads Project

This is a bookshelf app that allows us to select and categorize books that one has read, currently reading, or want to read. The application is built using React. It uses an API server and client library BooksAPI to persist information as one interacts with the application.

The project is hosted at Netlify at React-MyReads-Netlify and also using GitHub pages at React-MyReads-GitHub

View project locally

To view the project in your local machine:

  • clone this repository using git clone
  • install all project dependencies with npm install
  • start the development server with npm start

Component Hierarchy

|- App
|- SearchBooks # This component renders the '/search' page of the app.
|- BookShelves # This component renders the '/' page of the app.
|-- BookShelf # This component renders the book shelf based on the shelf passed down from BookShelves.
|--- Book # This component is used to retrieve the details of the book for a specified bookId and render the details like title, author, and shelf.

Backend Server

For this application, a online backend server is used. The library file BooksAPI.js contains the below methods to perform necessary operations on the backend:

getAll

Method Signature:

getAll()
  • Returns a Promise which resolves to a JSON object containing a collection of book objects.
  • This collection represents the books currently in the bookshelves in your app.

get

Method Signature:

get(bookId)
  • bookId: <String> contains a unique ID for book
  • Returns a Promise which resolves to a JSON object containing the response data of all details of the book for the specified bookId.

update

Method Signature:

update(book, shelf)
  • book: <Object> containing at minimum an id attribute
  • shelf: <String> contains one of ["wantToRead", "currentlyReading", "read"]
  • Returns a Promise which resolves to a JSON object containing the response data of the POST request

search

Method Signature:

search(query)
  • query: <String>
  • Returns a Promise which resolves to a JSON object containing a collection of a maximum of 20 book objects.