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.
- Project Middleware Documentation
- Middleware Backend Repository
- Authentication Service Repository
- Postman Documentation
-
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.
- 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
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
The iOS app consumes the shared KMP module via CocoaPods. Follow these steps every time the shared module changes:
-
Generate the shared framework:
./gradlew assembleSharedXCFramework
-
Install/update CocoaPods dependencies (from the
iosApp/directory):cd iosApp && pod install
-
Open the workspace (not the
.xcodeproj) in Xcode:iosApp/iosApp.xcworkspace
Note: The shared framework is built as a static library (
isStatic = trueinshared/build.gradle.kts). If you see adyld: Library not loaded: @rpath/shared.framework/sharedcrash, confirm that setting is in place and re-sync.
- Sign Up and Login: Create your account or log in to access your configurations
- Explore APIs: View already configured routes or add a new one
- Define Original Route: Configure the source API, specifying HTTP method, URL and path
- Map Fields: Define how each field in the original response should be transformed
- Configure Parameters: Add custom headers or other necessary parameters
- Preview Test: View the transformation result before confirming
- Create Route: Finalize and create your custom mapped route