This is the example note taking app code that the UI group wrote, repackaged into a typical node project structure. If we want to run tests, we can't just leave our react code in the index.html, but need to have our code in separate script files and exported via module exports.
This project uses:
- a node server running ecstatic to serve the site.
- jest to test, along with a jsx preprocessor script.
- browserify (with reactify/watchify) to build/translate the code for deployment
Jquery and Bootstrap are included and referenced, but not currently used. If you don't want them, get rid of them!
One advantage of the node-style structure is that functions/components can be separated out into individual files (as long as you correctly export/require). Currently, everything is in 'public/scripts/main.js'.
-
Clone this repo.
-
Run
npm install
. -
If editing script files, run
watchify public/scripts/main.js -v -o public/scripts/build/main.js
, leave running to update built file on the fly. N.B. You will need to intall watchify globally in order to invoke itnpm install -g watchify
. -
To view in local browser, run
npm start
. (Or install nodemon and use that.) -
To test, run
npm test
. (There is a sample function currently being tested)