Kinsight Multiplatform Save

Kotlin Multiplatform Concept - iOS, MacOS, WatchOS (SwiftUI), Android (phone and Wear OS), JVM Web Server - Alpha Capture

Project README

official JetBrains project GitHub license

Kotlin Multiplatform project: Sharing code between iOS, MacOS, WatchOS, Android (phone and watch - Wear OS), and JVM Web Server (Ktor)

KInsight Alpha Capture is a proof of concept project currently being developed for our annual CodeWeek event (where you pitch business or technology ideas). Alpha Capture app is intended for Sales to create and distribute trade ideas to our institutional clients. The app will track the performance of each idea relative to the performance of the benchmark, and alert users when the idea has reached the price objective or stop loss value so that the user can then close the idea. This is proof of concept only, and as such will have the following limitations: 1) there will be only limited live market data availability (when creating an idea, current stock price - for this we use https://iexcloud.io/docs/api/ - if you clone this project, make sure to get your own api key - it's free!); b) there will be no permanent storage for newly created ideas, they will be stored in memory on the server until the next server reload. However, there will be a number of “prefabricated” ideas along with their historical (mocked) performance. As we cannot control the market (alas), some market data manipulation is in order. The server will provide an API to update prices for ideas so that an alert can be triggered. These price updates will flow into the app via websockets, updating UI in real time and triggering notification alerts when price objective or stop loss thresholds are met.

Demo

Part 1
Part 2
Part 3

Overview

overview

IPhone Android
Wear OS Watch OS

https://github.com/dmitrish/kinsight-multiplatform/blob/master/wearos-alpha.mp4

Screenshots:

screens

ideas side by side

Ideas list - Android

ideas list android

Ideas (new design)

android and iphone detail

Idea Graph:

idea graph

Idea Alert (Android):

idea alert

MacOS - Ideas

idea list macos

Steps to build different server flavors and run them locally

Switching server between thee possible builds: google app angine, netty, and netty with fatjar - settings.gradle: Switching server between google app engine and netty builds

If you want to run the google appengine locally, remember to change the engine path to your path!

appengine path

To run appengine locally, execute this gradle task

appengine run task

Note - if you want websockets enabled, you need to run one of the netty builds (regular netty or fatjar netty). Change settings.gradle as described above and execute this gradle task for the regular netty build:

netty run task

To run the fatjar build, first build with this build task: fatjar build task

Then navigate to the libs folder in the terminal and execute: libs % java -jar server-all.jar

Kotlin Native iOS project: Steps to run iOS project

Note: XCode 11 is required

  1. Compile the shared code module in Android Studio (see snapshot below).
  2. Move to Kotlin ios Folder
  3. Do a 'pod install'
  4. Open .xcworkspace file

Steps to run Android app

  1. Compile the shared code module in Android Studio (see snapshot below)
  2. In Android's build.gradle, in Android -> DefaultConfig -> change this build config field to be: buildConfigField("String", "url", '"https://10.0.2.2:8081"')

Build shared code first - before running android, ios or server!

build shared module

Steps to deploy Server

GOOGLE APP ENGINE and DOCKER - COMMANDS

Prerequisite install Google Cloud SDK and Docker(optional)

Create Google Project:

  1. gcloud init
  2. gcloud projects create kinsight-multiplatform
  3. gcloud app create
  4. gcloud config set project kinsight-multiplatform
  5. gcloud auth configure-docker

Create Docker Image and Run:

  1. Navigate to \server folder
  2. docker build -t server-all .
  3. docker run -m512M --cpus 1 --expose 8081 -p 8081:8081 -it server-all

Other Docker Commands: docker images docker ps docker stop instance_id docker rmi image_name

Uploading Docker Image to Google Cloud Registry:

  1. Add Tag to Image (V3 is the tag here) docker tag server-all gcr.io/project-kinsight/server-all-image:V3
  2. Push Image to cloud registry docker push gcr.io/project-kinsight/server-all-image:V3

Next follow below to deploy Docker image into Google Kubernetes Engine: https://cloud.google.com/kubernetes-engine/docs/quickstart

Open Source Agenda is not affiliated with "Kinsight Multiplatform" Project. README Source: dmitrish/kinsight-multiplatform

Open Source Agenda Badge

Open Source Agenda Rating