Skip to content
ferng edited this page Jan 24, 2020 · 14 revisions

runlog-js - an exercise log, mainly for running, mainly for me

  • Enter and review runs, as in a regular running log, not wanting to rely on my garmin and it's website to review past data many years hence

Running runlog-js

The application uses sqlite to store data, without it an error will be logged and the application will end (to be honest, as it's effectively a db front end it's pretty much useless without a db!)

configuration

  • config.js: server port, database, log location

deployment:

  • build bundles
# front end
npm run web-front

# backend end
npm run web-back

# package up files
./build.sh
  • deploy
# copy to server
scp runlog.tar.gz user@host:runlog.tar.gz

# on server
tar -C apps/runlog -zxvf runlog.tar.gz
cd apps/runlog
npm install --only=prod
  • start up runlog
nohup node bundle-back.js &

Development

  • ES6
  • webpack (with babel) and webpack-dev-server for live reloading
  • bunyan (testing)
  • tape (logging)

environment

building

  • front end
npm run web-front
  • backend end
npm run web-back
  • package up files

local instance:

  • run mongodb
  • start up server:
npm start
npm run start-plain
  • run dev-server
npm run web-dev

Testing

run back-end tests:

npm run test-back

run front-end tests:

npm run test-front

run all tests:

npm test

run one spec file while debugging

  • open .vscode/launch.json
  • change "program" in "Single" configuration to point to the spec you want to run
  • run "Single" in the visual studio code debugger

Logging

  • change configuration if appropriate (see above)
  • log file currently set to (runlog.log.json)

Documentation

Generate API documentation:

npm run docs

Generate project developer documentation:

npm run docs-internal