All Projects → czyzby → kotlin-multiplatform-example

czyzby / kotlin-multiplatform-example

Licence: CC0-1.0 license
A barebones Kotlin multiplatform project with JVM and JS targets

Programming Languages

javascript
184084 projects - #8 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to kotlin-multiplatform-example

Keemun
No description or website provided.
Stars: ✭ 13 (-13.33%)
Mutual labels:  multiplatform, kotlin-multiplatform
ToDometer Multiplatform
WIP Kotlin Multiplatform project: A meter to-do list built with Android Jetpack, Compose UI Multiplatform, Wear Compose, SQLDelight, Koin Multiplatform, SwiftUI, Ktor Server / Client, Exposed...
Stars: ✭ 145 (+866.67%)
Mutual labels:  multiplatform, kotlin-multiplatform
tmdb-api
This Kotlin Multiplatform library is for accessing the TMDB API to get movie and TV show content. Using for Android, iOS, and JS projects.
Stars: ✭ 31 (+106.67%)
Mutual labels:  multiplatform, kotlin-multiplatform
Aboutlibraries
AboutLibraries automatically detects all dependencies of a project and collects their information including the license. Optionally visualising it via the provided ui components.
Stars: ✭ 2,777 (+18413.33%)
Mutual labels:  multiplatform, kotlin-multiplatform
Apollo Android
🤖  A strongly-typed, caching GraphQL client for the JVM, Android, and Kotlin multiplatform.
Stars: ✭ 2,949 (+19560%)
Mutual labels:  multiplatform, kotlin-multiplatform
kgql
GraphQL Document wrapper generator for Kotlin Multiplatform Project and Android
Stars: ✭ 54 (+260%)
Mutual labels:  multiplatform, kotlin-multiplatform
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.
Stars: ✭ 1,476 (+9740%)
Mutual labels:  multiplatform, kotlin-multiplatform
PopKorn
DI can be simple. Forget about modules and components. Just use it!
Stars: ✭ 139 (+826.67%)
Mutual labels:  multiplatform, kotlin-multiplatform
kmm
Rick & Morty Kotlin Multiplatform Mobile: Ktor, Sqldelight, Koin, Flow, MVI, SwiftUI, Compose
Stars: ✭ 52 (+246.67%)
Mutual labels:  kotlin-multiplatform
UnityVolumeRendering
A simple example of Volume Rendering for Unity.
Stars: ✭ 139 (+826.67%)
Mutual labels:  example
combatris
A "perfect" implementation of an old classic
Stars: ✭ 20 (+33.33%)
Mutual labels:  multiplatform
awesome-flutter-ui
10+ flutter(android, ios) UI design examples ⚡ - login, books, profile, food order, movie streaming, walkthrough, widgets
Stars: ✭ 848 (+5553.33%)
Mutual labels:  example
instagram-oauth-nodejs-server
Node.js server for Intagram-API OAuth purpose.
Stars: ✭ 12 (-20%)
Mutual labels:  example
sdl-imgui-example
An example of using Dear ImGui with SDL
Stars: ✭ 18 (+20%)
Mutual labels:  example
tca-swiftui-navigation-demo
Demo project that shows how to implement navigation in SwiftUI iOS application using Swift Composable Architecture
Stars: ✭ 75 (+400%)
Mutual labels:  example
play-scala-seed.g8
Play Scala Seed Template: run "sbt new playframework/play-scala-seed.g8"
Stars: ✭ 66 (+340%)
Mutual labels:  example
example-typescript-package
Example TypeScript Package ready to be published on npm & Tutorial / Instruction / Workflow for 2021
Stars: ✭ 71 (+373.33%)
Mutual labels:  example
go-echo-boilerplate
The fastest way to build a restful API with golang and echo framework. Includes common required features for modern web applications. A boilerplate project with golang and Echo.
Stars: ✭ 53 (+253.33%)
Mutual labels:  example
react-native-css-modules-with-typescript-example
A simple example app that shows how you can use CSS modules + Typescript with React Native and React (for browser)
Stars: ✭ 17 (+13.33%)
Mutual labels:  example
python-code-disasters
This code is so bad, that it is worth sharing.
Stars: ✭ 134 (+793.33%)
Mutual labels:  example

Kotlin Build Status

Kotlin multiplatform project example

This repository contains a barebones Kotlin multiplatform Gradle project with 3 modules: common (compiled to both JVM bytecode and JS), client (compiled to JS) and server (complied to JVM). Assumes a simple architecture, where the server module is a backend JVM application, client is the usual frontend web application, and the common module allows to share data structures, validation logic, and so on. It also comes with a working tests setup on both target platforms.

Feel free to use it for personal and commercial projects.

Note that I don't feel comfortable with frontend tools and the client module might have some issues. If you notice any problems or invalid configurations, please create a GitHub issue.

What to do after cloning

  • Change group and version in root build.gradle.
  • Update Gradle wrapper version in gradle-wrapper.properties.
  • Update dependencies' versions in gradle.properties and package.json.
  • Rename packages (preferably with IntelliJ Refactor > Rename), replace com.github.czyzby throughout the project.
  • Include your project dependencies in subprojects build.gradle files.
  • Write actual code. Or not.

Useful Gradle tasks

  • server:test: runs server tests and common tests compiled with server actual implementations via JUnit runner.
  • client:test: runs client tests and common tests compiled with client actual implementations via Karma/Mocha.
  • test, check: runs tests (or tests with all checks) in every subproject.
  • server:run: runs main function of the server project.
  • client:run: runs Webpack in watch mode at localhost:8080 which automatically reloads when you recompile KotlinJS sources or add copy new static resouces. (Press F12 and read the console to see if example code works.)
  • client:watch -t: recompiles client sources and copies resources on every src/main file modification. Make sure to use -t flag to run in continuous mode. Along with client:run, these two tasks provide hot reload after every file change.
  • assemble: builds a standalone runnable jar at server/build/libs and bundles JS sources to client/build/dist.
  • client:bundle: invokes Webpack (with deployment configuration) to pack and minifies JS sources and exports them to client/build/dist. Invoked by assemble.
  • client:copyStaticResources: copies files from client/src/main/resources to client/build/dist. Copied files will be served by the dev server (client:run). Automatically invoked by bundle and client:run.

Typical workflow

During development, run ./gradlew client:run and ./gradlew -t client:watch to deploy the client application locally on localhost:8080 with hot reload on each file change. Use your server framework of choice to run the server application. If anything unexpected happens, run ./gradlew clean and repeat.

Caveat: Ctrl+C will not kill Webpack (client:run). This is a known issue. You can avoid it by turning off Gradle deamons or installing Yarn locally and using yarn run start instead of the Gradle task.

To deploy, run ./gradlew assemble. server/build/libs will contain a standalone runnable jar, and client/build/dist will contain your resources, Webpack-generated HTML file and bundled JS files.

Extras

See this commit in kotlinx-serialization branch branch for kotlinx-serialization integration example.

Client project contains examples of asynchronous tests.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].