TinyUrlKMP is a Kotlin Multiplatform (KMP) app that lets you shorten long URLs into compact, shareable links. Built with Compose Multiplatform, it provides a seamless experience across Android, iOS, Desktop, and Web (via Kotlin/Wasm). The app integrates with the official TinyURL API to generate short links quickly and efficiently.
- ✂️ URL Shortening: Convert long links into short, shareable URLs instantly.
- 📜 History Tracking: Keep track of previously shortened URLs.
- 🎨 Adaptive UI: A modern, responsive design using Material3.
- ⚡ Blazing Fast: Smooth performance across platforms.
- Kotlin Multiplatform (KMP): Shared business logic across all platforms.
- Compose Multiplatform (CMP): Shared UI across all platforms.
- Ktor: Networking for API requests.
- Koin: Dependency injection.
- SQLDelight: Local database storage for link history.
- Kotlinx.serialization: JSON serialization.
- Kotlinx.coroutines: Asynchronous programming.
- Kotlinx.datetime: Date and time utilities.
- Compose Navigation: Smooth app navigation.
- Material3 Adaptive Navigation: Responsive navigation.
Watch the app in action:
TinyURL.KMP.Demo.mp4
Ensure you have the following installed:
- Android Studio with the Kotlin Multiplatform Mobile plugin.
- Java Development Kit (JDK) 17 or higher.
- Node.js and npm (for Kotlin/Wasm support).
- Clone the repository:
git clone https://github.com/iAbanoubSamir/TinyUrlKMP.git
- Open the project in Android Studio.
- Sync the Gradle files.
- Replace
YOUR_API_KEY
incomposeApp/src/commonMain/kotlin/com/tiny/url/shortener/data/network/LinkShortenerDataSource.kt
with your actual API token from: TinyURL API.
- Android: Run the
composeApp
configuration in Android Studio. - iOS: Run
iosApp
configuration in Xcode. - Desktop: Execute the
:composeApp:run
Gradle task. - Web: Use
:composeApp:wasmJsBrowserDevelopmentRun
in Android Studio.
- Create JS target (since room 2.7.0 and sqldelight 2.0.2 does not support wasmJs).
- Implement history feature using SQLDelight/Room.
🚀 Contributions are welcome! Feel free to open issues, submit pull requests, or suggest new features.
This project is licensed under the MIT License.