Skip to content

01KLife

02KLife fitness app

Every kilometre, ranked live on race day.

KLife is Krystal Water's fitness app. Every day, people use it to track runs, walks and rides, join challenges and keep their streaks going. On race day it becomes the timing system: each runner's phone measures their race, and results update live for runners, organisers and spectators. I designed the architecture and built every part of it.

Expo · React Native · NestJS · PostgreSQL · Redis · Next.js · 2026

ShareXLinkedInReddit
KLife · Mobile app, admin and live leaderboard
KLife marketing site on a laptop with the mobile app beside it: Live Healthier. Move Together.

02Highlights

What went into it.

  1. 01

    Results organisers can trust

    Rankings reward runners who followed the official course, not only the fastest clock, and physically impossible GPS points are rejected on the server.

  2. 02

    Live leaderboards that scale

    Standings refresh every three seconds for everyone watching. Each board is computed once and shared, so cost grows with boards, not spectators.

  3. 03

    Accurate in poor coverage

    When GPS weakens, distance falls back to the step counter and motion sensors, then hands back to GPS when the signal returns.

  4. 04

    A run is never lost

    Tracking continues with the screen off or the app killed, shows on the lock screen and Dynamic Island, and every workout is queued until the server confirms it.

  5. 05

    Native speed

    Animations and charts run on the UI thread with Reanimated and Skia, long lists are virtualised, and cached data appears instantly on launch, even offline.

  6. 06

    One console for the event

    Registrations, kit pickup points, live results, announcements by push, SMS and email, moderation and a verifiably fair prize draw, in one admin.

03Architecture

How the pieces talk.

Three applications, one backend image. Phones talk to a NestJS API over REST and WebSockets. The same image also runs as a worker, which keeps GPS processing, notifications and scheduled jobs away from the requests runners are waiting on.

  1. 01

    Mobile app

    Expo · React Native · TypeScript

    • Clear layers: screens, hooks, actions and a typed API client, with every response validated
    • Offline cache on device, credentials in the secure keychain
    • Native modules for background GPS, Live Activities and SMS code autofill

    REST and WebSockets

  2. 02

    Admin & public web

    Next.js · TanStack Query, Table and Form

    • A backend-for-frontend keeps admin tokens on the server, never in the browser
    • Public registration portal, live leaderboard and shareable activity pages
    • Universal links that open shared runs and groups straight in the app

    Server-side proxy

  3. 03

    API

    NestJS · 200+ endpoints · role-based access

    • Rate limiting, authentication and permissions applied to every route
    • GPS points validated and written to Redis, never blocking on the database
    • WebSocket rooms fanned out across instances through Redis

    Queues and streams

  4. 04

    Worker

    Same image, worker role

    • Streams GPS data into PostgreSQL in bulk
    • Delivers push, email and SMS campaigns from a queue
    • Runs the event, challenge and streak schedules

    Database, cache and storage

  5. 05

    Data

    PostgreSQL · Redis · Cloudflare R2

    • Relational model covering users, workouts, events, challenges and groups
    • Redis sorted sets for leaderboards and sessions
    • Media uploaded straight from the device to object storage

04Engineering decisions

Decisions worth explaining.

The calls that shaped the build, why I made them, and what they bought the client.

  1. Decision 01

    A custom backend instead of a hosted one

    The client first proposed self-hosted Supabase. Live rankings needed a separate write path for GPS data, Redis, WebSocket broadcast and background workers, so I made the case for NestJS and PostgreSQL, documented the trade-offs and built it.

    Full control over the real-time path, authentication and hosting, with no vendor lock-in.

  2. Decision 02

    Keep the database off the hot path

    Incoming GPS points are validated, written to Redis and streamed to a worker that saves them to PostgreSQL in bulk. The API never waits on the database while people are running.

    Fast responses at peak load, and a database that sees a few large writes instead of thousands of small ones.

  3. Decision 03

    Rank by the course, not just the clock

    Testing showed that a time-only ranking let someone run any 5 km and beat runners who followed the route. I encoded the full rule (finished, checkpoints missed, time, coverage) into a single sortable score.

    Fair results, ranked identically in Redis, PostgreSQL and the app.

  4. Decision 04

    Compute only what someone is watching

    A leaderboard is recalculated only while someone has it open, and everyone watching shares the same snapshot.

    Server cost stays flat as spectators join on race day.

  5. Decision 05

    Separate API and worker roles

    One Docker image runs as either an API or a worker. Requests and WebSockets scale independently from queues, schedules and GPS processing, and only one role runs migrations.

    Race-day traffic does not compete with background work, and deploys are safe to repeat.

  6. Decision 06

    Secure sessions that survive bad signal

    Refresh tokens rotate on every use and a replayed token revokes the session. Runners often lose signal mid-refresh, so the app refreshes early, shares one refresh across parallel requests, and the server allows a short grace window.

    Strong session security without signing anyone out mid-run.

06By the numbers

  • 7 wks

    Figma to app stores01

  • 3 s

    Live leaderboard refresh02

  • 3

    Platforms: iOS, Android, web03

  • 100

    Lighthouse accessibility · web04

07The engagement

My role · Lead engineer · Full stack

The brief and the bar.

The client arrived with a 51-screen design and a fixed date: the Rotary Kampala Cancer Run 2026, over 21, 10 and 5 km. The real work was turning a phone into a timing device people could trust. GPS drops between buildings, Android kills apps in the background, and runners lose signal at the worst moments. The results also had to be fair: someone who cuts the course must never beat someone who ran it. I owned every layer, from the database schema to the App Store release.

  • System architecture
  • Mobile app
  • Real-time backend
  • Admin & web
  • DevOps & releases

Project facts

Client
Krystal Water · Sadja WebSolutions
Role
Lead engineer · Full stack
Team
Solo, from design to release
Duration
7 weeks
Year
2026
Status
Live

Stack

Built with.

Krystal Water's fitness app and the live results system behind the Kampala Cancer Run. iOS and Android app, web admin and a real-time NestJS backend, designed and built end to end.

Mobile
  • Expo
  • React Native
  • expo-router
  • Reanimated
  • Skia
  • TanStack Query
  • Zustand
  • Zod
  • MMKV
Web
  • Next.js
  • React
  • Tailwind
  • TanStack Table & Form
  • Recharts
  • Google Maps
Backend
  • NestJS
  • Prisma
  • PostgreSQL
  • Redis
  • BullMQ
  • Socket.io
Infra
  • Docker
  • Coolify
  • Cloudflare R2
  • EAS Build & Update
  • PostHog

Talk it through

Ask me anything.

Every number on this page has trade-offs behind it. I am happy to walk through the decisions, the mistakes and what I would do differently.

08More work

More from the lineup.

All projects
01

Property platform · Rent management

The Rans home page, Find your perfect property, with a listing for a house in Kajjansi in front

753API endpoints

Rans Solutions

Uganda's property marketplace and rent management platform: listings, applications, leases, rent collection and owner reports. I lead the engineering and wrote most of the NestJS API, the Next.js marketplace, dashboards and admin console.

  • Live
  • 2025 — 2026
  • NestJS
  • PostgreSQL
  • Redis
  • Next.js
  • Typesense
  • Expo

Role Lead engineer · Full stack

Explore Rans
03

Corporate site · Recruitment

The Hariss International home page, What's Up campaign, on a desktop monitor

96Lighthouse performance

Hariss International

A new digital home for the maker of Riham, Oner and Sky View: a fast, editor-run Next.js site on Strapi 5, with a recruitment platform built in for HR.

  • Live
  • 2026
  • Next.js
  • Strapi 5
  • TanStack
  • PostgreSQL
  • Cloudflare R2

Role Lead engineer · Full stack

Explore Hariss
04

Corporate site · Catalogue

The Mukwano home page with the Sunseed hero, tilted over green hills

25Brands, one catalogue

Mukwano Group

The corporate site and product catalogue for Mukwano Group: seven divisions and 25 consumer brands, from Nomi and Roki to Sunseed. Editors run all of it from Strapi, and every change is live in seconds.

  • Live
  • 2025 — 2026
  • Next.js
  • Strapi 5
  • Tailwind
  • Redis
  • Docker

Role Lead frontend engineer

Explore Mukwano
05

Company website · CMS migration

The Sadja home page, Uganda's partner for websites, apps and digital growth, with the French version in front

542Redirects from WordPress

Sadja WebSolutions website

The rebuild of Sadja's own website, from WordPress to Next.js 16 and Payload CMS. Three languages, seven markets, 197 migrated posts and 542 redirects, so every old link still lands somewhere useful.

  • Live
  • 2026
  • Next.js
  • Payload CMS
  • PostgreSQL
  • TypeScript
  • Tailwind CSS
  • Docker

Role Lead engineer · Full stack

Explore Sadja
06

Health platform · Web app

The Génie Santé home page, Votre santé, notre intelligence, with the patient app on a phone in front

7Role dashboards

Génie Santé

Web platform for a digital health startup in the DR Congo: AI symptom checks, doctor consultations and mobile money payments. I led the build: the French marketing site, onboarding and seven role dashboards in one Next.js 16 app, deployed on every merge.

  • Shipped
  • 2026
  • Next.js
  • React
  • TypeScript
  • Tailwind CSS
  • TanStack
  • Docker

Role Lead engineer · Web platform

Explore Génie Santé
07

Admin dashboard · Marketing site

The Telex admin dashboard overview with notification counts, channel metrics and an invite dialog in front

−30%Load time

Telex, now Zedu

Real-time event alerts for engineering teams, built at HNG. I led five frontend engineers on the admin dashboard and worked on the marketing site. Shipped a week early with zero critical bugs.

  • Shipped
  • 2024
  • Next.js
  • React
  • Tailwind CSS

Role Frontend team lead

Explore Telex
08

Developer tool

200+

Active users

STEMSEL online IDE

Browser IDE students use to program STEMSEL IoT chips. Worked on the editor and UI, and trimmed its loading time.

  • Shipped
  • 2023
  • JavaScript
  • IoT
  • Web

Role Frontend engineer

Explore STEMSEL
09

Client work

5+

Projects led

Client platforms at Sadja

Web apps, dashboards and APIs for clients, delivered on schedule. I own timelines, code review and deployment.

  • Ongoing
  • 2025 —
  • Next.js
  • Zustand
  • Node.js
  • Docker

Role Lead software engineer

Explore Sadja
10

This site

RSC

Server first

This portfolio

Next.js App Router with Payload CMS on Postgres. Server-rendered by default, with light, dark and auto themes.

  • Live
  • 2026
  • Next.js
  • Payload
  • Postgres
  • Vercel

Role Design & build

Explore Portfolio

Kampala, Uganda · Remote

Build what's next.

Hiring for a lead or senior engineer, or need a product built? Tell me what you are working on.

Get in touch