Skip to content
YA
All work
PrototypeAndroid

CodePortميناء الكود

A GitHub repository as a living isometric port city — every gesture runs a real Git command.

Status
Phase 4 of the plan: all six prototype screens running over one world, Day/Night, RTL and TalkBack.
Period
2026
Platforms
Android
Repository
Private — available on request
Live
—
CodePort screens: the isometric port city

01Overview

Commits are crates, pull requests are trucks, CI is the weather. Dangerous commands pass through Customs, where what is shown is exactly what runs, behind a hold-to-confirm. Six screens over one persistent world: splash, repositories, city HUD, PR sheet, customs and a time machine that scrubs history as the city grows.

By the numbers

CPU p95 per frame, stress scene
2.7 ms
CPU p95 per frame, stress scene
ADR 0001 benchmark
fps, normal scene
59.9
fps, normal scene
ADR 0001 benchmark
allocations per frame
0
allocations per frame
JVM test
commits
49
commits
git history
  1. 02The problem

    Git is powerful and abstract; its dangerous operations look exactly like its safe ones. Mobile Git clients either hide the power or expose raw commands with no sense of consequence.

  2. 03The solution

    A deterministic world model and simulation in pure Kotlin, an isometric renderer with a baked sprite atlas, and a customs state machine where the exact command is displayed and only that command runs.

04Screens

05System architecture

  1. L1Features
    • city
    • pullrequest
    • customs
    • repos
    • timemachine
    • splash
  2. L2Engine (pure Kotlin)
    • World model
    • Deterministic simulation
    • Isometric math
    • Depth sorting
    • Director
  3. L3Render
    • Sprite baking → atlas
    • Zero-allocation frame renderer
    • Compose Canvas host
  4. L4Data
    • GitHub REST client
    • ETag polling
    • Rate limits
    • Room cache
    • Tink-encrypted token
  5. L5Safety
    • Customs state machine
    • PortCommand
    • Hold-to-confirm
    • Sandbox-only real merges
Pure-Kotlin engine and data modules are JVM-tested; Android modules only render and host.Diagram — derived from the source code

06Engineering decisions

  1. Compose Canvas over SurfaceView — by measurement

    Two hosts were built around the same renderer and benchmarked on a mid-range phone (Snapdragon 6 Gen 1). Compose Canvas won on every axis: CPU p95 2.5–2.7 ms at ~250 entities against an 8 ms budget, 0.17–0.34% jank, versus 9.3–9.9 ms and 1.2–1.5% for SurfaceView.

  2. Zero allocations per frame

    Static art is baked once into hardware-bitmap atlas pages at start-up; each frame is depth-sorted blits and batched lines. The simulation's zero-allocation guarantee is verified by a JVM test.

  3. Real merges only in a sandbox

    Real merges work in debug builds only, against a sandbox repository with a fine-grained token, and the switch is off at every launch.

My contribution

Concept, ADRs, engine, renderer, data layer and the six screens — 150 Kotlin files across 15 modules.

Technology

  • Kotlin
  • Jetpack Compose
  • Compose Canvas
  • Hilt
  • Room
  • Tink
  • kotlinx.serialization
  • Coroutines
  • GitHub REST API
  • Macrobenchmark
  • MockWebServer
  • Multi-module
  • detekt
  • ktlint

How this was verified

Source, README and ADRs reviewed, including the on-device benchmark tables. Visuals were supplied by Yazan: a screens overview and a capture from a real phone.

Related projects

Next project

Kaff