You need node
and npm
installed on your machine.
- Clone the Github repo to a local folder.
- Move into the created folder of files including
package.json
and runnpm install
. - In a terminal window run
npm run start
to run the React app in your browser on the local development server athttp://localhost:3000
. - In another terminal window run
npm run server
to run thejson-server
stand-in REST API.
- The "backend" data object can be inspected in the
db.json
file, including changes, and can also be seen athttp://localhost:7000/timers
in your browser. - This app was created using Create React App.
- This app was created based on a project in the excellent book
Fullstack React: The Complete Guide to ReactJS and Friends
by Anthony Accomazzo, Nate Murray, Ari Lerner, Clay Allsopp, David Guttman, and Tyler McGinnis. - For an excellent intro to React function components using hooks, see Brad Traversy's tutorial on YouTube channel Traversy Media, the
React Crash Course 2021
. - For an excellent explanation of the
userReducer
React hook, see the articleExamples of the useReducer Hook
by Dave Ceddia. - Your dev environment should respond to changes to
.eslintrc.json
file. To check setup, change thequotes
rule fromsingle
todouble
. Restarting the dev server should populate error messages, andnpm run lint
should autofix. If your dev environment does not respond to changes to this file when you change the file and restart the dev server, troubleshooting advice can be found online for setting up specific IDE's witheslint
.
App
- Title
- AllTimers
- HideableAddTimer
AllTimers
- Editable Timer components
Editable Timer
- determines whether to show Timer or TimerForm
Timer
- title
- project
- display running timer
- delete button
- edit button
- delete button
- start / stop timer button
Hideable Add Timer
- determiners whether to display + icon or Timer Form
Timer Form
- onclick methods
- text Add or Edit
StartStopButton