General Implementation Requirements

General Design

Follow the CESSDA Technical Guidelines, in particular the 12-factor app principles.

This includes the loading of configuration settings from the environment.

Port Binding

The application exposes one port and has no external dependencies.

Defaults are: Cashier 1336, Coffee Machine 1337, Waiter 1338.

Healthcheck

All APIs must have a health endpoint:

GET /healthcheck

Expected response

Code Content
200 {"message: "Ok"}

Request-ID

With each API call, a HTTP custom header X-Request-ID must be included.

  • If your application receives a call that does not have the header, generate a random UUID and treat that as the call’s X-Request-ID.
  • Forward the X-Request-ID through all internal routines and include it in all log messages.
  • Send the X-Request-ID along all external API calls that occur as a consequence of processing the original call.

Logging

  • Logging must output messages to STDOUT and STDERR for all calls and answers.
  • Output should be JSON in GELF message format.
  • Log statements should contain the X-Request-ID as custom field.

Metrics

To integrate with CESSDA Prometheus Metrics, a Prometheus compliant endpoint must be defined.

Unit Testing

Implement at least one unit test.

Build Script

A build script that pulls all dependencies, runs the test suite and creates the binary must be included.

The build script must be in the form of a Dockerfile.