Ragu Multiplatform is a Kotlin Multiplatform chat application demonstrating real-time messaging capabilities on Android and iOS platforms. It highlights the power of shared code using Compose Multiplatform and Kotlin Multiplatform.
- Real-time messaging across Android and iOS platforms
- Shared codebase using Kotlin Multiplatform
- Modern UI with Compose Multiplatform
-
- Used for building the UI across all platforms.
-
Koin:
- Handles dependency injection for services and view models across platforms.
-
Ktor:
- Manages network requests and WebSocket connections for real-time messaging.
-
- Handles JSON serialization and deserialization.
-
- Manages date and time operations across platforms.
-
- Provides logging capabilities across platforms.
-
- Handles image loading and caching.
-
- Used for loading and displaying vector animations.
-
- Manages internet connection status and network changes.
-
- Integrates Firebase services, including Crashlytics.
-
- Generates dynamic color palettes for Material 3 theming, enhancing the app's visual customization capabilities.
-
- A Kotlin Multiplatform library for data storage that works across Android, iOS, and desktop platforms.
-
- Markdown text rendering and syntax highlighting.
The project follows a typical Kotlin Multiplatform structure:
composeApp/: Contains the shared code and platform-specific implementationssrc/commonMain/: Shared Kotlin code for all platformssrc/androidMain/: Android-specific codesrc/iosMain/: iOS-specific code
iosApp/: iOS application modulegradle/: Gradle configuration filesbuild.gradle.kts: Main Gradle build script
The application uses a config.properties file for managing API endpoints and authentication
settings.
- Locate the
config.example.propertiesfile in the project root. - Make a copy of it and rename it to
config.properties. - Update the values in
config.propertieswith your actual configuration.
The application relies on values from config.properties to define constants in Constants.kt.
These constants are built using BuildConfig, which extracts values from config.properties at
build time.If config.properties is missing or incorrectly set up, the project will not build
since required values will be undefined.
-
Do not commit
config.propertiesto version control. -
Ensure that
config.propertiesis correctly configured and placed in the appropriate directory before running the application.
-
Do not commit
config.propertiesto version control. -
Ensure that
config.propertiesis placed in the correct directory before running the application (only rename the existing example file).
This project follows a Clean Architecture approach with MVVM (Model-View-ViewModel) for the presentation layer:
-
Presentation Layer (
ui/directory):- Uses Compose Multiplatform for the UI
- ViewModels handle UI logic and state management
-
Domain Layer (
domain/directory):- Contains business logic and use cases
- Defines repository interfaces
-
Data Layer (
data/directory):- Implements repository interfaces
- Manages data sources (local storage, network)
- Dependency Injection: Koin is used for dependency injection across the app.
- Navigation: Implemented using Compose Navigation.
- Networking: Ktor handles API requests and WebSocket connections.
- State Management: Kotlin Flows and StateFlow for reactive state management.
- Concurrency: Coroutines and Flows for asynchronous operations.
Check Your Development Environment: Follow the instructions provided in the official Kotlin documentation to set up your environment for Kotlin Multiplatform development: Multiplatform Setup.
-
Open the project in Android Studio.
-
Run the
composeAppconfiguration.
-
Open the project in Xcode.
-
Build and run.
This project uses a keystore.properties file for secure Android app signing. This file is not
included in the repository for security reasons.
- Create a file named
keystore.propertiesin the root directory of the project. - Add the following properties to the file:
storeFile=path/to/your/keystore.jks storePassword=your_store_password keyAlias=your_key_alias keyPassword=your_key_password - Replace the values with your actual keystore information:
storeFile: Path to your keystore file (e.g.,release_keystore.jks)storePassword: Password for your keystorekeyAlias: Alias of the key in the keystorekeyPassword: Password for the key
- Never commit the
keystore.propertiesfile or your actual keystore to version control. - Keep your keystore and its passwords secure and private.
The app's build.gradle.kts file is configured to use these properties for signing the release
version of the app. If the keystore.properties file is not found, an empty signing configuration
will be created, allowing the build process to continue without signing.
This project serves as a starting point for building custom chat solutions. Modify the UI, integrate with your backend, or more.
This repository contains Multiplatform app, a part of Ragu, covered under the Apache License 2.0, except where noted (any Ragu logos or trademarks are not covered under the Apache License, and should be explicitly noted by a LICENSE file.)
Multiplatform app, a part of Ragu, is a product produced from this open source software, exclusively by Barrage d.o.o. It is distributed under our commercial terms.
Others are allowed to make their own distribution of the software, but they cannot use any of the Ragu trademarks, cloud services, etc.
We explicitly grant permission for you to make a build that includes our trademarks while developing Ragu itself. You may not publish or share the build, and you may not use that build to run Ragu for any other purpose.