Skip to content

Installation

Will Thomson edited this page Nov 21, 2019 · 14 revisions

Installation guide

Installing

  • Clone the repo: git clone https://github.com/openmsupply/mobile.git.
  • Setup local node environment as specified in .nvmrc: nvm install && nvm use.
  • Install/update app dependencies: yarn install. Note: this process can take some time, be patient!

Running mSupply mobile

  • Connect a physical device or start an Android emulator. Check the device is running with adb devices (if the adb daemon is not running, start it with adb start-server).
  • Run react-native run-android (react-native run-android && react-native log-android for logging)
  • See below for instructions on connecting to an mSupply server.

Building from source

  • To build mSupply Mobile from source, you will need a signing key from a Sussol insider.
  • Copy or move the release key to the ./android/app directory, e.g. mv my-release-key.keystore ./android/app.
  • Build the mSupply Mobile APK: yarn install && ./android/gradlew assembleRelease.
  • The mSupply Mobile APK file can be found at android/app/build/outputs/apk/app-release.apk.
  • For more information, see the official React Native documentation for generating signed APKs.

Setting up the mSupply Server

  • Ensure you are running mSupply version 3.6 or higher.
  • An example data file is hosted on the official mSupply Jottacloud account. Sync site name, sync site password, mobile store user's name, and mobile store user's password are all "Mobile".
  • A custom data file can be configured like so:
    • Each mobile store must be provided with own sync site.
    • On the primary server
      • Each mobile store should be set as a Collector store on the primary sync site (ID 1).
      • Each mobile store should be set as an Active/Collector store, with local checked, on its own sattelite sync site.
    • The name associated with each mobile store should have the central store selected as its Supplying Store.
    • Users who should be able to log in to the mobile store need to have that store set as their default.
    • The name associated with the central store needs to have each mobile store set as visible.
    • Each mobile store needs to have the central store set as visible.
    • Appropriate item visibilities need to be set for the store.
    • The store's customers need to be added centrally.
    • Master lists need to be set up for each store and its customers.
    • The central supplying store needs to have its preference for supplier invoices made from stock transfers to be set to 'On Hold'.
Connecting the App to the Server
  • When the app is run for the first time, you will be presented with a login screen containing three fields.
  • In the first field, enter the IP address of the computer running the mSupply server in the following format: http://server_ip:server_port (or enter an URL if the server has one set up). If using an emulator to access an instance of mSupply running on the local device, server_ip = 10.0.2.2.
  • In the second field, enter the sync site's name.
  • In the third field, enter the sync site's password.
  • Press connect to begin the one-time-only initialisation process, which will retrieve all relevant data from the mSupply server (this may take several minutes).
  • When this has completed, you will be presented with the user login screen. When using the app from now on, you will be presented with this screen.
Using Realm Browser

mSupply Mobile uses Realm for local storage of mSupply data. Realm Browser is a useful debugging tool for viewing and editing Realm databases.

  • Download Realm Browser here.
  • Run chmod +x ./dev_scripts/get_db.sh && ./dev_scripts/get_db.sh. A copy of the default.realm database should now be placed in the ./data directory.
  • Open default.realm using the Realm Browser.

Deployment

Setting up a Tablet for Deployment
  • Turn off auto-complete and auto spacing in tablet keyboard settings. Stops user errors that this causes (i.e. sneaky space in user name)
  • If there is playstore, turn off auto-update when on wifi. This will stop you pulling your hair out when it queues up 30 updates. (It will need to have an account configured)
  • Install SureLock app on the device. This will make only show mSupply app on the Tablet. -> Choose the multiple app option. And disable the little screen that appears.
  • If you have been testing, clear app data from mSupply Mobile
  • Make sure that the correct app version on the tablet. You CAN check this remotely via sureMDM, it will show the version of the app installed under "Apps" on the right for any selected tablet
  • Make sure SureLock is active when ever not using the tablet
  • If using a sim card for data, set up an APN appropriately for the mobile service
  • If upgrading an old site from the old mobile app, make sure that all invoices (customer and supplier) that not finalised ARE finalised. In new mobile "In Progress" customer invoices automatically adjust stock, so if they were to be deleted it would add stock. Supplier invoices would add stock if someone using the app finalised them. Allowing this possibility just opens doors for stock count inaccuracies
Clone this wiki locally