Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

DBCDK/biblo

Repository files navigation

Biblo

GitHub tag David David Build Status Coverage Status Code Climate bitHound Overall Score

As default the application will load on localhost:8080. Se a running example on biblo.demo.dbc.dk

How to install and run the application

// Build and install the application
git clone https://github.com/DBCDK/biblo.git
npm install
npm run build

// create config file
mv config.example.js config.js

// fill out the blanks in the config file. 
// NB! a lot of the services are restricted by DBC

// Start the application
 npm run serve

Environment Varibles

The following environment variables can be used to override default settings in the application

  • EMAIL_REDIRECT Used when a user creates a new account. The value given in EMAIL_REDIRECT will be used as basepath in the link that'll appear in the confirmation email sent to the user. Typically you'll want the value in EMAIL_REDIRECT to be the same as the basepath for the given site the user is signing up at. I.e pg.demo.dbc.dk.

    The default value is localhost

  • KAFKA_TOPIC (inherited from dbc-node-logger) This defines which topic in Kafka the log messages should be associated with

  • KAFKA_HOST (inherited from dbc-node-logger) String that defines the Zookeeper connectionstring. Should be defined as host:port. see winston-kafka-transport and dbc-node-logger

  • NEW_RELIC_APP_NAME This variable is used to configure the name with which the application should appear in New Relic but also elsewhere. Currently this value is also used to identify the application in logs and appended to secrets used in Redis.

    The default value is app_name

  • NODE_APPLICATION Use this varialbe to let the application how stylesheets are compiled and which jade templates are used. Currently two values are used to control compiling of SASS and delivering of templates:

    • pg Should be used when building Palles Gavebod

    The default value is pg

  • PORT Defines which portnumber the application should use when bootinh up. If PORT is undefined the application will be accecsible at port 8080 (i.e. localhost:8080)

    The default value is 8080

  • NODE_WEB_WORKERS Defines how many workers to use.

    The default value is 1

  • NODE_WEB_BROKERS Defines how many brokers to use.

    The default value is 1

  • AUTO_REBOOT Defines if a worker reboots on crash. (This does not apply to the whole application, just the workers).

    The default value is true

  • FRONT_PAGE_BUCKET Defines the bucket we use to get the layout for the front page.

    The default value is uxdev-biblo-content-frontpage

  • DYNAMO_TABLE_NAME Overwrites the default generated table name. The default makes is unique-ish.

  • DYNAMO_READ_CAP Overwrites the default provisioned read capacity, this needs to be set on a new table name, or the change won't affect the system.

    The default value is 10

  • DYNAMO_WRITE_CAP Overwrites the default provisioned write capacity, this needs to be set on a new table name, or the change won't affect the system.

    The default value is 10

New Relic

As New Relic is used by DBC A/S this application requires New Relic to be configured. If you want to run the application but can't provide a New Relic configuration you can start the application with NEW_RELIC_NO_CONFIG_FILE=true which will throw an error but wont crash your application.

Testing

Unit tests

Unit tests are placed with the modules and components in a tests folder to run the tests: npm run test

Selenium tests

The selenium tests (found in the /selenium directory) are integration tests, and mainly run in a chrome instance using ChromeDriver. to run tests: npm run selenium

If a SauceLabs account is available, you can set ENV variables SAUCE_USERNAME and SAUCE_ACCESS_KEY and then enable it in selenium_test.js