Like this:

ATLAS 3.0

OpenMRS Atlas

The OpenMRS Atlas is a website on which members of the OpenMRS Community can register their site(s). The Atlas serves not only to let the world know about your site but also help sites to discover other implementations in their region.

About Atlas 3.0

OpenMRS Atlas Server (openmrs-contrib-atlas) was designed to be a RESTful backend and a JavaScript client frontend – i.e., the server is concerned only with providing a RESTful API and Authentication and the JavaScript frontend uses Google Map API to do all of the UI.

The technologies used here are outdated which makes the code more complex, So the community decided to rewrite the Atlas server which provides truly RESTful API using Node.js. Atlas 3.0 is the server side code for OpenMRS-Atlas which presents simple RESTful API written in NodeJS.

SUMMARY OF THE WORK DONE

RESTful Backend.

Now the server side code is RESTful which serves the endpoints for the resources (markersites, distributions).

Authenticating the Atlas.

I have explained more about authentication of an app against OpenMRS ID in my blog. I have to roll out my own library which encodes and decodes the multipass token which is sent by OpeMRS ID through the URL

Changes to the templates in the frontend and BUGS

Since the Atlas server code is written in PHP Laravel framework which uses Blade template engine in the front-end code to render the GoogleMapAPI so the code was a mix of PHP and HTML. I refactored it replacing blade.php files with the EJS template engine.

Useful Resources and Links:

Throughout the summer, I have learned a lot of new technologies like NodeJS, Express and this is not possible without my mentors and the active community members. I feel really blessed to have such responsive mentors who are always active on forums.

I express my deep regards to all of you. In the coming days, I will contribute to this project and successfully release it and I am Leading the daily scrum meets on IRC!!

Regards

Shekhar Reddy 🙂

Share this:

Like this:

Hello, Time is flying and I feel indebted for this organization for providing such a great opportunity and I would like to thank my mentors Jan and Pascal for the guidance and whole community members for the support. I will work for this org post-GSoC and release the Atlas 3.0 soonish.

By the way, I am leading the scrum meets these days you can check them here.

Creates an express app and holds all the middleware e.g auth middleware

package.json

Manifest file used to manage project dependencies.

What does each directory contain? :

package.json
This file consists all the details of the dependencies, dev-dependencies, semantic version, etc.. which shows the state of the application.

app.js This file is the start of the application where an express app holds and uses all the middleware. The middleware that we use is here.

bin/www.js Contains all script which creates the HTTP server on a mentioned PORT and starts the server once we start the server.

views/This directory contains all the template files which are generally the front-end part which uses the JS, CSS, Images and all resources from the public/ directory.

index.ejsThis project uses .ejs template engine for the views. The index.ejs file will render the google map API and the javascript from the public directory.

error.ejsThis file is a standard error file which can be rendered whenever an error is thrown so as the user knows what type of the error is that.

public/This directory consists of all the resources like JS, CSS, Images etc..

CSS/contains all the CSS files which are used in the template engine.

js/contains all the javascript files which are used in the views.

images/contains all the images.

routes/routes dir contains all the route files each denoting a resource wherein the endpoints are defined. The resources that we have.

distributions.jsThis file consists the defined endpoints for the distributions like one can create,update and delete the distributions.

authentications.jsThis file consists the defined endpoints for the authentication.SSO decoding and logging the user –all that is related to auth resides here.

markersites.jsThis file consists the defined CRUD operations for the markersites.

Authentication

I have written a library for authentication which can be used by anyone who wants to authenticate their app against OpenMRSID. This library can encode and decode a multipass token so that we could access the user details in the app and log the user.

In Atlas, we decode the token and put the user details in a session and use the session wherever we need the authentication. For detailed view of the code: Link

Functionalities

Atlas 3.0 doesn’t alter any functionalities that were in the older version of Atlas.

Share this:

Like this:

In the previous blog post, I mentioned about the mechanism to authenticate a site against OpenMRS ID. To authenticate a user the atlas and OpenMRS ID uses a pair of keys by using which the token can be easily decoded. –the process is

This mockup explains it better :

A typical SSO strategy:

And for OpenMRS Atlas :

The blocker that I have mentioned in the title refers to writing the library which decodes the token. I thought that with some existing third party library we could achieve the same but that didn’t turn up. So I have to write a package which serves our need.

Next post is on how decoding and encoding do by the library which will be ready soonish.

The share-url button have come up and working as i was expecting. Researched a bit regarding the models in REST.Coming to authentication part, which I am hoping to complete by this week. Since the front-end code was a bit complex and poor documentation have affected the progress.