Skip to content

A Kotlin Multiplatform and Ktor based Fineract Client Library that you can use to interact with the Apache Fineract 1.x Platform.

License

Notifications You must be signed in to change notification settings

biplab1/fineract-client-kmp

 
 

Repository files navigation

Fineract Client Kotlin Multiplatform

Fineract Client KMP is a Kotlin Multiplatform library built with Ktorfit that enables interaction with the Apache Fineract 1.x Platform. This library includes all necessary services and data payload models, along with a Ktorfit instance used by the Fineract Client KMP SDK.

All services and payload models in this library are generated using the OpenAPI Generator. However, FineractClient.kt is not a generated file. it is responsible for creating the Ktorfit instance and serves as the entry point for accessing the services within the Fineract Client KMP SDK.

Kotlin Kotlin Multiplatform Open Source GSoC PRs Welcome GitHub license GitHub release GitHub issues Slack

Architecture

The library is organized into three main packages inside the fineract-client module:

  • models - Contains all the payloads, including request and response models for various services.

  • apis - Includes all service interfaces, such as ClientService, AuthService, etc.

  • infrastructure - Contains the FineractClient.kt file, which initializes the Ktorfit instance and exposes all services to the Fineract Client KMP SDK.

Code Generation

  • Follow these steps to generate data models and services using OpenAPI Tools:

Install OpenAPI Generator CLI

  • Install NPM (Skip this step if you already have npm installed).
  • Install OpenAPI Generator CLI using npm:
      npm install @openapitools/openapi-generator-cli -g

Download fineract.yml File

  • Download the fineract.yml file from Here

Generation

  • Once OpenAPI Generator CLI is installed, use the following command to generate the code:

        openapi-generator-cli generate \
        -i "C:\Users\Aditya\Downloads\fineract.yaml" \
        -o "C:\Users\Aditya\Desktop\MIFOS\web-app\packages\fineract-client\src" \
        -g kotlin \
        --library=jvm-retrofit2 \
        --additional-properties=useCoroutines=true,returnPlainBody=true \
        --skip-validate-spec
  • Replace -i "C:\Users\Aditya\Downloads\fineract.yaml" with the actual path to your fineract.yml file.

  • Note: Back in 2024, when these data models and services were generated, Ktorfit support was not available. So, we generated them using Retrofit2 and later modified the services to use Ktorfit. In the future, before generating the code, check whether Ktorfit support is available.

Quickstart Setup

Installation

Add dependency in the build.gradle.

  • Kts

      dependencies {
          implementation("com.github.openMF:fineract-client-kmp:$version")
      }
  • Groovy

      dependencies {
          implementation 'com.github.openMF:fineract-client-kmp:$version'
      }

Add this in your root settings.gradle.

  • Kts

      dependencyResolutionManagement {
          repositories {
              maven {
                  setUrl("https://jitpack.io")
              }
          }
      }
  • Groovy

      allprojects {
          repositories {
              maven { url 'https://jitpack.io' }
          }
      }

How to Contribute

Thank you for your interest in contributing to the Fineract Client KMP project by Mifos! We welcome all contributions and encourage you to follow these guidelines to ensure a smooth and efficient collaboration process. To get started, please refer to the Contribution Guide for detailed instructions on how to contribute to the project.

Wiki

Please visit our Wiki page for a detailed overview of the project's architecture and guidelines. Explore further to gain a deeper understanding of our project.

Contributors

Special thanks to the incredible code contributors who continue to drive this project forward.

About

A Kotlin Multiplatform and Ktor based Fineract Client Library that you can use to interact with the Apache Fineract 1.x Platform.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%