GithubHelp home page GithubHelp logo

marcinmoskala / ktacademyportal Goto Github PK

View Code? Open in Web Editor NEW
443.0 34.0 55.0 33.37 MB

Multiplatform Kotlin application of KotlinAcademy

License: Apache License 2.0

Kotlin 43.67% JavaScript 0.17% HTML 0.43% CSS 53.43% Shell 0.08% Swift 2.16% Ruby 0.05%

ktacademyportal's Introduction

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.

ktacademyportal's People

Contributors

jshvarts avatar leandroborgesferreira avatar majamarkiewicz avatar marcinmoskala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ktacademyportal's Issues

can't update cards in waffle

I can't update cards in waffle (logged with my github account) because "only collaborator can" say a notification when I try...

Missing Some Files while Downloading

I didn't found presenter package in this mobile package

I did't found following in FirebaseIdService.kt:

import org.kotlinacademy.data.FirebaseTokenType.Android
import org.kotlinacademy.presentation.notifications.RegisterNotificationTokenPresenter
import org.kotlinacademy.presentation.notifications.RegisterNotificationTokenView

Is there any solution?

New Readme

There should be new Readme that introduces project, includes contribution guides, informs about project structure, shows contributors with their photos and contributions, includes licence.

Running web fails

I try to run web with ./gradlew :web:run but get an error

Task :web:npm-install FAILED
npm WARN npm npm does not support Node.js v12.1.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9, 10.
npm WARN npm You can find the latest version at https://nodejs.org/
npm WARN deprecated [email protected]: ๐Ÿ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN deprecated [email protected]: core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated [email protected]: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules_imported/common-js" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dmitrykolesnikovich/.npm/_logs/2019-06-05T12_48_34_925Z-debug.log

Unable to build

Hello,
I am trying to build your project in Android Studio, but getting the following error:

Build file '/Users/igorganapolsky/workspace/git/kotlin/KotlinAcademyApp/desktop/build.gradle' line: 49

  • What went wrong:
    A problem occurred evaluating project ':desktop'.

Could not resolve all files for configuration ':desktop:compile'.
Could not resolve com.squareup.okhttp3:logging-interceptor:3.6.0.
Required by:
project :desktop > project :common-client-jvm
project :desktop > project :common-client-jvm > project :common-jvm
> Could not resolve com.squareup.okhttp3:logging-interceptor:3.6.0.
> Could not get resource 'http://dl.bintray.com/kotlinx/kotlinx/com/squareup/okhttp3/logging-interceptor/3.6.0/logging-interceptor-3.6.0.module'.
> Could not GET 'http://dl.bintray.com/kotlinx/kotlinx/com/squareup/okhttp3/logging-interceptor/3.6.0/logging-interceptor-3.6.0.module'.
> Read timed out

Any ideas?
Thanks

web app build fails

building root gradle file succeeds but building web app fails.

I run: npm install; npm run serve and it complains about missing files: (common-client-js.js, web.js required from web/src/main/js/index.js). Also I could not find any actual building of common-client-js file (quick find in path..).

how can I solve that, are there any instructions how to use this project?

Main build is broken

Hey, after your commit 24559d3 'Introduce coroutines to common-client module' the main build stopped working.
To reproduce this bug, on master branch just run: ./gradlew build.
Gradle cannot find the kotlinx common-client/src/main/kotlin/org/kotlinacademy/presentation/BasePresenter.kt: (3, 8): Unresolved reference: kotlinx
Separately, the project is built and started normally. But this is a very annoying mistake that is misleading.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.