Skip to content

Kotlin & Compose Multiplatform URL shortener app that allows users to quickly shorten long URLs using TinyURL API.

Notifications You must be signed in to change notification settings

iAbanoubSamir/TinyUrlKMP

Repository files navigation

TinyUrlKMP - A Kotlin Multiplatform URL Shortener

Build Status Kotlin Compose Multiplatform Ktor Koin SQLDelight

Overview

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.

Features

  • ✂️ 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.

Technologies Used

  • 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.

Demo Video

Watch the app in action:

TinyURL.KMP.Demo.mp4

Getting Started

Prerequisites

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).

Installation

  1. Clone the repository:
    git clone https://github.com/iAbanoubSamir/TinyUrlKMP.git
  2. Open the project in Android Studio.
  3. Sync the Gradle files.
  4. Replace YOUR_API_KEY in composeApp/src/commonMain/kotlin/com/tiny/url/shortener/data/network/LinkShortenerDataSource.kt with your actual API token from: TinyURL API.

Running the Project

  • 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.

To-Do List

  • Create JS target (since room 2.7.0 and sqldelight 2.0.2 does not support wasmJs).
  • Implement history feature using SQLDelight/Room.

Contributing

🚀 Contributions are welcome! Feel free to open issues, submit pull requests, or suggest new features.

License

This project is licensed under the MIT License.

About

Kotlin & Compose Multiplatform URL shortener app that allows users to quickly shorten long URLs using TinyURL API.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages