A Kotlin Multiplatform (KMP) application for browsing events from the Ticketmaster API, built with Jetpack Compose for Android and supporting offline caching with Room.
This app fetches and displays events for a given city, allowing users to browse paginated event lists, filter by search queries, and view event details. It’s designed to work across Android and iOS using shared business logic and platform-specific implementations for networking and UI.
- Current Platforms: Android and iOS
- Key Features:
- Event listing with pagination
- Search filtering by event name and location
- Offline support via Room database
- City-based event retrieval
- Android Studio: Latest stable version (e.g., Koala | 2024.1.1 or later)
- JDK: 17 or higher
- Kotlin: 2.1.0
- Gradle: 8.10.2 (compatible with wrapper)
- Kotlin Multiplatform (KMP): Shared code for Android and iOS.
- Jetpack Compose: Declarative UI framework for both platforms.
- Koin: Dependency injection for managing components.
- Room: Configured local database (not yet used in code).
- Ktor: Networking for real API calls.
- Coil: Image loading for post images.
- Coroutines & Flow: Asynchronous programming and state management.
- Mockative: Kotlin Native test framework.
- AppViewModel: Manages UI state, pagination, and search filtering.
- GetEventsUseCase: Fetches events and maps errors to user-friendly messages.
- AppRepositoryImpl: Combines network and local data sources with caching.
- NetworkRemoteDataSource: Calls the Ticketmaster API via Ktor HttpClient.
- DbDataSource & EventDao: Handles local storage with Room.
- Event: Data model with API-to-local mapping and date formatting.
- Presentation Layer: Jetpack Compose UI with
AppViewModelusing Kotlin Flows. - Domain Layer: Use cases (e.g.,
GetEventsUseCase) for business logic. - Data Layer:
AppRepositoryinterface andAppRepositoryImplfor data orchestration.RemoteDataSource(network) andLocalDataSource(database) implementations.
- Networking: Ktor
HttpClient(platform-specific: Android uses CIO, iOS uses Darwin). - Database: Room with an in-memory option for testing.
- Error Handling:
Eithertype for success/failure states, with mapped error messages.
Clone the Repository:
git clone git@github.com:andreBurnt/Funster.gitConfigure API Key:
Obtain a Ticketmaster API key from developer.ticketmaster.com.
Add it to the BuildConfig in ./composeApp/build.gradle.kts
```
buildConfig {
useKotlinOutput { internalVisibility = true }
buildConfigField("API_BASE_URL", "https://app.ticketmaster.com/discovery/v2")
buildConfigField("API_TOKEN", "1234567890")
}
```
- Open the project in Android Studio.
- Sync the Gradle files (File > Sync Project with Gradle Files).
- Build and run the app on an emulator or device (Run > Run 'composeApp').
- Open iosApp/iosApp.xcodeproj in Xcode.
- Ensure the Kotlin Multiplatform plugin is installed in Android Studio (for syncing shared code).
- Build and run the app on a simulator or device (Product > Run).
Funster/
├── composeApp/ # Main app module (KMP)
│ ├── src/
│ │ ├── androidMain/ # Android-specific code (e.g., HttpClient)
│ │ ├── commonMain/ # Shared code across platforms
│ │ │ ├── co/funster/app/
│ │ │ │ ├── core/ # Models, ViewModel, UI state
│ │ │ │ ├── data/ # Repository implementation
│ │ │ │ ├── db/ # Room database and DAO
│ │ │ │ ├── domain/ # Use cases
│ │ │ │ └── network/# Network data source
│ │ ├── commonTest/ # Shared unit tests
│ │ └── androidTest/ # Android-specific tests (e.g., Room)
│ └── build.gradle.kts # Module build configuration
└── README.md # This file
Open the app to view the events. Change the city to view events in other cities. Pull up to reload the events. Scroll down to load new events.
- If the user scrolls down fast, the next events page is not loading.
iOS UI relies on SwiftUI integration, which may differ slightly from Android’s Compose UI.
Testing Multiplatform Composable UI is blocked due to a bug https://slack-chats.kotlinlang.org/t/18784429/hi-there-i-m-trying-to-run-an-ui-test-in-shared-commontest-a TODO: find a workaround, monitor updates to https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-test.html
Previews in Android Studio are limited to androidMain, but our composables are commonMain JetBrains/compose-multiplatform#4869
Note: Testing UI using Android Espresso in Android app for now.
- Improve UX!
- Add ability to view event details
- Enable proguard for release and configure proguard rules
- Inline Functions: Investigate and implement inline functions in performance-critical areas (e.g., state updates in AppViewModel.kt) to reduce overhead.
- Break composeApp into separate Gradle modules (e.g., :core, :data, :domain, :presentation) for better modularity.
- Use device location to show nearby events instead of a list of cities.
- Allow user to select a location to search for events. Validate the location using 3rd service (e.g. Google Address Validation API).
- UI End-to-end tests (Android Espresso, XCTest). Configure end-to-end tests for Kotlin multiplatform for Compose UI (add test tags).
- Add Compose preview components to display UI changes in Android Studio.
- Move API secrets to a local file (e.g. secrets.properties) and configure token injection to BuildConfig or to SecureSettings.
- Add string translations for i18n.
- Prototype with Android Instant app.
This is a sample project.
This project is unlicensed and intended for educational purposes only.

