GithubHelp home page GithubHelp logo

thesetox / kmp-fun-clean-architecture Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 2.06 MB

[WIP] Template and playground for applying and showcasing Fun Clean Architecture in KMP (iOS, android, web, server, desktop).

Home Page: https://thesetox.github.io/KMP-Playground-Document/introduction.html

License: Apache License 2.0

Kotlin 96.65% HTML 1.05% Swift 2.30%
clean-architecture coil coroutines kmp koin kotlin kotlin-multiplatform ktor-client modularization mvi

kmp-fun-clean-architecture's Introduction

Kotlin Multiplatform Playground

This is a Kotlin Multiplatform project targeting Android, iOS, Web, Desktop, Server.

  • Android - OK
  • iOS - OK
  • Web - in progress
  • Desktop - in progress
  • Server - in progress

Android

iOS

Building the app

Important

You need to add the NEWS_API_KEY in your local.properties for Android.

For iOS, you can update the api key in the data module, iosMain/source.impl/NewsRemoteDataSource.ios.kt.

To get your own api key, go to --> https://newsapi.org/

Languages, libraries and tools used

  1. Kotlin
  2. Kotlin Coroutine
  3. Kotlinx Serialization
  4. Ktor client library
  5. Compose Multiplatform
  6. Koin
  7. SQL delight
  8. Coil

Warning

For more details, you can check the official document:

https://thesetox.github.io/KMP-Playground-Document/introduction.html (Work in Progress)

Kotlin Multiplatform with Compose Multiplatform (Main Structure)

image_diagram.png

Main Goal for Architecture (Status: Work in Progress)

image_fun_arch.png

Folders

  • /composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:

    • commonMain is for code that’s common for all targets.
    • Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, iosMain would be the right folder for such calls.
  • /iosApp contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.

  • /server is for the Ktor server application.

  • /shared is for the code that will be shared between all targets in the project. The most important subfolder is commonMain. If preferred, you can add code to the platform-specific folders here too. This is being used as the main /shared folder.

  • /domain is a shared module where it is responsible on creating the business logic. You usually don't need to add code to the platform-specific but you can add additional business logic depending on the target

  • /data is a shared module where it is responsible for fetching the data. You can fetch platform-specific data.

Note

Note: Compose/Web is Experimental and may be changed at any time. Use it only for evaluation purposes.

Acknowledgements

Special thanks to https://github.com/petros-efthymiou.

The project is an insipration from https://github.com/petros-efthymiou/DailyPulse

kmp-fun-clean-architecture's People

Contributors

thesetox avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

kmp-fun-clean-architecture's Issues

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.