Giter Club home page Giter Club logo

openmrs-contrib-atlas-node's Introduction

openmrs-contrib-atlas-node

OpenMRS Talk OpenMRS IRC OpenMRS Telegram devDependencies Status Dependencies Status

OpenMRS

OpenMRS Atlas 3.0

Description

OpenMRS-contrib-atlas-node is the server code written in nodejs for OpenMRS ATLAS. This project includes migrating the server side code from PHP Laravel framework to Nodejs, Making the Backend RESTful and authenticating the app against OpenMRS ID

Setting Up

Prerequisite

  • Install nodejs

  • Install nodemon globally(if you need it)

    npm install -g nodemon
    
  • Install the latest mysql

SetUp repo

  • Clone the repo

    $ git clone https://github.com/ShekharReddy4/openmrs-contrib-atlas-node.git
    $ cd openmrs-contrib-atlas-node
    
  • Install the dependencies

    npm install
    

Populate the DataBase

  • Create a database

    mysql> CREATE DATABASE atlas;
  • Switch to the 'atlas' database

    mysql> USE atlas;
  • Clone the sql script file

    $ git clone https://gist.github.com/f15353ca4bdbb0677b049d4ab1555cdf.git
    
    $ cd f15353ca4bdbb0677b049d4ab1555cdf
    

    copy the path of the atlas.sql file.

  • Run the sql script file (Note: there are multiple ways to run sql script file )

    • WINDOWS OS

      mysql> SOURCE : path_to_the_atlas.sql
    • UBUNTU OS

      • Navigate to the directory where in sql file exists, in terminal

        $ mysql -u uname -p dbname < atlas.sql;
        

Configure the app as per your DB credentials and PORT

  • change the credentials in db.js

    set the variables to your credentials
    
        host     : 'localhost',
        user     : 'root',
        password : 'root',
        database : 'atlas'
  • change the port(if needed)

    The following changes to be made here

      var port = normalizePort(process.env.PORT || '3001'); //change the port number
    

SetUp the OpenMRS ID

I have written a mockID whose mechanism is similar to the OpenMRS ID. Follow the instructions in the README of atlas-mockid-node to get the setup of mockID locally.

Run

  • Navigate to the project root directory and run the nodemon

    $ nodemon
    
  • Fire up your browser to check http://localhost:3001 (URL may change as per your config above )

Note

  • Always pull the latest changes.

    $ git pull upstream master
    
  • Make sure that the ports hosting openmrs-contrib-atlas-node server and atlas-mockid-node server are unoccupied(I recommend not to change any port number, in case if they are occupied by any external server please stop them)

Code Structure

public/ This directory contains js,css,images and lib files
routes/ Contains all the routes
views/ Contains all the front end code
bin/www.js Contains the script for creating and running the http server
app.js Creates an express app and holds all the middleware e.g auth middleware
package.json Manifest file used to manage project dependencies.

Contribute

  1. Fork the repo.

  2. Clone the fork to your machine.

  3. Make changes in required files, reload the browser to verify the changes.

  4. Squash the commits and Create a pull request.

External Links and Useful Resources

openmrs-contrib-atlas-node's People

Contributors

shekharreddy4 avatar agbilotia1998 avatar

Watchers

James Cloos 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.