Skip to content

About

KMP App to use the ProjectMiddleware, solution that allows you to easily map, transform, and customize API responses to fit your application's needs with flexible rules, preview functionality and seamless integration.

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Middleware Playground

Overview

Middleware Playground is a multiplatform application developed with Kotlin Multiplatform (KMP) that enables you to map, transform, and customize API responses to fit your application's needs.

Integrating with the route mapping middleware, the app provides an intuitive graphical interface to create transformation rules, preview changes, and manage your mapping configurations, all with a consistent user experience on both Android and iOS.

Official Documentation and Resources

Key Features

  • Multiplatform Interface: Developed using Kotlin Multiplatform, providing a native experience for both Android (Jetpack Compose) and iOS (SwiftUI).

  • Route Management: View, create, and organize your mapped routes with an intuitive interface.

  • Intuitive Mapping Editor: Step-by-step interface for creating mappings, allowing:

    • Simple field mapping definition
    • Grouping related fields
    • Value concatenation
    • Transformation of complex JSON structures
  • Real-time Preview: Test your mapping configurations before permanently creating them.

  • Profile Management: Keep all your configurations secure with an integrated authentication system.

Technologies Used

  • Kotlin Multiplatform: Foundation for code sharing between platforms
  • Jetpack Compose: Declarative UI framework for Android
  • SwiftUI: Declarative UI framework for iOS
  • Ktor Client: For multiplatform HTTP communication
  • SQLDelight: Multiplatform local data persistence
  • Kotlin Coroutines Flow: State management and asynchronous communication

Architecture

The application was developed following Clean Architecture and SOLID principles:

  • Separation of Concerns: Well-defined layers for domain, data, and presentation
  • State Pattern for UI: Event-based interface state management
  • Factory Pattern: To abstract platform-specific implementations
  • Adapter Pattern: For sharing ViewModels between platforms
  • Dependency Inversion: To ensure business code doesn't depend on external frameworks

Building for iOS

The iOS app consumes the shared KMP module via CocoaPods. Follow these steps every time the shared module changes:

  1. Generate the shared framework:

    ./gradlew assembleSharedXCFramework
  2. Install/update CocoaPods dependencies (from the iosApp/ directory):

    cd iosApp && pod install
  3. Open the workspace (not the .xcodeproj) in Xcode:

    iosApp/iosApp.xcworkspace
    

Note: The shared framework is built as a static library (isStatic = true in shared/build.gradle.kts). If you see a dyld: Library not loaded: @rpath/shared.framework/shared crash, confirm that setting is in place and re-sync.

How to Use

Getting Started

  1. Sign Up and Login: Create your account or log in to access your configurations
  2. Explore APIs: View already configured routes or add a new one

Creating a New Mapping

  1. Define Original Route: Configure the source API, specifying HTTP method, URL and path
  2. Map Fields: Define how each field in the original response should be transformed
  3. Configure Parameters: Add custom headers or other necessary parameters
  4. Preview Test: View the transformation result before confirming
  5. Create Route: Finalize and create your custom mapped route

Demo videos:

Android

PlatgrounAccelerated.-.1080WebShareName.mov

iOS

DemoPLaygroundiOS.1.mov

About

KMP App to use the ProjectMiddleware, solution that allows you to easily map, transform, and customize API responses to fit your application's needs with flexible rules, preview functionality and seamless integration.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages