Kotlin-phoenix - A set of tools aimed to bridge Phoenix with the Kotlin Multiplatform world

Overview

Kotlin Phoenix

Maven Central Android iOS

This project is aimed to allow developers to work with Phoenix Channels in Kotlin Multiplatform projects, and is composed of several modules:

  • A modern Kotlin Multiplatform Phoenix Channels client, built with coroutines.
  • Adapters designed for specific GraphQL clients (e.g. Apollo Client) allowing them to handle subscriptions via Phoenix Channels

As of now, this project is still experimental and should NOT be used in production. Please feel free to contribute and to share feedbacks and issues.

Modules

Installation

Add the mavenCentral repository

// build.gradle.kts

repositories {
  mavenCentral()
}

Add the kotlinphoenix dependency in commonMain source set.

// shared/build.gradle.kts

sourceSets {
  val commonMain by getting {
    dependencies {
	implementation("io.github.ajacquierbret:kotlinphoenix-$moduleName:1.0.3")
    }
  }
}

Enable coroutines multithreading (required for iOS)

// gradle.properties

kotlin.native.binary.memoryModel=experimental

If some of your dependencies rely on coroutines, please force the dependency resolution to version 1.6.0-native-mt with:

// shared/build.gradle.kts

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt") {
    version {
        strictly("1.6.0-native-mt")
    }
}

OR :

// shared/build.gradle.kts

configurations {
    all {
        resolutionStrategy {
            force("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-native-mt")
            force("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.0-native-mt")
        }
    }
}

Usage

See each module's documentation for example usages.

Roadmap

  • Fork and re-design the JavaPhoenixClient library in order to build a Multiplatform library (at least iOS & Android), using OkHttp for Android and NSUrlSession for iOS
  • Switch all the JavaPhoenixClient library callbacks to a coroutine based approach
  • Publish this brand new library as Kotlin Phoenix Client on Github and Maven
  • Create a PhoenixNetworkTransport adapter for Apollo Kotlin using Kotlin Phoenix Client, which will be available in the same repo, but inside another module.
  • Clean both module's code and add detailed comment blocks
  • Host Dokka generated API reference on Github Pages (API ref. is already generated by Dokka at /dokka, it just needs to go live)
  • Write and host proper documentation
  • Mock a simple Phoenix server & test the Kotlin Phoenix library
  • Encourage the community to contribute to the project

Contributing

I strongly believe that this library will be useful to a lot of Kotlin developers wishing to create engaging Phoenix Channels experiences on many platforms !

Any contribution, issue, feature request, feedback you make is greatly appreciated !

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgments

Huge thanks to these people, they helped a lot in many different ways:

You might also like...
Tools for Kotlin/Kscript to easy write shell command line in kotlin code

Kscript Tools Easy way to run shell command line in kotlin and other tools Usage Used in kscript: @file:DependsOn("com.sealwu:kscript-tools:1.0.2") Us

📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.
📒 NotyKT is a complete 💎Kotlin-stack (Backend + Android) 📱 application built to demonstrate the use of Modern development tools with best practices implementation🦸.

NotyKT 🖊️ NotyKT is the complete Kotlin-stack note taking 🖊️ application 📱 built to demonstrate a use of Kotlin programming language in server-side

 🍲Foodium is a sample food blog Android application 📱 built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, Flow, Dagger 2/Hilt, Architecture Components, MVVM, Room, Retrofit, Moshi, Material Components). A complete Kotlin application built to demonstrate the use of Modern development tools with best practices implementation using multi-module architecture developed using SOLID principles
A complete Kotlin application built to demonstrate the use of Modern development tools with best practices implementation using multi-module architecture developed using SOLID principles

This repository serves as template and demo for building android applications for scale. It is suited for large teams where individuals can work independently on feature wise and layer wise reducing the dependency on each other.

Tools & tips to learn about recomposition in Jetpack Compose

⚡ Recomposition in Jetpack Compose List of practical tips and code snippets to avoid unnecessary recomposition in Jetpack Compose. This is an active r

Set of extensions for Kotlin that provides Discrete math functionalities

DiscreteMathToolkit Set of extensions for Kotlin that provides Discrete Math functionalities as an Kotlin extension functions. To stay current with ne

🔥The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.
🔥The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.

🔥The Android Startup library provides a straightforward, performant way to initialize components at the application startup. Both library developers and app developers can use Android Startup to streamline startup sequences and explicitly set the order of initialization.

This prototype app provides a list of events to be held under an organization (school, college, club, etc.) and the users can manually set event reminders at their scheduled time so that they do not miss an event.

E-CELL NITS Sample App This prototype app provides a list of events to be held under E-Cell NIT Silchar (for example, Srijan 2.0) and the users can ma

Service exposes sensitive administration APIs to initialize and set lower level of Slurpanize infrastructure

slurpanize-baker Project This project uses Quarkus, the Supersonic Subatomic Java Framework. If you want to learn more about Quarkus, please visit its

Owner
Adrien Jacquier Bret
Full-Stack developer. A lot of Typescript, React Native, Elixir, and GraphQL.
Adrien Jacquier Bret
HelloKMM - Hello World in Kotlin Multiplatform Mobile (new empty project)

Hello KMM! Hello World in Kotlin Multiplatform Mobile (new empty project) Gettin

Blake Barrett 1 Feb 2, 2022
A starter project to build command-line tools in Kotlin Multiplatform

A starter project to build command-line tools in Kotlin Multiplatform Contains a re-implementation of a real world CLI tool: git-standup Installation

null 0 May 2, 2022
🎓 Learning Kotlin Coroutines for Android by example. 🚀 Sample implementations for real-world Android use cases. 🛠 Unit tests included!

Kotlin Coroutines - Use Cases on Android ?? Learning Kotlin Coroutines for Android by example. ?? Sample implementations for real-world Android use ca

Lukas Lechner 2.1k Jan 3, 2023
Kotlin hello world for Cloudflare Workers

Kotlin hello world for Cloudflare Workers Your Kotlin code in main.kt, running on Cloudflare Workers In addition to Wrangler you will need to install

ProtoByter 0 Dec 9, 2021
CovidTracker traces all the covid-19 cases all over the world.

CovidTracker Crona Tracker trace india covid-19 cases upto district level and can trace other countries cases too. It can also traces user's current l

Anuraj Jain 6 May 22, 2021
CodeLab for the workshop: A Composable New World

A Composable New World! Compose is here! ?? I've created a codelab where you can follow step by step the development of android application using Comp

Carlos Mota 9 Nov 25, 2022
The RuneTopic game server implementation that hosts and processes a game world.

RuneTopic Game Server The RuneTopic game server implementation that hosts and processes a game world. Setup Guide You can host a game server with Dock

Runetopic 2 Jan 13, 2022
WordGuess - A portuguese game inspired in the world fever wordle game

WordGuess WordGuess is a portuguese game inspired in the world fever wordle game

Anthoni Ipiranga 6 Jul 28, 2022
A Hello World and Template for the KorGe game engine

Korge Hello World and Template This is a Hello World and Template for the KorGe game engine. Using gradle with kotlin-dsl. You can open this project i

Kiet 0 May 1, 2022
An Android application for browsing video games and checking the latest gaming news from around the world.

Gamedge An Android application for browsing video games and checking the latest gaming news from around the world. Built entirely using the Jetpack Co

Paul Rybitskyi 602 Dec 25, 2022