A Kotlin Multiplatform demo application showcasing modern mobile development with shared business logic and part of the UI between iOS and Android. Search GitHub repositories, view details, and save your favorites.
- π Search GitHub Repositories - Real-time search using GitHub's GraphQL API
- π Repository Details - View comprehensive information about any repository
- β Favorites - Save and manage your favorite repositories locally
- π¨ Native Navigation - SwiftUI TabView on iOS, Compose Navigation on Android
- π Shared Business Logic - Common code for networking, data storage, and ViewModels
- π¦ Modern Architecture - Clean Architecture with Repository pattern and DI
This project demonstrates:
- Apollo Kotlin v4 integration in a KMP project
- Koin dependency injection across platforms
- SQLDelight for local data persistence
- Compose Multiplatform UI shared between platforms
- Native navigation integration (SwiftUI for iOS, Compose for Android)
- Production-quality architecture in a demo context
Perfect for:
- Learning KMP development
- Understanding Apollo GraphQL in mobile apps
- Reference architecture for new KMP projects
- Portfolio/interview showcase
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Presentation β
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ β
β β Android (Compose) β β iOS (SwiftUI) β β
β β - Compose Navigationβ β - TabView β β
β β - Material3 β β - NavigationStack β β
β ββββββββββββββββββββββββ ββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Shared Module (KMP) β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β UI Layer (Compose Multiplatform) β β
β β - SearchScreen.kt β β
β β - RepoDetailsScreen.kt β β
β β - FavoritesScreen.kt β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β ViewModel Layer β β
β β - SearchViewModel (StateFlow) β β
β β - RepoDetailsViewModel β β
β β - FavoritesViewModel β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Domain Layer β β
β β - Repository, RepositoryDetails (models) β β
β β - GitHubRepository (interface) β β
β β - FavoritesRepository (interface) β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β ββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββ β
β β Data Layer (API) β Data Layer (Local) β β
β β - Apollo Client β - SQLDelight β β
β β - GraphQL Queries β - Database Driver β β
β β - GitHubApiClient β - FavoritesDatabase β β
β ββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Dependency Injection (Koin) β β
β β - networkModule, databaseModule, viewModelModule β β
β βββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology |
|---|---|
| UI | Compose Multiplatform |
| Navigation | Compose Navigation (Android), SwiftUI Navigation (iOS) |
| State Management | ViewModel, StateFlow, Coroutines |
| Networking | Apollo Kotlin 4 (GraphQL) |
| Local Storage | SQLDelight |
| Dependency Injection | Koin |
| Build System | Gradle with Kotlin DSL |
apollo-kmp-github/
βββ composeApp/ # Shared KMP module
β βββ src/
β β βββ commonMain/
β β β βββ kotlin/
β β β β βββ config/
β β β β β βββ Secrets.kt # Gitignored secrets
β β β β β βββ Secrets.example.kt # Template
β β β β βββ data/
β β β β β βββ api/
β β β β β β βββ ApolloClientFactory.kt
β β β β β β βββ GitHubApiClient.kt
β β β β β βββ local/
β β β β β β βββ DatabaseDriverFactory.kt
β β β β β β βββ FavoritesDatabase.kt
β β β β β βββ model/
β β β β β β βββ Repository.kt
β β β β β β βββ RepositoryDetails.kt
β β β β β βββ repository/
β β β β β βββ GitHubRepository.kt
β β β β β βββ FavoritesRepository.kt
β β β β βββ di/
β β β β β βββ KoinInit.kt
β β β β β βββ NetworkModule.kt
β β β β β βββ DatabaseModule.kt
β β β β β βββ ViewModelModule.kt
β β β β βββ ui/
β β β β β βββ screens/
β β β β β β βββ SearchScreen.kt
β β β β β β βββ RepoDetailsScreen.kt
β β β β β β βββ FavoritesScreen.kt
β β β β β βββ components/
β β β β β β βββ RepositoryCard.kt
β β β β β βββ theme/
β β β β β βββ Theme.kt
β β β β βββ viewmodel/
β β β β βββ SearchViewModel.kt
β β β β βββ RepoDetailsViewModel.kt
β β β β βββ FavoritesViewModel.kt
β β β βββ graphql/
β β β βββ schema.graphqls # GitHub GraphQL schema
β β β βββ SearchRepositories.graphql
β β β βββ GetRepositoryDetails.graphql
β β βββ androidMain/
β β β βββ kotlin/
β β β βββ data/local/
β β β βββ DatabaseDriverFactory.android.kt
β β βββ iosMain/
β β βββ kotlin/
β β βββ data/local/
β β βββ DatabaseDriverFactory.ios.kt
β βββ build.gradle.kts
β
βββ androidApp/ # Android-specific code
β βββ src/main/
β β βββ kotlin/
β β β βββ MainActivity.kt
β β β βββ Navigation.kt
β β βββ AndroidManifest.xml
β βββ build.gradle.kts
β
βββ iosApp/ # iOS-specific code
β βββ iosApp/
β β βββ ContentView.swift # SwiftUI TabView
β β βββ ComposeViews.swift # UIViewControllerRepresentable
β β βββ iosAppApp.swift
β βββ iosApp.xcodeproj
β
βββ gradle/
β βββ libs.versions.toml # Version catalog
βββ .gitignore
βββ build.gradle.kts
βββ settings.gradle.kts
βββ README.md
- Android Studio (latest stable version)
- Xcode 16+ (for iOS development)
- GitHub Personal Access Token
git clone https://github.com/goncharik/reposbrowser-kmp.git
cd reposbrowser-kmpThis app uses the GitHub GraphQL API and requires a personal access token.
Get a token:
- Go to GitHub Settings > Tokens
- Click "Generate new token" β "Generate new token (classic)"
- Give it a name:
ReposBrowser - Select scope:
public_repo(read access to public repositories) - Click "Generate token" and copy it
Add token to project:
# Navigate to the config directory
cd composeApp/src/commonMain/kotlin/com/honcharenko/reposbrowser/config/
# Copy the example file
cp Secrets.example.kt Secrets.kt
# Edit Secrets.kt and replace YOUR_GITHUB_TOKEN_HERE with your tokenYour Secrets.kt should look like:
object Secrets {
const val GITHUB_TOKEN = "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}./gradlew buildOption A: Android Studio
- Open the project in Android Studio
- Select
androidAppconfiguration - Choose an emulator or connected device
- Click Run
βΆοΈ
Option B: Command Line
./gradlew :androidApp:installDebugRequirements: macOS with Xcode installed
Option A: Xcode
- Open
iosApp/iosApp.xcodeprojin Xcode - Select a simulator or device
- Click Run
βΆοΈ
Option B: Command Line
# Build the KMP framework first
./gradlew :composeApp:embedAndSignAppleFrameworkForXcode
# Open in Xcode
open iosApp/iosApp.xcodeprojEugene Honcharenko - @honcharenko_eu
Project Link: https://github.com/goncharik/reposbrowser-kmp
Built with β€οΈ using Kotlin Multiplatform