Overhaul kite as a pure Kotlin Multiplatform library for the Mite REST API#1
Draft
Copilot wants to merge 2 commits into
Draft
Overhaul kite as a pure Kotlin Multiplatform library for the Mite REST API#1Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
…rapping Mite REST API Co-authored-by: Bombo <224092+Bombo@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Overhaul kite repository as pure Kotlin Multiplatform library
Overhaul kite as a pure Kotlin Multiplatform library for the Mite REST API
Feb 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the dated Android-centric
shared/scaffold with a clean, flat KMP library module targeting JVM, iOS, macOS, JS (IR), and wasmJs. Wraps the full Mite REST API with idiomatic Kotlin suspend functions, a DSL for filtering/building resources, andkotlinx-serializationfor JSON.Build & versioning
gradle/libs.versions.toml: Kotlin 2.3.10, Ktor 3.4.0, kotlinx-serialization 1.7.0, kotlinx-datetime 0.6.0, kotlinx-coroutines 1.9.0, Gradle 9.3build.gradle.ktsstripped to plugins-only; no Android artifacts anywhereLibrary module (
kite/)MiteConfig—data class(accountName, apiKey)MiteClient— injectableHttpClientconstructor + top-level factory that wiresContentNegotiation,defaultRequest(HTTPS host,X-MiteApiKey,Accept,User-Agent: kite/1.0)timeEntries,projects,customers,services,usersas properties; all operations aresuspendfunctions@Serializabledata classes with@SerialNamesnake_case mapping;LocalDate/Instantfor temporal fields; internal wrapper types handle Mite's{"time_entry": {...}}envelopeTimeEntryFilter(query params) andTimeEntryBody(create/update payload) as builder lambdasQuick start
Tests
MiteClientTestuses KtorMockEngineto assert correct deserialization, query-parameter encoding, and POST body shape.TimeEntryFilterTestcovers DSL field assignment andGroupByenum values.Original prompt
Overview
Completely overhaul and re-scaffold the
kiterepository as a pure Kotlin Multiplatform library that wraps the Mite REST API. The existing scaffold is very old and should be replaced with a clean, modern KMP setup following 2025/2026 best practices.Goals
kotlinx-serializationfor JSONkotlinx-datetimefor date/time typesHttpClientimplementationTech Stack & Versions
Use a Gradle Version Catalog (
gradle/libs.versions.toml) with these versions:2.3.103.4.01.7.00.6.01.9.09.3Use Kotlin DSL (
build.gradle.kts) throughout. Use the Gradle Version Catalog for all dependency declarations.Project Structure
Replace the existing
shared/module structure with a clean, flat KMP library module. The final layout should be:Remove the old
shared/module entirely.KMP Targets
Support the following targets in
kite/build.gradle.kts:jvm()iosX64(),iosArm64(),iosSimulatorArm64()macosX64(),macosArm64()js(IR) { browser(); nodejs() }wasmJs { browser(); nodejs() }No Android target — this is a pure library, not an Android library.
MiteConfig
MiteClient
The
MiteClientshould:HttpClientparameter (Ktor) — this is the primary constructorMiteClient(config: MiteConfig): MiteClientthat creates a sensible default KtorHttpClientwith:ContentNegotiationwithjson()(kotlinx-serialization)defaultRequestblock setting the base URLhttps://{accountName}.mite.de/, theX-MiteApiKeyheader, andAccept: application/jsonUserAgentplugin or header set tokite/1.0API Interfaces
Implement each API group. All functions should be
suspendfunctions returning the appropriate model type.TimeEntriesApi
ProjectsApi
CustomersApi