Skip to content
This repository was archived by the owner on Apr 5, 2020. It is now read-only.

konopkov/reactnd-project-myreads

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MyReads Project

Assessment project for Udacity's React Fundamentals course.

TL;DR

To get started developing right away:

  • install all project dependencies with npm install
  • start the development server with npm start

Project structure

├── CONTRIBUTING.md
├── README.md - This file.
├── SEARCH_TERMS.md # The whitelisted short collection of available search terms.
├── package.json # npm package manager file.
├── public
│   ├── favicon.ico # React Icon.
│   └── index.html # DO NOT MODIFY
└── src
    ├── App.css # App styles.
    ├── App.js # This is the root of the app.
    ├── App.test.js # Used for testing. Provided with Create React App.
    ├── BooksAPI.js # A JavaScript API for the provided Udacity backend. Instructions for the methods are below.
    ├── Book.js # Book component - a single book. Used in BookGrid component
    ├── BookGrid.js # BookGrid component - a list of books without shelf arrangment. Used in BookShelf and SearchBooks components
    ├── BookShelf.js # BookShelf component - a shelf with books on it. Used in ListBooks component
    ├── ListBooks.js # ListBooks component - multiple shelves. Used in App component to show shelves
    ├── SearchBooks.js # SearchBooks component - search page. Used in App component to show search results
    ├── icons # Images.
    │   ├── add.svg
    │   ├── arrow-back.svg
    │   └── arrow-drop-down.svg
    ├── index.css # Global styles.
    └── index.js # Used for DOM rendering only.

Backend Server

The provided file BooksAPI.js contains the methods with 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.

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, maxResults)
  • query: <String>
  • maxResults: <Integer> Due to the nature of the backend server, search results are capped at 20, even if this is set higher.
  • Returns a Promise which resolves to a JSON object containing a collection of book objects.
  • These books do not know which shelf they are on. They are raw results only. You'll need to make sure that books have the correct state while on the search page.

Important

The backend API uses a fixed set of cached search results and is limited to a particular set of search terms, which can be found in SEARCH_TERMS.md. That list of terms are the only terms that will work with the backend, so don't be surprised if your searches for Basket Weaving or Bubble Wrap don't come back with any results.

About

React MyReads Project

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 68.4%
  • CSS 22.3%
  • HTML 9.3%