Skip to content

Latest commit

 

History

History
103 lines (77 loc) · 2.38 KB

README.adoc

File metadata and controls

103 lines (77 loc) · 2.38 KB

AeroGear Data Sync Showcase Application

Example application using AeroGear Mobile Services.

Implementation

Implementation includes:

  • Integration with AeroGear Mobile Services

  • Ionic 4 Angular frontend backed by Cordova

  • A Node.js GraphQL Server that implements a sample Tasks workflow

GraphQL Client

The mobile application uses Voyager Client to provide additional offline capabilities on top of Apollo GraphQL.

GraphQL Server

The GraphQL server uses Voyager Server to provide GraphQL capabilities along with security, monitoring and tools to simplify GraphQL API development.

Getting Started

Requirements:

  • Docker

  • Node.js 6.x or above to run server

  • (optional) access to a running OpenShift instance

Running the server

  1. Start the PostgreSQL container

    cd ./server
    docker-compose up -d
  2. Start the server

    npm install
    npm run start
    Note

    If Keycloak integration is enabled on the server, and the Keycloak server is running using self-signed certificate, please make sure set this environment variable before running the server:

    export NODE_TLS_REJECT_UNAUTHORIZED=0

Running the Server on OpenShift (optional)

  1. Log into your OpenShift instance with the oc login command.

  2. Deploy the Server with PostgreSQL

    oc new-app -f server/openshift-template.yml
  3. To deprovision all of the resources from the template, run

    oc delete all -l app=ionic-showcase-server \
    && oc delete secret -l app=ionic-showcase-server \
    && oc delete pvc -l app=ionic-showcase-server

Running the Client

  1. Install Ionic 4

    npm install -g ionic@4
  2. Install dependencies

    npm install
  3. Browse Ionic 4 app

    npm run start
  4. Alternatively - Run as a mobile application in the Android emulator.

    npm run ionic:android
Note
To connect to the local GraphQL server, when the app is running in the Android emulator, please change [Client URL](https://github.com/aerogear/apollo-voyager-ionic-example/blob/master/src/app/services/voyager.service.ts#L42) from localhost to 10.0.2.2

OpenShift Integration

To integrate with OpenShift mobile config please paste your configuration into mobile-services.js file