Working With Microapps
About Microapps and Predix Development
Microapps are typically single-page Web applications with GUIs that address specific tasks to produce results. For example, you can create microapps to register users for training, or report system status or device space allocations.
With AppHub, you can combine microapps into a unified UI with a single point of entry. You can use the provided microapp reference applications to easily start building microapps using Node.js. Additionally, you can load any existing microapps into the AppHub content area. AppHub includes the index.html
for each microapp in the content section in its template, and proxies any further resource requests directly to the microapp itself.
Microapp Approach
- There are global state changes (such as going offline in a real time application) .
- There are delayed results from AJAX requests that get returned at some point from back end operations
- There are changes to the Model function as values change.
- There are Domain Object Model (DOM) events that cause small state changes in the View function.
- There are changes to the Controller function that cause state changes in the View function..
The microapp approach implements a conventional single-page application as a suite of microservices. Microservices are atomic, self-contained services that typically perform a single operation on a back-end system, such as a retrieving a customer record.
This means that microapps provide a range of capabilities that can be focused on specific tasks. For example, end users benefit from a View function that is tailored to their specific requirements.
Using Custom Microapps
You can create your own custom microapps or port existing microapps and easily integrate them with AppHub.
About This Task
Before You Begin
To complete the following steps, be sure to log into the same Cloud Foundry environment you used to create your UAA and AppHub service instances.
Procedure
What To Do Next
You can now configure your microapp to AppHub. For more information, see app-hub-microapps.html#concept_9af7d6de-1a30-46cd-a9f6-9572c8444679.
About AppHub Microapp Configuration
After you create microapps, you must perform a few configuration tasks to associate them to your AppHub service instance.
You can choose to use ARCS (App Registry and Configuration Service) or a different configuration service to associate your microapps to your AppHub service instance. To make configuration requests, you use RESTful APIs for ARCS or your selected configuration service to configure microapps, tenants, themes, retrieval tokens, and so on. When you use ARCS as your configuration service, you can also make configuration settings by using the Settings microapp.
ARCS provides you with the ability to:
- Configure and persist microapp information.
- Configure and persist tenant configurations, for example, UAA, app name, logo, custom headers, themes, and so on.
- Configure and persist microapp-to-tenant mapping.
- Configure and persist microapp navigation information.
- Configure and persist preferences.
- Configure and persist details to retrieve user information.
- Create users for UAA instances at the tenant level.
- Map microapps to users or groups.
- Grant or restrict microapp access at the tenant level.
Adding and Configuring Microapps
The Settings microapp, a UI that you can use to configure services via ARCS, will be available with the GA release of AppHub. With the beta release of AppHub, you can use ARCS from the command line or import a dedicated Postman collection to add and configure microapps.