Box - Die Abholstation

DB InfraGO AG needed rock-solid infrastructure for click and collect services. They chose Elixir.

The Story

Box – Die Abholstation is part of DB InfraGo’s vision for making their stations an ever-more useful part of daily life. Providing a pick-up and drop-off site for all kinds of deliveries — from pan-European retailers to local florists and dry-cleaners — orders can be collected on your way home, simply by using a secure locker at your local train station.

For this project, bitcrowd had to devise a communication protocol to connect DB InfraGo's services with DHL Packstations using Elixir.

A product for

Deutsche Bahn

Visit site
Phone-sized screen showing the UI for selecting a compartment size. Available sizes are shown with measurements and a line drawing of the compartment.
Phone-sized screenshot of the UI for selecting how to return an article through the Box system

Train stations in Germany (2023)

5697

Train travellers in Germany (2023)

1,8 billion

Packages sent in Germany (2023)

4,870,000,000
  • Phone-sized screenshot of a list of locations to choose
  • Phone-sized screenshot of the customer details form
  • Phone-sized screenshot of the merchant UI for quickly entering details for a new order
The Opportunity

Each day, millions of commuters pass through the same train stations on their way to and from work. For Deutsche Bahn, this raised a clear challenge: Stations should be more than transit points. To improve this, they aim to offer added value to travelers and to connect with local businesses.

Why? Because while many retailers already provide Click & Collect services, commuters still have to leave the station to pick up their orders - adding extra time and inconvenience to their daily routine.

What if you could get Click & Collect right at the train station?

By bringing Click & Collect directly to the train platform, Deutsche Bahn transforms stations into convenient pickup hubs. Commuters can collect parcels exactly where they already travel - without waiting for home deliveries or making additional trips to parcel shops. The service requires no app, account, or registration; customers simply use a personal pickup code sent via SMS or email.

The solution is “Box – Die Abholstation.”

Beyond convenience, the concept also promotes sustainability by reducing delivery routes and emissions in city centers. In partnership with selected providers, the stations can securely handle not only retail parcels but also medicines, rental items, and luggage. “Box – Die Abholstation” turns everyday transit spaces into practical, accessible service points - seamlessly integrating shopping into commuters’ daily lives.

Connecting with DHL Packstations

DHL Packstations are closely tailored to the company's own use case.

They often do not have a permanent internet connection. While a Packstation is offline, deliveries and pick-ups can still take place, which changes the system status.

This means that any number of change messages can arrive at once at any time. DHL's Packstation API Gateway forms a certain abstraction layer and smooths out the events. However, this also means another status layer that needs to be synchronised.

Have we got you interested?

If you have questions about the the processes behind this project, or have a similar project in mind, let's talk!

The Collaboration

Negotiating the specification for a technical product between two corporations the size of Deutsche Bahn and DHL is a complex task.

However, the agility of Bitcrowd's small, resourceful team made the process a success, resulting in an exceptional product.

The Communication Protocol

bitcrowd's first task was to develop a communication protocol that keeps the status of the Packstations synchronised across the three system boundaries and can handle connection interruptions and status changes in a self-healing manner.

It quickly became clear to bitcrowd's team of Elixir experts that the communication model between the systems would have to be a stateless protocol of immutable ‘all or nothing’ status requests.

A desired state change can therefore either be applied in full or must be discarded completely.

However, the discontinuous connection also meant that confirmations could arrive at any time, or only after many days. "Eventually confirmed" became the term of the week in the dev team.

API Works

From the outset, bitcrowd's small team demonstrated its ability to keep pace in the collaboration with a large corporation's development department. bitcrowd quickly took the lead in design, coordination, and implementation — achieving an early breakthrough by successfully exchanging the first API messages and status updates.

The breakthrough was soon achieved and the first messages and status changes were exchanged.

To ensure reliable testing, the team built a mock API server that mirrored the Packstation API’s behavior. Using Elixir’s lightweight Agent and GenServer processes, they were able to quickly simulate different states and provide flexible staging environments.

Would you like to find out more?

Are you thinking about a project like this and would like to discuss if Elixir is a good choice for you application, let's have a call!

Under the Umbrella

Elixir allows you to build clearly structured modular monoliths using the Umbrella App concept. In Elixir, an Umbrella App is a project that bundles several independent applications (‘apps’) in a common repository. These individual apps can be developed and tested independently, but share configuration, dependencies and build process. The strict separation between the apps allows the application to be clearly structured. If necessary, the system boundaries can also be used to transfer the individual apps to separate systems. This would also have been possible in other languages, but would have required much more discipline and auxiliary code.

Elixir's good-natured error handling made development easier and faster. The isolation and monitoring of Elixir processes in so-called supervision trees means that errors are limited to sub-processes. The other parts of the application remain stable and performant. This makes debugging much easier.

Background processes

The architecture of Box – The Pick-up Station requires the effective management of a large number of background processes. Elixir just had the right thing!

Oban is a job processing library for Elixir that reliably manages background jobs via a PostgreSQL database. It supports features such as retries, priorities, scheduling, cron jobs and distributed execution across multiple nodes. Unlike other programming languages, Elixir offers integrated key-value store functionalities that Oban can access. This means that background process control is firmly integrated into the system. It is a significant advantage when such an essential component does not have to be outsourced to external applications such as Redis.

Phoenix Liveview

Phoenix LiveView is a feature of the Phoenix Framework that enables developers to build interactive web applications without relying heavily on client-side JavaScript. Instead of separating frontend and backend with an API, LiveView keeps UI state on the server and communicates with the browser through a persistent connection. This allows dynamic features such as live validation, search, and dashboards to be implemented primarily in Elixir while still delivering responsive user experiences.

Phoenix LiveView allowed the bitcrowd team to implement the management interfaces without additional front-end frameworks. Nevertheless, the GUIs offer real-time updates and excellent responsiveness. Updates are handled efficiently by sending only small DOM changes to the browser rather than reloading entire pages. Because LiveView runs on the BEAM, each user interface is managed by lightweight processes that scale well and provide strong fault tolerance.

This architecture simplifies application design and makes real-time features easier to build while keeping the server as the single source of truth.

Elixir is a great Environment

If you have not yet looked at Elixir, you are probably missing out. bitcrowd ensures that even your first project is a success.

Elixir's clarity

When new team members are introduced on the app, they are often enthusiastic about Elixir's clarity.

Where other programming languages require syntactically complex constructs for error handling, Elixir is largely free of ‘framework noise’.

In fact, developers often praise Elixir as a ‘say what you mean’ programming language. Elixir code is explicit, without the magic typical of Rails, for example, which makes it easier to learn. At the same time, there are many useful abstraction layers.

Check out our other Case Studies

Click below to learn about other Elixir and AI projects from bitcrowd.

;