Assessment project for Udacity's React Fundamentals course.
To get started developing right away:
- install all project dependencies with
npm install - start the development server with
npm start
├── 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.The provided file BooksAPI.js contains the methods with necessary operations on the backend:
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.
Method Signature:
update(book, shelf)- book:
<Object>containing at minimum anidattribute - 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
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.
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.