mamume / reactnd-project-myreads

Starter Code for the React MyReads Project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MyReads: A Book Lending App Project

Project Overview

In the MyReads project, you can create a bookshelf app that allows you to select and categorize books you have read, are currently reading, or want to read. The project emphasizes using React to build the application and provides an API server and client library that you will use to persist information as you interact with the application.

To install dependancies and start the project:

* install all project dependencies with `yarn install` or `npm install`
* start the development server with `yarn start` or `npm start`

What You're Getting

├── README.md - This file.
├── SEARCH_TERMS.md # The whitelisted short collection of available search terms to use with your app.
├── package.json # npm package manager file.
├── public
│   ├── favicon.ico # React Icon.
│   └── index.html # DO NOT MODIFY
└── src
    ├── App.css # Styles for your app.
    ├── App.js # This is the root of the app. Contains Home and Search routes.
    ├── 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.
    ├── icons # Helpful images for the app.
    │   ├── add.svg
    │   ├── arrow-back.svg
    │   └── arrow-drop-down.svg
    ├── index.css # Global styles.
    ├── index.js # It is used for DOM rendering only.
    ├── components # Contain used components.
    │   ├── Book.js # Book componant.
    │   ├── BookShelf.js # Componant for shelf.
    │   ├── BookShelfChanger.js # Componant for shelf selector.
    │   └── SearchResult.js # componant for search result.
    └── routes # Contain routes components.
        ├── Home.js # Home page component for shelves.
        └── Search.js # Search page componant.

Backend Server

To simplify your development process, The Backend server for you to develop against. The provided file BooksAPI.js contains the methods you will need 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.

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.
  • These books do not know which shelf they are on. They are raw results only.

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.

Create React App

This project was bootstrapped with Create React App. You can find more information on how to perform common tasks here.

About

Starter Code for the React MyReads Project


Languages

Language:JavaScript 74.0%Language:CSS 18.6%Language:HTML 7.3%