Emulators

Building block emulators are simple application that “emulates“ the behaviour of specific building block (BB). The implementations are based on Govstack Specification. They are example implementation that mimics the actual behaviour of BB. They may not provide the complete functionality of specific BB, but should provide specified endpoints in the Govstack Specification. Emulators should provide necessary API endpoints for Specific Application to accomplish specific use-case. In that case emulator should provide only the endpoints that are needed for specific use-case, and should evolve only when new use-case requires not yet implemented API endpoints.

In practical terms, an 'emulator' can be likened to a flight simulator employed to train pilots before the actual aircraft is constructed and tested. Similarly, in our context, a emulator is employed to support the development of use-cases before actual building block to be developed.

What do we use to build it?

Name
Purpose

Java 17/Spring Boot 3.1

Application framework

Gradle

Build tool

Helm chart

Kubernetes deployment

Where do we demo it?

Building Block emulator implementations:

Building Block
Building Block Emulator
Documentation
SPEC Version

Emulator Adaptor implementations:

Adaptors are used to map existing APIs and functionality in a Digital Public Good into a format and scheme that is compatible with the GovStack API specifications. Adaptors may transform data formats (ie. XML to json), may transform URLs/protocols, or may be used to map GovStack APIs and data structures into sector-specific standards (ie. FHIR patient records). An adaptor (A) represents a candidate-specific solution to the delta between the API defined in the BB spec (GS) and the actual API (X) of candidate “X”. That’s A = GS - X .

In a practical sense, an 'adaptor' can be compared to a waiter who translates client orders into requests for the chef. Likewise, in our scenario, an adaptor is utilized to facilitate the transformation of requests for the building blocks.

For comprehensive details on Adaptors, please refer to the official GovStack specification.

Building Block
Building Block Adaptor
Building Block to adapt
Documentation
Spec Version

Which conceptual decisions do we follow?

  • Health check endpoints (org.springframework.boot:spring-boot-starter-actuator)

  • Structured logging (net.logstash.logback:logstash-logback-encoder), to be able to output logs in JSON format for easier collecting.

  • Swagger UI

  • Open API spec JSON & YAML