Web app bootstrapped with Create React App
An Udacity FEND Nanodegree repository. Demonstrate functional app using React approach.
- Clone the Project -
git clone https://github.com/rudimusmaximus/FENDp6.git
- Go into the directory where the project now lives -
cd FENDp6
- Install the dependencies -
npm install
- Start the app -
npm start
I used nvm to load the LTS versions of Node and it's npm.
Now using node v10.13.0 (npm v6.4.1)
- Uses starter code from https://github.com/udacity/reactnd-project-myreads-starter
Area | Comments |
---|---|
1. eslint issue revealed with cli$ npm ls eslint Prevents npm start |
a. ![]() b. The above conflict results when manually installing eslint and the react plug in for it as follows: npm install eslint --save-dev npm install eslint-plugin-react --save-dev c. Fix with remove node directories and package-lock.json AND eslint 5.9.0 from devDependencies in package.json rm package-lock.json rm -rf node_modules npm uninstall -save eslint d. prefere local npm installations, watch for conflicts of other script version requirements |
2. Importing using ES6 modules | a. Becuase React uses webpack (a module bundler), we can use modules from npm installed libraries as follows. $ npm install --save react-router-dom and in the code import { BrowserRouter, Route, Link } from 'react-router-dom' .b. further reading: Why babel and webpack with React When and Why to Use webpack |
3. Installing peer dependencies | a. read about history and why you can't do this automatically stackoverflow b. solution is to take error warning: npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself. edit your package.json for each of these warnings "ajv":"^6.0.0" remove local node modules and package lock rm package-lock.json rm -rf node_modules npm install |
4. prevent usage of deprecated methods | a. research this as we had to change componentWillReceiveProps to UNSAFE_componentWillReceiveProps b. TODO: document best practice for future projects. |
The following assumptions were made by evaluating the code and all given instructions (per overview):
- Demonstrate React thinking approach in markdown file DESIGN_NOTES.md
- Starter code has all CSS and HTML, but omits the React code; it is a static HTML page of the finished app without interactive functionality
- Reviewer will have npm installed on their machine
- Focus on functional React code
- Required to make use of the
booksAPI.js
file that comes with the starter template to interact with the backend API. It's methods are descripted in the starter portion of the README.md - Avoid using
.jsx
extension; stick with.js
Similar to my 'DevFlow' style in FENDp5 - issue labels and template, .eslintrc, .editorconfig, GIT FLOW, Atom, and GitKraken with repo hosted on GitHub.
I read:
- [x](TODO links) I watched:
- My Reads / React Zoom Study Session w/ Doug Brown
- React Router training
These possible packages if needed, install from cli to see if newer version from contacts exercise these would appear in package.json:
"dependencies": {
"escape-string-regexp": "^1.0.5", [not used this time]
"form-serialize": "^0.7.2",[not used this time]
"react-router-dom": "^4.1.1",
"sort-by": "^1.2.0"[not used this time]
},
Watch edits to DESIGN_NOTES.md
across commits to document my iteration and design thinking.
This is the starter template for the final assessment project for Udacity's React Fundamentals course. The goal of this template is to save you time by providing a static example of the CSS and HTML markup that may be used, but without any of the React code that is needed to complete the project. If you choose to start with this template, your job will be to add interactivity to the app by refactoring the static code in this 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.
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 for you to use with your app.
├── package.json # npm package manager file. It's unlikely that you'll need to modify this.
├── public
│ ├── favicon.ico # React Icon, You may change if you wish.
│ └── index.html # DO NOT MODIFY
└── src
├── App.css # Styles for your app. Feel free to customize this as you desire.
├── App.js # This is the root of your app. Contains static HTML right now.
├── App.test.js # Used for testing. Provided with Create React App. Testing is encouraged, but not required.
├── 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. You probably won't need to change anything here.
└── index.js # You should not need to modify this file. It is used for DOM rendering only.
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.
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:
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.
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.
This project was bootstrapped with Create React App. You can find more information on how to perform common tasks here.
For details, check out .github/CONTRIBUTING.md