Skip to content

HEALTH-X-dataLOFT/consent-management-app

Repository files navigation

Consent Management App

The Consent Management App is intended to be a mobile application that allows users to manage their personal healthcare data. The app is available for Android and iOS, and it has a backend that communicates with the Health-X dataspace.

For more details on the functionality and motivation behind the project, please read the project page.

Prerequisites

If you're new to Flutter the first thing you'll need is to follow the setup instructions

Once Flutter is setup, you need access to an instance of the CMA Backend and a OIDC provider to use the features of this application.

Note: When running or building the app, you must specify which hosts to talk to. This is done by adding the BASE_PATH, OIDC_ISSUER and OIDC_CLIENT compilation environment declaration, which is picked up by the application. For the purpose of demonstration we use http://development.host.local:1234, http://oidc.host.local:1234 and CMA.

Installing

  1. Clone the repository to your local machine:

    git clone git@https://github.com/HEALTH-X-dataLOFT/consent-management-app.git
  2. Navigate to the project directory:

    cd consent-management-app
  3. Download image_magick_q16 package:

    Download from GitHub image_magick_q16 package and put in a vendor/im folder

    git clone [email protected]:Haidar0096/image_magick_q16.git vendor/im
    flutter pub get --directory vendor/im
    
  4. Install dependencies:

    flutter pub get

Usage

The application can be started either via the cli or directly in the IDE. For more information about target devices and simulators for Android or iOS please read the Get started guide.

Run in CLI

flutter run \
  --dart-define="BASE_PATH=http://development.host.local:1234"

Run in vscode

In vscode you need to add configuration to your launch.json.

{

    "version": "0.2.0",
    "configurations": [
        {
            "name": "consent-management-app",
            "request": "launch",
            "type": "dart",
            "toolArgs": [
                "--dart-define",
                "BASE_PATH=http://development.host.local:1234"
                "--dart-define",
                "OIDC_ISSUER=http://oidc.host.local:1234"
                "--dart-define",
                "OIDC_CLIENT=CMA"
            ]
        }    
    ]
}

Developing

Some dependencies and tools rely on code generation as is common in Flutter development.

Generate flutter_localizations code

If you want to make changes to the application resource bundle files (.arb) in /localization folder, you'll need to update the generated code for flutter_localizations.

Just run the following command:

flutter gen-l10n

Generate auto_route code

If you make changes to the routing of the application, you must regenerate the code for auto_route.

You can either run this once:

flutter packages pub run build_runner build

Or run a watcher that regenerates code on change:

flutter packages pub run build_runner watch

Generate dwa_backend_api

If the OpenAPI definition for the CMA Backend API has been updated, you need to regenerate the code for openapi-generator:

flutter pub run build_runner build --delete-conflicting-outputs

Build Apps

For detailed information check out the documentation on App Deployment

Note: You can build the app for different platforms, but at the moment we only support Android.

Build Android App

To build the app for Android, use the following command:

flutter build apk \
    --dart-define="BASE_PATH=http://development.host.local:1234" \
  --dart-define="OIDC_ISSUER=http://oidc.host.local:1234" \
  --dart-define="OIDC_CLIENT=CMA"

The APK file will be generated in the build/app/outputs/apk directory.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published