Create Folders and Notes
Note: when you re-load any page, only the original folders and notes will show - any folders/notes you've created will disappear because, as a function of the free service, "changes are faked and aren't persisted".
Uses https://github.com/typicode/json-server fake REST API for the database. See json data at https://my-json-server.typicode.com/asktami/react-router-context-noteful.
Noteful JSON server
To get your local copy of the noteful 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 Ctrl-c to close the server
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 /note/
- 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 two 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 will be made to a local server called noteful-json-server that you'll need to have running separately to your noteful React application.
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.
This project was bootstrapped with Create React App.
In the project directory, you can run:
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.
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
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.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.
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
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
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