The server-side code dependencies are managed with npm and requires that Grunt is globally installed (npm install -g grunt-cli). The front-end dependencies are managed with Bower; you can install it via npm install -g bower if you don’t have it on your system.
To fetch dependencies and get cooking:
npm install and ensure redis, elasticsearch, postgres are all running
As part of the npm install process, the postinstall script will install the Bower dependencies for you.
Copy config/local.json.example to config/local.json, and put your local info in there.
Run ./bin/create_db.sh to create the database
this script currently hard-codes the db user, password, and dbname to ‘chronicle’ (issue #112)
Run ./bin/migrate.js to run all the migrations that create the database tables and indexes. (This script also reindexes elasticsearch, but on the first pass, you don’t have data in postgres to copy over.)
Run ./bin/create_test_data.js to create a test user and test data
the test user is defined in the config file
the test data is a set of visits created using the URLs in config/test-urls.js. Over time we’ll experiment with different test data sets, might wind up with a test-urls directory instead.
Alias for grunt lint Grunt task. This task gets run during the precommit Git hook.
outdated
Alias for npm outdated --depth 0 to list top-level outdated modules in your package.json file. For more information, see https://docs.npmjs.com/cli/outdated.
postinstall
Runs after the package is installed, and automatically installs/updates the Bower dependencies.
shrinkwrap
Alias for npm shrinkwrap --dev and npm run validate to generate and validate npm-shrinkwrap.json file (including devDependencies).
start
Runs grunt serve.
test
Runs unit and functional tests.
validate
Alias for grunt validate-shrinkwrap task (ignoring any errors which may be reported).
Creating Dummy Data
If you just want to test something quickly with a small, known test data set:
Run ./bin/create_db.sh to drop and re-create the local Postgres database.
Run ./bin/migrate.js to apply any Postgres migrations specified in the server/db/migrations/ directory.
To enable test data, ensure the testUser.enabled config option is set in config/local.json.
You can use the default id and email (defined in server/config.js), or set them yourself.
You can set the values via env vars or config values.
See server/config.js for the defaults and which config values or env vars to use.
Run ./bin/create_test_data.js to create a dummy user and a few dummy visits.
The created dummy visits which will be created can be found in the config/test-urls.js file.
Chronicle
find everything you’ve ever found
Installation
Large Tools
Chronicle is built using Node.js, ElasticSearch, PostgreSQL, and Redis, so you’ll want to install the current stable version of all of these.
If you are using Mac OS and have Homebrew installed, this incantation should work:
Code
The server-side code dependencies are managed with npm and requires that Grunt is globally installed (
npm install -g grunt-cli). The front-end dependencies are managed with Bower; you can install it vianpm install -g bowerif you don’t have it on your system.To fetch dependencies and get cooking:
npm installand ensure redis, elasticsearch, postgres are all runningpostinstallscript will install the Bower dependencies for you.config/local.json.exampletoconfig/local.json, and put your local info in there../bin/create_db.shto create the database./bin/migrate.jsto run all the migrations that create the database tables and indexes. (This script also reindexes elasticsearch, but on the first pass, you don’t have data in postgres to copy over.)./bin/create_test_data.jsto create a test user and test dataconfig/test-urls.js. Over time we’ll experiment with different test data sets, might wind up with a test-urls directory instead.npm startTests
Right now the test suite consists entirely of functional tests that require Selenium Server 2.44.0.
Prerequisites
Run the tests
Run the following in separate terminal windows/tabs:
java -jar path/to/selenium-server-standalone-2.44.0.jargrunt testAvailable Grunt Tasks
autoprefixerbuildchangelogcleancontributorscopycopyrightcsshapijscsjshintjsonlintlintsassservevalidate-shrinkwrapwatchnpm Scripts
authorsgrunt contributorsGrunt task.lintgrunt lintGrunt task. This task gets run during the precommit Git hook.outdatednpm outdated --depth 0to list top-level outdated modules in your package.json file. For more information, see https://docs.npmjs.com/cli/outdated.postinstallshrinkwrapnpm shrinkwrap --devandnpm run validateto generate and validate npm-shrinkwrap.json file (including devDependencies).startgrunt serve.testvalidategrunt validate-shrinkwraptask (ignoring any errors which may be reported).Creating Dummy Data
If you just want to test something quickly with a small, known test data set:
./bin/create_db.shto drop and re-create the local Postgres database../bin/migrate.jsto apply any Postgres migrations specified in theserver/db/migrations/directory.testUser.enabledconfig option is set inconfig/local.json.server/config.js), or set them yourself. You can set the values via env vars or config values. Seeserver/config.jsfor the defaults and which config values or env vars to use../bin/create_test_data.jsto create a dummy user and a few dummy visits.config/test-urls.jsfile.Learn More