Skip to content
create react app, CRUD, routes, functional components, dynamic routing, programmatic navigation with history, context, propTypes
JavaScript HTML CSS
Branch: master
Clone or download
Latest commit 2035e3b Oct 30, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
build updated Oct 30, 2019
public to deploy at zeit.com Oct 26, 2019
src updated tests Oct 27, 2019
wireframe section child of article, aside not child of main Sep 17, 2019
.eslintrc.json updated Oct 23, 2019
.gitignore updated Oct 23, 2019
README.md updated Oct 30, 2019
db BACKUP.json folderId to id_folder db.json to postgres ===to== Oct 24, 2019
example.env updated Oct 30, 2019
noteful.png updated Oct 26, 2019
package-lock.json updated Oct 23, 2019
package.json updated EditNote to handle number or text noteId Oct 27, 2019

README.md

noteful-react-client

Noteful screenshot

View Live

Description

Works with https://github.com/asktami/noteful-api.

There are 3 routes: the main route, the dynamic folder route and a dynamic note route.

  • Each route should have a header, main section, and a sidebar section

  • Every route will have the same header section, the app's title should be a link to the main route

  • The main route: - Should be displayed when the path is / - The main section will display all of the available notes - - Each note should show it's name and modified date - The sidebar will display a list of folders with none selected

  • The dynamic folder route: - Should be displayed when the path is /folder/ - The folder-id will reference an id of one of the folders in state - The main section should display only the notes that are "in" the selected folder - The sidebar should display the folder list with the selected folder highlighted

  • The dynamic note route: - Should be displayed when the path is /notes/ - The note-id will reference an id of one of the notes in state - The main section should display the currently selected notes name, modified date and content - The sidebar should display the folder of the currently selected note as well as a "back" button

  • Use the React Context API instead of prop drilling

  • Implement fetch requests to two endpoints when the application mounts: /folders and /notes. Store the response from these requests using a setState inside the main App component

  • The API calls can be made to either a local json server or a PostgreSQL database

  • Implement the delete button for each note in the list in the main route and folder route

  • Implement the delete button on the note page, if the delete is successful, redirect to the / path

  • Implement "add-folder" and "add-note" controlled component forms

  • Implement "edit-folder" and "edit-note" controlled component forms

  • A folder is a parent record to child note records

Setup

  1. See https://github.com/asktami/noteful-api for instructions on installing the backend API

  2. Clone this repo

  3. In Terminal, change to the directory on your computer that contains this repo

  4. Install dependencies: npm install

  5. Environment:

    • Prepare the environment file: cp example.env .env
    • Replace values in .env with your custom values
    • Replace the value for REACT_APP_API_KEY with the same API token value you use in your backend API
  6. Start the app in a web browser: npm start

To Use A Noteful JSON server

  1. To get your local copy of the Noteful JSON API, clone this project into your local projects folder:
      git clone https://github.com/tomatau/noteful-json-server
      cd ./noteful-json-server
      npm install
      npm start

      Use db BACKUP.json, from this repo, as the datasource (renamed as db.json, replacing the existing db.json).

      Ctrl-c to close the server
  1. Change the backend API endpoints in ./src/config.js

You can see documentation for the JSON server once its started by visiting http://localhost:9090. You can see all of the data currently stored in the server by visiting http://localhost:9090/db.

More info is at https://github.com/typicode/json-server - a fake REST API for the database.


Create React App

This project was bootstrapped with Create React App.

Available Scripts

In the project directory, you can run:

npm start

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

npm test

Launches the test runner in the interactive watch mode.
See the section about running tests for more information.

npm run build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.
Your app is ready to be deployed!

See the section about deployment for more information.

npm run eject

Note: this is a one-way operation. Once you eject, you can’t go back!

If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

Learn More

You can learn more in the Create React App documentation.

To learn React, check out the React documentation.

Code Splitting

This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

Analyzing the Bundle Size

This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

Making a Progressive Web App

This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

Advanced Configuration

This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

Deployment

This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

npm run build fails to minify

This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

You can’t perform that action at this time.