# konekt

> A reference implementation of six Kotlin toolkits on the domain of an eSIM subscriber account. The telecom is the fixture; the subject is what the stack costs to carry it, and the failures a green build does not show.

Page: https://kotlin.website/konekt

## Why it exists

[konekt](https://github.com/youndie/konekt) is not a product an operator can deploy and sell service
on. It is the domain of an eSIM subscriber account — balance and quotas, plans and packages, ordering
and installing an eSIM, roaming, history — chosen because it loads six toolkits honestly, without
contrivance. Everything outside that boundary is mocked on purpose: the billing system, the SM-DP+
that issues profiles, the payment gateway, the SMSC that would carry an OTP. What is not mocked is the
wiring.

| | |
|---|---|
| [kompot](https://kotlin.website/kompot) | the whole UI contract: the server describes a screen, the client renders it |
| [petich](https://kotlin.website/petich) | every operation that moves money, with compensation and a confirmation that expires |
| [booblik](https://kotlin.website/booblik) | the event bus between the server and its consumers |
| [tracy](https://kotlin.website/tracy) | structured logs and traces, keyed by `msisdn`, `iccid` and `orderId` |
| [metrik](https://kotlin.website/metrik) | latency, errors and deploy markers |
| [katcher](https://kotlin.website/katcher) | crashes, from the server, iOS and Android; breadcrumbs only on the desktop |

One purchase runs through a kompot form, a petich saga, the outbox, booblik and back to an open screen
over the realtime channel — and is visible whole in tracy by its order id.

## The two things written beside the code

**What each toolkit costs**: 17 database writes for a six-interceptor saga, a client release for a
corner radius, a broker restart for a topic. And **the failures a green build does not show**, each
with the guard that now catches it: a saga engine dropping outbox events silently, a conformance kit
passing vacuously, an Apple target nobody published.

## Observed, measured at the far end

"Delivered" in konekt means measured at the collector, not read off the agent's configuration — all
three observability libraries answer a missing key or an unreachable collector by doing nothing, so a
deployment that meant to be observed and is silent looks exactly like one that works. Four of those
rows were red first, each for a different reason, and each fix is linked from the README.

## What it costs, measured

On one CPU and 1 GiB — the chart's limits — on a rented two-core box, k6 on a second one:

| | on one core |
|---|---|
| a screen | p50 2–4 ms, p95 under 7 ms up to **400 requests a second**; the knee at about 800 |
| a purchase, the saga end to end | p95 about 20 ms, flat to **40 a second**; one purchase costs about ten screens |
| fifty concurrent purchases on one account | the twenty the money allowed, the rest refused; **no balance below zero, no double capture** |
| being observed (tracy + metrik) | under the noise at 400 rps |
| twelve hours at a steady rate | 131 061 checks, none failed; server memory +3.9 MiB/h and not levelling off — which twelve hours cannot call a leak or a settling heap |

## The rebrand, stated precisely

A second brand's palette ships from the server and the client applies it without a rebuild. Where the
boundary actually sits:

| Axis | Ships as |
|---|---|
| colours, every string, screens and flows | a server response — no client rebuild |
| the font family | a client release |
| corner radii and control heights | a client release — the wire has no vocabulary for shape, deliberately |
| a new kind of component | a client release — the dictionary is the API |

## Status

Built, and driven end to end by a docker-compose stand; every published tag is pulled back by CI and
walked again. The Compose client runs on the desktop, on Android and in the iOS simulator. Deploying
is a command somebody types: the Helm chart is real, and no workflow deploys it.
