In the MyReads project, you'll 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.
I have used the starter template which provided a static example of the CSS and HTML markup without any of the React code that is needed to complete the project. I have added interactivity to the app by refactoring the static code in the starter template.
Of course, you are free to start this project from scratch if you wish! Just be sure to use Create React App to bootstrap the project.
- Getting Started
- Create React App
- Folder Structure
- Prerequisites
- Backend Server
- How to launch the app locally
- Important
- Author
- Acknowledgments
To get started right away:
- install all project dependencies with
npm install
- start the development server with
npm start
This project was bootstrapped with Create React App. You can find more information on how to perform common tasks here.
After creation, your project should look like this:
├── README.md - This file.
├── SEARCH_TERMS.md # The whitelisted short collection of available search terms for you to use with your app.
├── package.json # npm package manager file. It's unlikely that you'll need to modify this.
├── .eslintrc.js # eslint configuration settings
├── 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.
├── SearchBooks.js # search page react component
├── ListBooks.js # List book home page component
├── BooksAPI.js # A JavaScript API for the provided Udacity backend. Instructions for the methods are below.
├── icons # Helpful images for your app. Use at your discretion.
│ ├── add.svg
│ ├── arrow-back.svg
│ └── arrow-drop-down.svg
├── index.css # Global styles.
└── index.js # It is used for DOM rendering only.
For the project to build, these files must exist with exact filenames:
public/index.html
is the page template;src/index.js
is the JavaScript entry point.
You can delete or rename the other files.
You need to put any JS and CSS files inside src
, otherwise Webpack won’t see them.
Remember that good React design practice is to create new JS files for each component and use import/require statements to include them where they are needed.
- ES6, Promises, REACT
The provided file BooksAPI.js
contains the methods you will need to perform 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 anid
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
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. You'll need to make sure that books have the correct state while on the search page.
- Clone the Project -
https://github.com/praveen-me/myReads.git
- Go into the directory where the project now lives -
cd myReads
- Install the dependencies -
npm install
- Start the app -
npm start
The application will be running at http://localhost:3000 URL
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.