Skip to content

Files

Latest commit

5ffd888 · Dec 23, 2024

History

History
53 lines (34 loc) · 2.56 KB
·

README.md

File metadata and controls

53 lines (34 loc) · 2.56 KB
·

Chat App Multiplatform

This is a demo of a chat app using Compose Multiplatform, Koin and supabase-kt.

Available platforms: Android, iOS, Desktop, JS Canvas

Modules used: Realtime, Auth*, Postgrest, Compose Auth UI

  • Integrated flows: Password, Google login & password recovery
firefox_HOcnZjjRpE.mp4

Configuration

To run the app, you need to create a Supabase project and create a table called messages with the following columns:

image

Then you need to specify your Supabase url and key in supabaseModule.kt If you want Google login to work, set it up in the Supabase dashboard and add io.jan.supabase://login to the registered urls.

Running

To run the app, you need to run the following commands in the root directory of the project:

./gradlew :sample:chat-demo-mpp:desktop:runDistributable (Desktop)
./gradlew :sample:chat-demo-mpp:web:jsBrowserDevelopmentRun (JS Canvas)

For android, use the IDE to run the app.

iOS Development Setup

Set up with XCode 15 and run the app on iOS 17 Open the project with workplace file (chatdemoios.xcworkspace)

Open project settings Go to Build phases section, create New Run Script Phase with this value

cd "$SRCROOT/.."
./gradlew :sample:chat-demo-mpp:common:embedAndSignAppleFrameworkForXcode
Screenshot 2023-12-29 at 13 02 54

Then move run script to be above Compile Sources Screenshot 2023-12-29 at 13 03 00

Switch to Build Settings and set these values

  • Framework Search Paths - $(SRCROOT)/../common/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)

  • Other linker flags - $(inherited) -framework common

Screenshot 2023-12-29 at 12 59 40 Screenshot 2023-12-29 at 12 59 53

At this point, the app can be run either with Android Studio with iOS configuration or XCode