Example application using AeroGear Mobile Services.
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
The mobile application uses Voyager Client to provide additional offline capabilities on top of Apollo GraphQL.
The GraphQL server uses Voyager Server to provide GraphQL capabilities along with security, monitoring and tools to simplify GraphQL API development.
Requirements:
-
Docker
-
Node.js 6.x or above to run server
-
(optional) access to a running OpenShift instance
-
Start the PostgreSQL container
cd ./server docker-compose up -d
-
Start the server
npm install npm run start
NoteIf 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
-
Log into your OpenShift instance with the
oc login
command. -
Deploy the Server with PostgreSQL
oc new-app -f server/openshift-template.yml
-
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
-
Install Ionic 4
npm install -g ionic@4
-
Install dependencies
npm install
-
Browse Ionic 4 app
npm run start
-
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
|
To integrate with OpenShift mobile config please paste your configuration into mobile-services.js file