Udacity React Nanodegree project: Single Page Application built with React and React Router.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.vscode
docs
public
src
.editorconfig
.gitignore
.nvmrc
.prettierrc.yml
.travis.yml
README.md
package.json
tsconfig.json
tsconfig.test.json
tslint.json
yarn.lock

README.md

React Project: MyReads

TypeScript code style: prettier tested with jest Build Status

Description

This is the first project for the React Nanodegree.

Table of Contents

Getting started

Installation

This project was bootstrapped with Create React App.

Dependencies:

  • Yarn package manager
  • create-react-app
  • Editor / IDE

To get started with this repository:

# git clone the repository e.g. into a <projects> folder
cd <projects>
# git clone with ssh
git clone git@github.com:cubiio/reactnd-myreads.git
# or git clone with HTTPS
git clone https://github.com/cubiio/reactnd-myreads.git

# change directory into the cloned repo
cd myreads

# install the dependencies
yarn

Develop

How to run

# Navigate into your local myreads project directory
cd <projects>/myreads

# To run the development server
yarn start

If there appears to be issues with dependencies not being installed, or up to date, then run yarn.

Backend Server API

Instructions from Udacity on how to use the API:

To simplify your development process, we've provided a 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, 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.

Search Terms

The backend API uses a fixed set of cached search results and is limited to a particular set of search terms (see Search Terms below). 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.

'Android', 'Art', 'Artificial Intelligence', 'Astronomy', 'Austen', 'Baseball', 'Basketball', 'Bhagat', 'Biography', 'Brief', 'Business', 'Camus', 'Cervantes', 'Christie', 'Classics', 'Comics', 'Cook', 'Cricket', 'Cycling', 'Desai', 'Design', 'Development', 'Digital Marketing', 'Drama', 'Drawing', 'Dumas', 'Education', 'Everything', 'Fantasy', 'Film', 'Finance', 'First', 'Fitness', 'Football', 'Future', 'Games', 'Gandhi', 'Homer', 'Horror', 'Hugo', 'Ibsen', 'Journey', 'Kafka', 'King', 'Lahiri', 'Larsson', 'Learn', 'Literary Fiction', 'Make', 'Manage', 'Marquez', 'Money', 'Mystery', 'Negotiate', 'Painting', 'Philosophy', 'Photography', 'Poetry', 'Production', 'Programming', 'React', 'Redux', 'River', 'Robotics', 'Rowling', 'Satire', 'Science Fiction', 'Shakespeare', 'Singh', 'Swimming', 'Tale', 'Thrun', 'Time', 'Tolstoy', 'Travel', 'Ultimate', 'Virtual Reality', 'Web Development', 'iOS'

Tests

Jest is used for tests. To run the test suite, use this command:

yarn test

Continuous Integration

It's complete overkill for this project but I added Travis CI to the project. A commit pushed to origin/<branch> triggers a build on Travis.

The .travis.yml file includes the CI build config. The .nvmrc file is used to specify the version of Node used in the project and for the CI build.

Style Guide

This repo uses ESLint with Prettier formatting.

The ESLint config extends from AirBnB, with a few changes. Refer to the .eslintrc.yml file in the root of the repo for info on the changes.

Release

Build

# from the project root:
yarn build

Deploy

The demo app is deployed with Now. These are the instructions to deploy with now.

# from the project root:
yarn build

cd build

now --name your-project-name

# for example:
now --name cubiio-myreads
> Ready! https://cubiio-myreads-rleglhnrla.now.sh/ (copied to clipboard) [6s]

Paste that URL into your browser when the build is complete, and you will see your deployed app.

Demo

The demo app is currently live here.

Screenshots

Main Page

Search Page