KaMPKit
tailcall
KaMPKit | tailcall | |
---|---|---|
10 | 16 | |
2,070 | 1,108 | |
0.8% | 5.8% | |
5.1 | 9.9 | |
5 days ago | 4 days ago | |
Kotlin | Rust | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
KaMPKit
-
Is Kotlin Multiplatform the right answer ?
In KaMP Kit we actually use Koin to add the Application instance: https://github.com/touchlab/KaMPKit/blob/main/app/src/main/kotlin/co/touchlab/kampkit/android/MainApp.kt
So yes I would recommend using KMP. If you already use kotlin then it's an easy transition, you just have to learn how all the pieces work together. If you're unsure about it start with a small module and import that into your android sample. You can also view some sample projects to get started like https://github.com/touchlab/KaMPKit and https://github.com/JetBrains/compose-multiplatform-template.
-
Kotlin Multiplatform Is Stable and Production-Ready
I've been using Kotlin Multiplatform Mobile (KMM) heavily for the past 2 years on my current startup. I'm currently in the process of removing the entire thing.
KMM is an alternative to a cross platform mobile library like Flutter, React Native, etc. The idea is that we could write all of our mobile app's business logic, networking layer, and caching layer in Kotlin, and KMM will codgen the matching iOS code. "We only need to write it once!" is the selling point. Then we get a blank canvas to build our UI using 100% native SwiftUI & Jetpack.
In reality, the codegened iOS code gets you 90% of the way there, the but extra 10% is extremely frustrating to work with. Enums (Sealed Classes in Kotlin) get mangled in translation and you lose exhaustive switch statements. Basic data types like Bool and Int get wrapped so you can only access them using additional .boolValue or Int64(..) constructors. Entire companies are being built around solving the pain point of this last 10%: https://touchlab.co
In my opinion, the fatal mistake the KMM team made was designing it to support Objective-C, instead of just Swift. So you're using a Kotlin layer -> mangled through Objective-C -> accessed from Swift. It's a confusing decision, as the only iOS teams still actively using Objective-C are legacy apps (like the Twitter app), which seems like the opposite target market for new mobile tech like KMM. Kotlin and Swift are both modern languages, and my gut says the interop between the two would be much better without Objective-C in the middle.
Further discussion from Droidcon if you're interested: https://www.droidcon.com/2022/08/01/sdk-design-and-publishin...
> As you progress beyond "POC" to integrating and shipping real production code, the design of the "SDK surface" becomes more complicated and nuanced (or, possibly, problematic)... An Android consumer can see all the richness of the Kotlin language, but the iOS side gets filtered through Objctive-C into Swift. Much can get lost along the way.
- interesting git repos
-
Add Kotlin/JS support to your KMM library
You may check out this commit where I made these changes for the KaMPKit project
-
Getting Started With Kotlin Multiplatform Mobile
KaMPKit This one is really good, and is kinda a best practice starting point. Touchlab is a very active contributor to the KMM community and it's definitely worth keeping an eye on their blog linked above.
-
Kotlin Multiplatform Careers
Lovingly gathered by Touchlab. Subscribe to the weekly digest here: http://digest.kotlinmultiplatform.careers
-
KoMPose Kit: KaMP Kit goes Jetpack Compose
Hey folks, Brady from Touchlab here. I've only been at Touchlab since the beginning of the year, but KaMP Kit, our simple-but-not-too-simple sample project to help those considering Kotlin Multiplatform, started way back at the end of 2019. Back then, Jetpack Compose had just been announced in May. It was a time full of optimism about the modern mobile UI development experience, but also of wild instability. The first method of getting Jetpack Compose to work on your machine involved pulling down the AndroidX development toolchain, and running a special version of Android Studio via terminal commands. Eventually, preview, alpha, and beta version of Compose could be used in the canary version of Android Studio (more history). Starting July 28, 2021, Compose went stable, and a version of Android Studio Arctic Fox, which supports Compose, was released in the stable channel shortly thereafter. Now we can use a stable version of Compose with a stable version of Android Studio. We at Touchlab have been excited about Compose for a long time; you can watch us geek out about it here. And though the community has been interested in Compose for KaMP Kit since at least May 2020, we didn't want folks who are trying out Kotlin Multiplatform with KaMP Kit to also have to learn a changing Jetpack Compose API, and require them to use a special version of Android Studio. Now that these obstacles have been removed, we feel comfortable fully endorsing Jetpack Compose in KMM.
-
Google and Facebook Login on Android with Coroutines
I recently started using Google One Tap and Facebook login for some auth work for one of our clients at Touchlab, and wanted to make sure I was using the recommended best practices using coroutines and the new Activity Result API. This was trickier than I realized, because the docs for Google One Tap are out of date, and the API for Facebook login is out of date. So after figuring it out, I wanted to share some code snippets for my future self, and I hope you get something useful from it as well.
-
Encrypted Key-Value Store in Kotlin Multiplatform
Multiplatform Settings is a solid multiplatform key-value store, created by Touchlab's own Russell Wolf, used extensively at Touchlab, as well as in Jetbrains' KMM Production Sample. There is a Settings interface that is implemented for Android, iOS, MacOS, and JVM platforms. At first glance, it doesn't look like Multiplatform Settings offers any encrypted storage. But thanks to the abstraction that Android has built into SharedPreferences and Multiplatform Settings' support for saving to the iOS keychain, our work is pretty easy.
tailcall
- Developer Relations Engineer [Tailcall]
-
Ask HN: Is There a Zapier for APIs?
Actually, you might want to check out https://tailcall.run (Disclaimer: I am the core maintainer of the project)
It's an open-source API Orchestrator, in other words "a Zapier for APIs". If you find it interesting, hit our discord channel to learn more about it.
-
The Ur Programming Language Family
Tailcall is building something similar in that regard. The idea is to allow developers to specify their orchestration requirements using a DSL and then behind the scenes generate an ultra high performance backend for GraphQL. The query could span over REST, GRPC and other GraphQL services. Check it out — https://github.com/tailcallhq/tailcall
-
Ask HN: Would anyone recommend GraphQL over REST for teams just starting up?
GraphQL will save you from embarrassing errors on the client and improve performance for sure. My recommendation is — Build API and expose them using REST or GRPC. Use a solution like https://tailcall.run/ to create a GraphQL facade on top of it for your clients to consume.
-
Ask HN: Those making $500/month on side projects in 2024 – Show and tell
layer by hand? Have you tried https://github.com/tailcallhq/tailcall
With tailcall, you can quickly bootstrap a GraphQL service on top of existing APIs. I would love to collaborate on this and help you on board.
-
Ask HN: GraphQL in 2024
Hi, I am the founder of https://tailcall.run. I have personally built and used GraphQL at a massive scale (100M rpm, 1K APIs, 100s services). I believe have a fair understanding of the problem it solves, as well as its pitfalls. We built Tailcall because we realized that manually writing a GraphQL service is inefficient and doesn't scale well. Our main learning was that APIs should be built and operated independently, regardless of how they are consumed.
GraphQL should also be considered as a client-side abstraction and architecturally positioned closer to the client than to the server. In this context, the client could be a mobile app, a website, or even another service querying data from an external or internal data source. As a client-side abstraction, the responsibility of maintenance should lie with the consumer of the APIs, not the producer. All these learnings have helped us architect Tailcall as it is today. Tailcall provides a DSL that allows consumers of the API to configure how they would want the schema to look. Behind the scenes, Tailcall automatically orchestrates the APIs to generate a unified graphQL endpoint. Once configured it can be deployed on a typical server, but semantically still being a piece of the client/API Consumer.
This way of looking at graphQL considers federation as an anti-pattern. GraphQL Federation pushes graphQL towards the server side or more specifically the API producer. This new layer of abstraction also adds significant levels of slowness & complexity in architecture. We started with the problem of clients consuming APIs and the need to compose them, but ended up using a solution that's composing "Graphs". That's not necessarily wrong, but it feels like an overkill for the core problem the organization starts with which is — API Composition.
However, we understand that this might not be relatable for smaller organizations and various others who have been working with GraphQL for a long or probably have a different take on it. I would love to hear your thoughts!
Some of the questions we had were —
Do you prefer to handwrite a graphQL API or, use an open-source solution that could auto-generate a GraphQL endpoint on top of your existing API?
What are your thoughts on GraphQL in general — like, hate, neutral? Does it solve a big problem in your company? Have you tried TRPC as an alternative?
Do you think federation is the future? Based on what you learned, do you think Tailcall is a good design?
- Join Tailcall Mini Hackathon: Win $2000 and a Job Opportunity
-
Ask HN: What apps have you created for your own use?
Have you considered using https://tailcall.run
- Kotlin Multiplatform Is Stable and Production-Ready
- TailCall: High-performance API Gateway for GraphQL back ends
What are some alternatives?
kmm-production-sample - This is an open-source, mobile, cross-platform application built with Kotlin Multiplatform Mobile. It's a simple RSS reader, and you can download it from the App Store and Google Play. It's been designed to demonstrate how KMM can be used in real production projects.
wundergraph - WunderGraph is a Backend for Frontend Framework to optimize frontend, fullstack and backend developer workflows through API Composition.
ReKotlin - Unidirectional Data Flow in Kotlin - Port of https://github.com/ReSwift/ReSwift to Kotlin
graphql-benchmarks - Setup to compare graphql frameworks
multiplatform-settings - A Kotlin Multiplatform library for saving simple key-value data
toolkit - A Scala 3, lightweight and functional non-intrusive library to build typed and declarative Scala application with managed resources and dependencies
realm-kotlin - Kotlin Multiplatform and Android SDK for the Realm Mobile Database: Build Better Apps Faster.
caliban - Functional GraphQL library for Scala
facebook-android-sdk - Used to integrate Android apps with Facebook Platform.
Finatra - Fast, testable, Scala services built on TwitterServer and Finagle
PeopleInSpace - Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, Compose for Web and Kotlin/JS + React clients along with Ktor backend.
service-chassis - A scala chassis to get your applications and services bootstrapped quickly