Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Info

Bahmni Connect front end is completely based off AngularJS. It doesn't have any server component to it. Instead, it calls the REST API of OpenMRS/Bahmni.


AngularJS requires the following tool tree installed on your development machine.

  • Xcode (only for mac)

  • Ruby

  • Node and Node Package Manager (npm)Global node modules - bower, grunt, compassv10.11.0

  • Yarn
  • Project specific node modules

  • Bower project components

Use following instructions (the exact mechanism for doing step 1 would depend on the OS you are using, we have mentioned for mac).

  1. Install Xcode and npm
  2. Install the following modules required globally (This is a one time task)

    Code Block
    languagebash
    npm install -g bower
    npm install -g grunt-cli
    gem install compass


  3. Checkout the bahmni-connect repository on GitHub

    You would have to run the following commands for Bahmni Connect front end project. Run these commands from the ui folder under Bahmni Connect front end project

    Code Block
    languagebash
    # Install node dependencies (Installed node dependencies into node_modules). npmUI installdependencies #are Setinstalled up UI component/dependencies (This installs all the UI dependencies intoin node_modules/@bower_components and create a soft link to app/components).
    boweryarn install


  4. Checkout the bahmni-offline repository on GitHub. (Only require for android app)
  5. Run this command from Bahmni connect front end project folder for creating a symlink into your vagrant /var/www:

    Code Block
    languagebash
    # links dist folder
    ./scripts/vagrant-link.sh


...

  • To bundle PWA, run the following commands from ui folder under Bahmni Connect front end project

    Code Block
    languagebash
    # To genearte css files
    gruntyarn compass
    
    # To minify and bundle PWA related source code
    gruntyarn chrome
    
    # To generate service workers files
    gruntyarn generate-sw


    If you want to debug Connect PWA on your local machine, you should run "grunt yarn devchrome" which will put unminified js files onto the "bahmni-connect/ui/dist/" location.
  • To run only tests related to PWA run the following command
    Code Block
    languagebash
    grunt karma:chrome
    To access bahmni-connect apps on chrome hit https://<host name>/bahmni-connect


Android App:

  • Checkout the bahmni-offline repository on GitHub. (Only require for android app)
  • Follow the steps recomended in recommended in the README.md file of bahmni-offline project
  • To bundle Android app, run the following commands from ui folder under Bahmni Connect front end project

    Code Block
    languagebash
    # To genearte css files
    gruntyarn compass
    
    # To minify and bundle android app related source code
    gruntyarn android


  • Copy dist folder of bahmni-connect/ui folder to bahmni-offline/android/www/app
  • Run the following command from bahmni-offline/android to install the android app on the device (The device should be connected to the system).

    Code Block
    languagebash
    ionic run android

    To run only front end tests related to android run the following command

    Code Block
    languagebash
    grunt karma:android