/pokedex-compose-multiplatform

[WIP] Pokedex app experiment using Compose Multiplatform

Primary LanguageKotlin

Pokedex

image

Compose Multiplatform Pokedex app. [WIP]

Before running!

  • install JDK 17 on your machine
  • add local.properties file to the project root and set a path to Android SDK there

Android

To run the application on android device/emulator:

  • open project in Android Studio and run imported android run configuration

To build the application bundle:

  • run ./gradlew :androidApp:assembleDebug
  • find .apk file in androidApp/build/outputs/apk/debug/androidApp-debug.apk

iOS

To run the application on iPhone device/simulator:

Feature Architecture

data/
  ktorfit api
  response models
  repository
domain/
  domain models
  mappers
presentation/
  steps
  components
  strings

Libraries

Modules explanations

  • Foundation Core: Holds custom pure Kotlin functions, currently, the place of the safeCatching extension for avoiding Coroutine Scopes not being able to cancel when code called from runCatching.
  • Foundation Theme: The Compose Material 3 Theming + Platform System theme lookup
  • Foundation Swipe Back: Custom component for support Navigation Swipe Back in iOS
  • Foundation Serialization: Singleton with default Kotlinx.serialization configuration
  • Foundation Network: Setup of Ktor HttpClient and Ktorfit build function
  • Foundation Components: Commum Compose Components like, HeaderBar, Error State View, Layout and LazyList Pagination utils
  • Foundation Error: The ErrorState model and error mapping
  • Foundation Kodein: Custom Kodein Scopes for Voyager Navigator and Screen lifecycle, this make possible to have a dependency that survives until the Navigator or the Screen survives.
  • Foundation Step ViewModel: A Custom ViewModel implementation that is opinionated that holds the UI State and the Business State, similar to BloC Cubit
  • Foundation Navigation: It has multiple responsibilities, Setup Voyager Navigator with the Kodein Graph + Context, Defines and Provide the Scaffold Composition Local API and most important, defines the Step and StepStateful.

  • composeApp: The Compose Main Application Module, it where is has the Main Composable
  • androidApp: The Android App with the Activity that initialize the Main Composable from composeApp
  • iosUmbrella: The module that generates the Framework and exposes the Main Composable from composeApp as a UiViewController
  • iosApp: A iOS App using Swift UI that has a build phase for building de iosUmbrella module and initializing the UI by consuming the UiViewController from the iosUmbrella module.

  • Gradle: Convention plugins, Kotlin Scripting, Version Catalog and Typesafe Project Accessor

Current state of the project

image image image