Container Dev-Pack

To Develop application run the Dev-Pack containers set. It is required to generate html and js codes after changing jForm file.

It includes:

  • Aperio-Tool to generate mobile apps. This container is run on local laptop.
  • Aperio-Client to run your mobile apps for testing. This container is run on local laptop.

Note: Dev-Pack uses API Bridge to communicate with Aperio APIs on the backend. During development programmers usually use an already existing API bridge. There is required just to provide http address of existing API Bridge.

Prerequisites

  • Have the mobile app sources you want to work with cloned in a local folder, e.g. “C:\MobileAppsDev\jfexamples-erp-12”
  • Read README.md file with instructon how to develop this specific app
  • Docker desktop app installed
  • Run Docker desktop and go to: Configuration –> Resources –> File sharing. Add local folder where You cloned mobile application to the list of file sharing directories.
    • tip: Add root folder for all cloned git repositories to avoid configuring file sharing for each individual application.
  • Make sure You have access to Iptor PD images registry. You must be logged in. If you are not logged in to Git repository, login with command:
cat "<file-where-you-keep-image-registry-key>" | docker login -u iamapikey --password-stdin de.icr.io/ipt-eu-fr-dev-dc1

Example:

cat "C:\gitRepos\image-registry\key.txt" | docker login -u iamapikey --password-stdin de.icr.io/ipt-eu-fr-dev-dc1

NOTE: If you do not know the image registry key enter ticket to Helpdesk" helpdesk@ibs.zendesk.com. Ask for API key for image registry. You only need read access. After You receive your API key, store the value in text file somewhere on your PC. You will use it whenever would like to login to image registry.

  • make sure you use the most recent images. Re-pull them if needed:
    • de.icr.io/ipt-eu-fr-dev-dc1/aperio-tool:the-image-tag-in-compose
    • de.icr.io/ipt-eu-fr-dev-dc1/aperio-client:the-image-tag-in-compose

TIP: If you do not know if your local copy of images is fresh, run docker on your machine then go to images section and delete listed above images. Then they will be pulled next time when you run containers.

TIP: Go into compose.yml file to see which image tags are used to develop your mobile application.

NOTE: To be possible to generate html/js, the app should contain develop.json file present in develop folder. The develop.json file describes its development profile (e.g. default ERP environment and company used to get metadata). Adjust develop.json file if needed.

Example of develop.json file.

[
	{
		"environment": {
			"name": "DEV121A",
			"params": {
				"companyCode": "DV"
			}
		}
	}
]

Configuring containers

To be possible to develop Mobile App you need to preconfigure containers. To do so you need to copy example.env into .env file. Then change .env file. See explanation of variables inside .env file.

NOTE: Most variables are preset for you in example.env file.

Starting/Stopping the containers

Run docker compose.

docker compose up -d

To stop containers, you can simply remove containers using Docker UI, or run command.

docker compose down

Running & testing mobile application

When the development pack containers are running, use the following links to test and start application:

NOTE: By default, your application is served under port: 8081

  • Example: To run mobile application from Dev-Pack: http://localhost:8081/aperio/app?name=jfexamples-erp-12

  • Example: To run mobile application from Dev-Pack in develop mode: http://localhost:8081/aperio/app?name=jfexamples-erp-12&develop=true

Developing mobile application

If Dev-Pack is running, it automatically generates html/js after corresponding jForm files are changed and saved.

NOTE: We recommend using develop mode link to application (containing develop=true in url)/ Because then the form is refreshed every time is loaded. You do not need to restart application to see changes.

NOTE: Some changes in application may require restarting Dev-Pack. Follow instructions for Stop and Start containers.

NOTE: Some changes generated by Aperio tool are visible in the application only when you close browser tab and go to the application link once again.