Skip to main content

Separate Presentation Logic and Orchestration into Different Applications

Outline

Separate digital services into application components oriented around their function. Build the user interface application using Typescript/NodeJS and Nunjucks templates, and use the UI components and patterns provided by the MoJ and GOV.UK design systems. If the digital service implements business logic or requires orchestration of dependencies, build a back end application using Kotlin to contain this. The front end application should communicate with the back end application using a Backend For Frontend integration pattern.

Rationale

Implementing front end services in Typescript/NodeJS supports seamless integration of the design system components common to government and Ministry of Justice systems. The design systems provide code as an NPM package and include HTML, JavaScript, CSS and Nunjucks macros that are simple to include in Typescript/NodeJS applications.

Separating business and orchestration logic into a dedicated back end application keeps this separate from presentation logic. Building back end logic in Kotlin also helps when splitting this out into a shared domain service to share across the HMPPS Digital landscape.

Implementation

Front End Components

Back End Components

  • Use the HMPPS Digital Kotlin template as the starting point for your implementation of a back end orchestration service