Skip to main content

Introduction

Leaf Loans allows Leaf customers to apply for, obtain, and pay off microloans. It works in conjunction with Leaf’s core wallet to support the storage and transport of assets across borders.

This repo contains the source code for the Leaf Loans mobile app.

We use Flutter and we follow clean architecture to allow for easy scalability and migration. Since the Leaf Loan app is still a work in progress, having loose coupling between the app logic and third party libraries gives us a much needed flexibility to try different approaches.

Prerequisites

  • Make sure you have Flutter installed.

  • Create a Firebase project and obtain a Google Services configuration file for iOS or Android. This is mandatory to run the app. You can follow the instruction here on how to obtain the Firebase Config File. You should then add them in the respective directories. In ios/ for the iOS version and in android/app/ for Android.

  • We also use Credo Lab's services to get information about our users' phone usage behaviors. You should get an Authentication key and Endpoint URL to allow the pull to happen.

  • After obtaining the Credo credentials, add the following values to your launch.json under the "configurations" in VS Code.

        {
    "args": [
    "--dart-define",
    "CREDO_AUTH_KEY=CREDO_AUTH_KEY",
    "--dart-define",
    "CREDO_URL=CREDO_URL"
    ],
    "name": "loan_app",
    "request": "launch",
    "type": "dart",
    }

    You can use the equivalent setup on Android Studio.

If you run the app from terminal, you can pass the arguments as follows

flutter run --dart-define CREDO_AUTH_KEY=CREDO_AUTH_KEY --dart-define CREDO_URL=CREDO_URL

Installing

  • In the terminal type flutter pub get to install all required packages

Contributing

If you want to contribute to the project, check out our Contribution Guidelines