Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dev All user data moved to community service. Jan 3, 2018
doc Add naive implementation of tag suggester Mar 21, 2018
env Lister (#168) Jan 29, 2018
public update spot data (#665) Sep 13, 2018
src fetch lists when they are actually needed, and stuff (#760) Oct 22, 2018
tools remove dependency to config, as its causing problems in jenkins pipel… Apr 10, 2018
.bithoundrc Enpoint /howru tells detects database problems. Sep 6, 2017
.eslintignore
.eslintrc.js 273 correct image name (#294) Mar 13, 2018
.gitignore
.nvmrc Fix lint warning, prepare for less Promise indentation, bump to node 8. Nov 14, 2017
.travis.yml booksreducer added (#232) Feb 26, 2018
docker-compose.yml 274 systemlists to profilepage (#295) Mar 12, 2018
license Use the demo hostname in donfig. Sep 27, 2017
nvm.sh created app with create-react-app and restructured a bit Aug 29, 2017
package-lock.json Merge pull request #764 from DBCDK/721-clickable-author-name Oct 18, 2018
package.json Merge pull request #763 from DBCDK/616-reorder-list-elements Oct 18, 2018
readme.md

readme.md

Content First

The system currently runs on content-first.demo.dbc.dk, and you can get an overview of how it is composed in the architecture description.

For development of the system, see src.

Deployment

The service's test database requires at least PostgreSQL 9.6, but the schemas only require support for JSONB.

To run the database tests against the server (requires postgresql):

$ . /nvm.sh
$ nvm install
$ npm install
$ cp env/integration.env current.env
$ npm run test-acceptance --silent

To start the server in staging or production mode:

$ . /nvm.sh
$ nvm install
$ npm install --production
$ cp env/production.env current.env
$ npm run start-backend

required data files

Some json files need to be copied to src/data in order to build the application. Also check out which files are required for building and how to populate the app with data here.

Build server

Use the exclude list when the build server makes an archive file of the result of the build. Use like this:

tar -X tools/archive-excludes.txt -cz -f $JOB_BASE_NAME-$BUILD_NUMBER.tar.gz .

Environments

The backend service controlled by environment variables. Most scripts assume that such variables are set in your local file current.env. If you are just running the system on your own machine during development, you can most likely just use an empty current.env, but it has to exist. The env directory holds templates for other used configurations. If you need to tweak settings, the application obeys the following environment variables.

Environment variable Default Effect
AUTH_CLIENT_ID content-first Id known to authentication service
AUTH_CLIENT_SECRET something Secret known to authentication service & salt for hashing
AUTH_URL https://auth.dbc.dk Where to contact authentication service
COMMUNITY_NAME Læsekompasset Id in community service
COMMUNITY_URL http://localhost:3003 Where to contact community service
DB_CONNECTIONS_POOL_MAX 10 Maximum connections in DB pool
DB_CONNECTIONS_POOL_MIN 2 Minimum connections in DB pool
DB_HOST 127.0.0.1 Database host
DB_PORT 5432 Database port
DB_NAME contentfirst Name of the database
DB_USER contentfirst Database user
DB_USER_PASSWORD Database password
INTERNAL_PORT 3002 TCP port for the internal service
LOG_LEVEL INFO Verbosity of service log (OFF, ERROR, WARN, WARNING, INFO, DEBUG, TRACE)
LOG_SERVICE_ERRORS 1 Record all 5xx errors (1), or ignore 5xx errors (0)
LOGIN_URL https://login.bib.dk Where to contact Adgangsplatform
NODE_ENV development Controls other service settings (development, ci, production)
PORT 3001 TCP port for the public service
PRETTY_LOG 1 Pretty printed log statements (1), or one-line log statements (0)

Endpoints

The backend service has the following admistrative endpoints:

Endpoint Function
/howru Returns the service status as JSON.
/pid Returns the process id of the service.
/v1/stats Cleans up database and returns statistics about the service.

See also service endpoints.


Build Status bitHound Overall Score Coverage Status LGTM