Giter Club home page Giter Club logo

openmrs-contrib-modulus's Introduction

MODULUS

A repository of add-ons for the OpenMRS platform. This repository contains the backend of the OpenMRS Modules directory at http://modules.openmrs.org.

QUICK LINKS

API Documentation: Browse the API Docs

Frontend UI Application: Modulus UI

Design and Discussion: Modulus on OpenMRS Talk

Dev Environment Setup Guide: How to install Modulus and Modulus UI (covers setting up a Modulus server, OpenMRS ID OAuth, and the Modulus UI frontend)


Modulus provides a data model and a REST API for representing OpenMRS modules. Modulus UI is developed separately, and provides the front-end web application that consumes this REST api.

Building

To prepare a dev environment:

  1. Build requirements: MySQL, Java EE JDK >= 7. You may experience problems running on a server with less than 2GB RAM.

  2. Install Grails 2.3.7. gvmtool is the simplest way:

     $ gvm install grails 2.3.7
    
  3. Clone this repo:

     $ git clone https://github.com/openmrs/openmrs-contrib-modulus.git
     $ cd openmrs-contrib-modulus
    
  4. Create a MySQL database:

     $ mysql -u root -p -e "CREATE DATABASE modulus"
    
  5. Configure Modulus. Modulus looks for config files in ~/.grails/modulus-config.groovy, /opt/modulus/modulus-config.groovy, or in the classpath. It will also look for .properties files in the same locations. Custom config locations can be passed with -Dmodulus.config.location=CONFIG_PATH as a run argument. See example config file below.

  6. Run grails. The final command will start a dev server:

     $ grails clean
     $ grails refresh-dependencies
     $ grails run-app
    

NOTE: Modulus only provides the back-end and REST API of the OpenMRS Modules application. To get an actual web interface for Modulus, build and install Modulus UI.

OAuth

To sign in to Modulus and Modulus-UI, you need an OAuth key with an OpenMRS ID server. You can set up a local ID server, or request a key from the server at id.openmrs.org.

Once you have this key, add it to your modulus-config.groovy file via the oauth.providers.openmrsid object. See example below:

Example modulus-config.groovy:

grails.serverURL = "http://localhost:8080"
modulus {
       uploadDestionation = "/tmp/uploads"
       openmrsid.hostname = "https://id.openmrs.org"
}

// OpenMRS ID Provider. These keys correspond to keys issued by your OpenMRS ID server.
oauth.providers.openmrsid = [
        api: OpenMrsIdApi,
        key: "YOUR_OAUTH_APPLICATION_KEY",
        secret: "YOUR_OAUTH_SECRET",
        successUri: "${grails.serverURL}/login/success",
        failureUri: "${grails.serverURL}/login/failure",
        callback: "${grails.serverURL}/oauth/openmrsid/callback",
        scope: "profile"
]

// Modulus UI Client. These keys must be known by a Modulus UI client to connect.
grails.plugin.springsecurity.oauthProvider.clients = [
        [
                clientId: "YOUR_CLIENT_ID",
                clientSecret: "YOUR_CLIENT_SECRET",
                registeredRedirectUri: ["http://localhost:8083/auth-success.html"],
                additionalInformation: [
                        name: "Local Modulus UI",
                        preApproved: true
                ]
        ]
]

Project Resources

openmrs-contrib-modulus's People

Contributors

elliottwilliams avatar enymuss avatar bmamlin avatar djazayeri avatar squiddev avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.