• Stars
    star
    443
  • Rank 98,504 (Top 2 %)
  • Language
    CSS
  • License
    Apache License 2.0
  • Created about 7 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Multiplatform Kotlin application of KotlinAcademy

KotAcademy application

Build Status codebeat badge Analytics Analytics

This is an example how multiplatform development can be used to effectively extract and reuse logic. It contains multiple clients that implement the same logic and single backend. The only common part for all this project is Data Model, so it is placed in common module which is shared among all the platforms. All client applications are based on MVP (Model-View-Presenter). Presenters are common for all of them and they are placed in common-client module. It contains all business logic and is well tested. Views are implemented separately for every platform. Presenters are using Data Model, and communicating with Views from behind the interfaces that are placed in common-client module. On the other side Presenters are communicating with repositories (network API, databases etc.) which are hidden behind an interfaces (for unit-testing purposes) and specified as an expected declarations which have actial declaration in platform modules (common-client-jvm and common-client-js).

Application is composing Kotlin Kotlin Academy and presenting them together. It also allows giving the feedback this article or to Kotlin Academy.

Here is the status of planned clients:

  • Android mobile - DONE (Play)
  • Web - DONE (Demo)
  • Desktop - DONE in TornadoFX
  • Android Wear - DONE
  • iOS - DONE in Swift and Kotlin/Native
  • Firefox plugin - Not yet started
  • Chrome plugin - Not yet started

We will really appreciate help in any of this areas.

Backend

To run desktop application, just excecute in the root folder of the project:

./gradlew :backend:run

Android

Android client is used to display list of article. It uses common-client logic to display loading, refreshing and obtaining list of elements. Here are some screens:

If you open project in Android Studio, it will find both Android mobile and Android watch projects. This way you can easily run the projects.

Backend URL depend on build type. Application run in debug mode will use localhost as base URL so it will not work unless you run backend first. Applicatin run in release mode is production backend as a API base URL.

If you don't have Android SDK and you don't want to work on Android module then you can change gradle.properties property INCLUDE_ANDROID to false. Alternatively you can add -Dorg.gradle.project.INCLUDE_ANDROID=false to your gradle build task.

Web

Web client with the same logic like Android app. It is implemented in React.

Demo is here on Heroku.

To run web, you should use following command:

./gradlew :web:run

Desktop

Desktop TornadoFX client. Designed by Edvin Syse, creator of TornadoFX. Still during designing process.

To run desktop application, just excecute in the root folder of the project:

./gradlew :desktop:run

Warning: It is not working with OpenJDK because it doesn't include JavaFX by default. You need to use Oracle JDK.

Tests

Business logic, especially while it is shared among all the platforms, is unit-tested. Tests can be found on common-client module.

Run them using following commands:

./gradlew :common-client-jvm:test
./gradlew :common-client-js:test

Heroku

To push on Heroku, you need to specify following GRADLE_TASK:

heroku config:set GRADLE_TASK="-Dorg.gradle.project.INCLUDE_ANDROID=false serverPrepare"

Contribution

A lot needs to be done in this project. The mission is to to build solid massive-multiplatform project. See board to check out how you can help us. If you want to chellange yourself and face one of this tasks then join project, assing it to yourself, move to "In progress" and start doing. Don't bother to ask if you are not sude about something. We are here to learn and help learn.

Images sharing

All images are located in commonImages folder. If you want to add image to some platforms, place imege there and add this image to platform include in imagesShare.gradle file. Then use:

./gradlew shareImages

To clean all the previous images (needed when you are deleting some images) use following task:

./gradlew cleanImages

Credits

Special credits to below repositiries which inspired some solutions:

https://github.com/Albert-Gao/kotlin-native-mobile-multiplatform-example/tree/master/platforms/ios

https://bitbucket.org/ivan_vazhnov/mobius_multiplatform/src/9ec77bf4d274?at=master

License

Copyright 2017 Marcin Moskaล‚a

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

ArcSeekBar

Good looking curved Android SeekBar
Kotlin
514
star
2

ActivityStarter

Simple Android Library, that provides easy way to start the Activities with arguments.
Kotlin
428
star
3

KotlinDiscreteMathToolkit

Set of extensions for Kotlin that provides Discrete math functionalities
Kotlin
183
star
4

PreferenceHolder

SharedPreference usage made fun in Kotlin
Kotlin
155
star
5

KotlinAndroidViewBindings

Bindings for properties with simple Kotlin types (Boolean, String) to layout traits (visibility, text).
Kotlin
126
star
6

kotlin-coroutines-recipes

Kotlin
113
star
7

VideoPlayView

Custom Android view with video player, loader and placeholder image
Kotlin
94
star
8

coroutines_sources

Kotlin
80
star
9

KotlinPreferences

Android Library to make SharedPreferences usage easier.
Kotlin
50
star
10

MarvelGallery

Example of Kotlin Android application
Kotlin
47
star
11

KotlinMultiplatformExample

Kotlin
45
star
12

kotlin-coroutines-workshop

Kotlin
38
star
13

MVTest

Code created as an examples for presentation about MVC vs MVP vs MVVM.
Kotlin
34
star
14

kotlin-exercises

Kotlin
29
star
15

kotlin_essentials_sources

Kotlin
20
star
16

SimpleKotlinMvpBoilerplate

Presentation of simple Kotlin Android MVP
Kotlin
19
star
17

effective-kotlin-book

Some open-sourced chapters of the Effective Kotlin
16
star
18

effective-kotlin-tests

JavaScript
13
star
19

functional_kotlin_sources

Kotlin
10
star
20

advanced-kotlin-workshop-tasks

Kotlin
10
star
21

caffeine-suspending

Kotlin
9
star
22

effective-kotlin-workshop

Kotlin
7
star
23

kotlin-android-workshop

Project with exercises for Kotlin Android workshop
Kotlin
7
star
24

measured-wrapper-ksp

Kotlin
6
star
25

WorkoutMPP

Kotlin
6
star
26

testing-viewmodel

Kotlin
6
star
27

Website

CSS
6
star
28

coroutines-benchmarks

Kotlin
6
star
29

AnkiMarkdown

Kotlin
5
star
30

coroutines-short-workshop-tasks

Kotlin
5
star
31

advanced_kotlin_sources

Kotlin
5
star
32

advent-2021

Kotlin
4
star
33

pacmanFunctional

Kotlin
3
star
34

generate-builder

Kotlin
3
star
35

pong

HTML
3
star
36

FindMyPhone

Kotlin
3
star
37

UserManagementApp

An example project using Jetpack Compose, Kotlin Coroutines, MVVM, proper unit testing
Kotlin
3
star
38

Minions

This is sink of different ideas for Kotlin usage to improve Android Development
Kotlin
3
star
39

StackTester

Simple App for testing different Activity Stack flags
Kotlin
3
star
40

effectivekotlin_sources

Kotlin
2
star
41

generateinterface-ksp

Kotlin
2
star
42

kotlin_programmer_dictionary

2
star
43

DependencyInjection-KSP

Simple example showing KSP processing with multiple rounds of execution.
Kotlin
2
star
44

marcinmoskala.github.io

CSS
2
star
45

testing-android-exercise

Kotlin
2
star
46

coroutines-android-testing-example

Kotlin
2
star
47

sudoku-generator-exercise

Kotlin
2
star
48

snake

Snake game written in Python
Python
1
star
49

measured-wrapper-ap

Kotlin
1
star
50

JSCoroutinesRecipes

Set of recipes for useful Kotlin/JS coroutines functions
1
star
51

effective-kotlin-website

HTML
1
star
52

kotlin-workshop

Kotlin
1
star
53

MorningWorkout

Kotlin
1
star
54

workshop-android-16-18.4.19

Kotlin
1
star
55

cde-droidcon-it

This is project made during Maciej Gรณrski workshops about Continuous Delivery
Java
1
star
56

kotlin_essentials_book_pl

Kotlin
1
star
57

ktor-playground

Kotlin
1
star
58

NetworkClientTests

Kotlin
1
star
59

DeckMarkdown

Kotlin
1
star
60

ksp-template

Kotlin
1
star
61

next-starter-jamstack

JavaScript
1
star