Technical Implementation

Hi there, you are probably new to the project. Here you can find a quick overview of what you can expect and what is expected from you as a contributor.

Technology

General

Our main programming language is TypeScript. TypeScript is a popular programming language which is compiled into JavaScript and offers strict data types, readable code and a compiler that catches many errors. Deep integration in development tools helps teams build and maintain large solutions.

We use NX to manage the monorepo structure. We have one set of NodeJS modules used by all code and any changes in there affect potentially multiple services.

Tool
Description

Scripts and server-side framework.

Programming language.

Monorepo tools and code scaffolding.

Frontend

When creating interfaces, teams should use the React frontend framework. With React, teams create user interface (UI) components which they then arrange to form complete interfaces.

Many of these UI components can be reused for multiple interfaces, across teams and projects, e.g. buttons, inputs and navigation. Teams should add these to Storybook, which provides an overview of all reusable components, as well as a testing environment for interested stakeholders.

Tool
Description

UI framework.

Front-end framework with routing and server side rendering.

Stylesheets in TypeScript.

Develop and document React components in isolation.

GraphQL client.

Generate GraphQL clients and types.

Automated browser testing tool.

Backend

The backend is also implemented in TypeScript, using the Node.JS framework. By using the same programming language in the frontend and backend, we can share code, e.g. types and validation. The work becomes more efficient, with fewer developer roles since more developers can work on both sides. Node.JS also has a large and active open-source community, with mature code libraries covering most needs.

Backend servers should provide a GraphQL interface for frontend clients. It defines a schema that describes all the available data and operations. Whenever possible, the schema should represent an idealised world independent of implementation details. When designed well, it is possible to replace backend systems without changing the schema or frontend.

GraphQL provides better separation between the frontend and backend. In one GraphQL query, the frontend can ask for everything it requires. The GraphQL server calls web services and databases as needed to resolve the query, and the result contains only the data that the frontend requested.

Tool
Description

Server-side framework for NodeJS.

Database object relational mapper.

Generate clients and types for OpenAPI APIs.

Code Quality

Tool
Description

Automated testing tool.

Code checker.

Code formatter.

Protocols and specifications

Tool
Description

API protocol for our frontend projects.

Specification to describe rest APIs.

Authentication protocols.

Code storage and Repositories

The main digital government platform is in a monorepo stored in GitHub. It contains the code for all of its solutions in one code repository with collaboration between all teams. See more on monorepo.

Tool
Description

Platform to create, store, manage and share code.

Open source repository for Iceland's digital services.

Infrastructure

We host our solutions in a containerised cloud environment, using Docker and Kubernetes, on AWS. infrastructure. Applications are composed of services that are packaged in Docker containers and then deployed in a Kubernetes cluster using Helm. To avoid lock-in, we use open-source databases and tools that we can host on any cloud infrastructure.

With Docker containers, services run independently of the hardware. They are easy to spin up, especially suitable for Agile development with continuous delivery and can handle increased load and hardware problems.

We've configured our cloud environment with a secure virtual private network that limits external access to sensitive services as well as allowing us to set up VPN connections and fixed IP addresses to integrate with external services. We also have an X-Road Security Server to access other government organisations through Straumurinn.

Tool
Description

Virtual machine containers for continuous integration and deployment.

Host docker containers in production.

Kubernetes deployment configuration.

X-Road is a centrally managed distributed Data Exchange Layer between information systems.

The Icelandic government x-road network.

Content and documentation

Tool
Description

Content management for technical documentation.

Headless content management system for application's content.

Tool used for internal documentation and task management.

Practices

To contribute you need to follow the standard GitHub Pull Request (PR) workflow. When you open a PR, your code will be run through the CI process automatically. Ask for a code-review and when you get an approval, merge to main. Rinse and repeat.

When a code change gets on main, that will create Docker containers for all services and everything will get deployed to Dev env. For more info please see the Continuous Delivery process.

We expect contributors to deliver the following:

Starting a new project/application

If you are adding a new application, please follow the instructions here.

Dockerizing

You simply need to add an NX target to your service to enable creating a Docker image for it. For more info see dockerizing.

Kubernetes

We have developed a DSL to describe a service infrastructure setup. You pretty much only need to add your ingress (optional), environment variables (optional) and secrets (optional) and your service can get deployed to Dev. For more info, please see Service Configuration.

Last updated