A.P. Møller-Maersk
Maersk is one of the largest container shipping companies in the world. APM Terminals, which operates more than 70 terminals worldwide, is part of the group. As part of a program to streamline terminal operations, the Flow Execution System was developed, which consists of various software components. I was a lead developer for one of these components, called Gate.
Gate visualizes and directs trucks that collect and deliver containers efficiently (pull-based) and safely across the terminal grounds. The goal is to prevent truck congestion (safety) while simultaneously keeping waiting times at the container cranes low (efficiency). The route is determined based on the type of container transaction (collection or delivery, import or export).
The Gate application is an event-sourced system, with a truck visit as the primary unit. Events are received from the Terminal Operating System (Navis N4) via Kafka, where they are converted into commands for the truck visit. The business logic is executed, resulting in domain events. These are, in turn, converted into a) external messages to the Terminal Operating System to direct the trucks and b) projections in the database that are used to update the front-end via Server-Side Events (SSE). This code is written in Kotlin, using Exposed and Arrow-kt, and functional programming principles.
The front-end is developed in React and provides operators in the control room with insight into the position of trucks: where they are, what is the planned route, what is the current duration of the visit compared to the planned duration, where there are congestions, and which trucks require attention (e.g., due to technical issues). A second part of the front-end is located on displays placed at various locations throughout the terminal and serves to instruct drivers to drive to the correct positions.
Kotlin, Ktor, Arrow, Functional Programming, Kafka, Integration, Kubernetes, PostgresQL, Server Side Events (SSE)