CXwudi / realworld-compose-http4k-example-app

An unfinished Conduit (https://github.com/gothinkster/realworld) example app developed in Compose Multiplatform and Http4k
MIT License
0 stars 0 forks source link
compose-multiplatform decompose exposed http4k koin kotlin-multiplatform kstore mvikotlin

RealWorld Example App

2024.08 Update: I am pausing the implementation for now. More information at this discussion

Compose Multiplatform + http4k codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

Phone Desktop Web
Phone App Screenshot Desktop App Screenshot Click to enlarge Web App Screenshot Click to enlarge

This codebase was created to demonstrate a fully fledged fullstack application built with Compose Multiplatform and http4k including CRUD operations, authentication, routing, pagination, and more.

We've gone to great lengths to adhere to the community styleguides & best practices of Compose Multiplatform and http4k.

For more information on how this works with other frontends/backends, head over to the RealWorld repo.

How it works

The project is divided into 4 modules:

  1. conduit-common - the shared code between the client and the server.
  2. conduit-frontend - the KMP client source code.
  3. conduit-backend - the server source code.
  4. build-src - shared Gradle build logic, including the version catalog that is used globally across the project.

Develop

Install Android Studio and IntelliJ IDEA, then:

About Frontend

For frontend development, you need to follow this guide to set up the Compose Multiplatform development environment.

conduit-frontend declares all 4 platforms of JVM, Android, JS, and iOS. However, iOS is only declared in Gradle but not developed since I don't have a Mac machine.

conduit-frontend contains multiplatform tests that run on all 4 platforms. However, tests on the JS platform require a browser, so far useChromiumHeadless() is defined in kmp-library.gradle.kts, which means you need to install Chromium for running tests on the JS platform. If you already have a Chrome browser, feel free to change to useChromeHeadless()(or useFirefox() and others) for your convenience.