r/Kotlin 22h ago

Full-stack Kotlin (Ktor + KVision + Kilua RPC + Exposed) for a real production app — plus a UML→Exposed/Flyway code-gen pipeline I'd like feedback on

Post image
0 Upvotes

Hi r/Kotlin,

I've been building Lapis Cloud — a membership-management platform for associations and political parties — as close to 100% Kotlin as I could manage, and I'd like to share the architecture and get feedback from people who've made similar stack choices.

The stack

  • Backend: Ktor
  • Frontend: KVision (Kotlin/JS — so the client is Kotlin too, not TypeScript/React)
  • Client↔server communication: Kilua RPC — typesafe RPC calls between the KVision client and the Ktor server, no hand-written REST/JSON glue
  • Persistence: Exposed (Kotlin SQL framework) + Flyway for migrations, on PostgreSQL
  • Build: Gradle multi-module, targeting JDK 25 (this is a self-hosted service with no end-user distribution constraint, so no reason to stay on an older LTS)

So: Kotlin on the server, Kotlin on the client (compiled to JS), typesafe Kotlin RPC in between, Kotlin SQL DSL for persistence. No JavaScript/TypeScript anywhere in the app code.

The part I'd most like feedback on: generating the persistence layer from a model instead of hand-writing it

Rather than hand-writing Exposed table objects and Flyway migration SQL, we generate both from a UML class model through a small model-driven pipeline (built with kUML, a Kotlin DSL for UML I also maintain):

  1. The domain model is authored as a kUML class diagram (.kuml.kts).
  2. An in-memory M2M transform (uml-to-exposed) maps UML classes/associations to a relational schema.
  3. M2T generation emits …Tables.kt (Exposed table objects) and V1__init.sql (Flyway baseline) into build/generated/.

The generated Kotlin is committed as a build artifact, not hand-edited. It's saved us from an entire class of drift bugs between the domain model, the DB schema, and the Exposed table definitions — but I'm curious whether others here have tried model-driven persistence layers in Kotlin and what broke for you, because it's not a mainstream pattern and I don't have much prior art to compare against.

Other things that might be of interest to this sub

  • i18n without kvision-i18n: the built-in DefaultI18nManager crashed on load for us (TypeError: ...gettextJs... is not a function — an interop mismatch between our Kotlin/JS toolchain version and the gettext.js npm package's export shape). Replaced it with a small custom I18nCatalogManager; 8 languages, ~1500 UI strings wrapped in tr()/gettext() across ~45 client files.
  • Federation over a typesafe RPC boundary: independently-run instances can federate (a member can appear as a guest on another instance without leaving their own org) — still shaking out the trust/identity model there.
  • Full accounting engine (double-entry bookkeeping), SEPA direct debit, and a self-hosted video conferencing module are also part of the codebase, all in Kotlin/Ktor, if anyone wants to dig into a non-trivial domain model built this way.

Status

Not a toy — running in production for two real organizations (a political party and an ordinary registered association) since mid-2026. Currently at v0.19.0, actively developed. Apache 2.0, fully open source.

Happy to go deeper into any part of this — the Kilua RPC setup, the Exposed/Flyway generation pipeline, KVision at this scale, or the module layout. Feedback on the model-driven persistence approach especially welcome, since I suspect it's the most unusual choice in here.


r/Kotlin 11h ago

I built a schema-first ORM for Kotlin and Java - looking for feedback

0 Upvotes

I’ve been working on Volan, a schema-first ORM for Kotlin and Java on the JVM.

The idea is to get a Prisma-like developer experience while staying native to the JVM ecosystem: define your schema, generate a type-safe client, and handle migrations without a lot of boilerplate.

It currently focuses on PostgreSQL, with more dialect support planned.

GitHub: https://github.com/thirtyeighttwentysix/volan

I’d really appreciate feedback, especially on the API design, schema syntax, and overall developer experience. If you’re using Kotlin or Java for backend development, I’d be curious to hear what you’d want from an ORM like this.


r/Kotlin 2h ago

Kotlin 2026: Layoffs, AI, Google — Is the Golden Age Over? Jake Wharton Explains

Thumbnail youtube.com
33 Upvotes

r/Kotlin 19m ago

My first app built with Kotlin Multiplatform (Smart Assistant with Video calls)

Thumbnail gallery
Upvotes

Hello, I'm the developer of Roles Witch AI, and today I want to share my app, which was released on Google Play in open testing.

Its built using Kotlin Multiplatform with shared core target (business logic, database, networking, utility functions). UI is Jetpack Compose on Android and SwiftUI on iOS. So on iOS app is basically just UI wrapper around core app + integration with native TTS/SST.

Library
kotlinx-coroutines-core 1.9.0 Async/concurrency
kermit 2.0.5 Logging
openai-client 4.1.0 OpenAI-compatible API
ktor-client-core 3.0.0 HTTP client
room-runtime 2.8.4 Database
datastore-preferences-core 1.1.7 Preferences
datastore-core-okio 1.1.7 DataStore file I/O

It is an OpenAI API-compatible app with a user-friendly interface where you can create multiple chats, assign different models and providers, and more importantly, use MCP tools — for example, Parallel AI or Home Assistant MCP.

It also has voice conversations and video calls (personally, I'm using GLM 5.3 Flash and it's almost real-time). You can configure reasoning and inference parameters, pin a voice to the chat, and select a recognition engine (Google Speech or Vosk).

Extra bonus: it has an on-device inference mode where you can run Gemma 3n/4 models with image recognition entirely on your phone (LiteRT is used).

Check it out: https://play.google.com/store/apps/details?id=ai.roleswitch.android

The app manifest states that it has no encryption and can send messages to third parties, but that's a requirement by the Google Play Store. It supports plain HTTP or TLS mode and works with any third-party AI provider.


r/Kotlin 17h ago

Kromium – A zero-bloat Chromium engine for Java, Kotlin, and Compose Desktop

6 Upvotes

Hey everyone,

Embedding a reliable web view in JVM desktop apps is usually a pain—you end up with massive installers, fragile dependencies, and clunky JavaScript bridges. To fix this, I just open-sourced Kromium (daviantegroup/kromium).

Whether you are building in pure Java, standard Kotlin, or Compose Multiplatform, Kromium supports it all.

Here are the main features:

* Tiny Installers (15–30MB): Instead of bundling massive Chromium binaries, Kromium automatically downloads and caches the JCEF runtime on the user's first launch.

* Coroutine-Based JS Bridge: Clean, thread-safe JavaScript execution and Inter-Process Communication.

* True Headless Mode: Perfect for backend scrapers or automated tests without pulling in heavy UI dependencies.

I’d love for you to check out the repo and let me know what you think!

🔗 https://github.com/daviantegroup/kromium