Over a million developers have joined DZone.

Integrating MongoDB With Reappt: Part II

Here is Part II of Reappt's article on integrating MongoDB with Reappt. Don't forget to go back and read Part I if you missed it.

· Mobile Zone

Read our latest eBook to learn the features of JSON and why it's become dominant for web-based integration. Brought to you in partnership with Reappt.

In a prior post, How to Integrate MongoDB with Reappt, we discussed how Reappt’s JSON topics dovetail with MongoDB’s JSON documents, and how in turn a MongoDB collection can be reflected as a branch of JSON topics. This approach gives the end consumer a means of subscribing to a MongoDB collection and changes to it. Additionally, it makes the information easily available to smartphones and web browsers, who are likely far removed from your MongoDB server.

Making Things Interesting With Real Data

In our the prior blog, we created 100 Mongo documents to test the system out. This time, we’ll use real data to make things more interesting, and draw on the real foreign exchange data free available from TrueFX.

This standalone script polls the TrueFX service every 500ms, and gets real prices for a handful of currency pairs. The service is free, and registration gets you more than the basic set of currency pairs.

Visualizing the Data

You can use the Reappt Console to prove that the system works, but here we have had a little more fun and built a desktop GUI to visualize the FX prices using Electron from Github. Only recently released (May 2016) Electron combines the best of the Chromium & Node Javascript worlds to empower developers building desktop apps with web technologies. Our client ran to 184 lines of code and looks like this:

Visualising Data

As prices rise and fall the tables cells flicker red and green. Web development is very far from my forte, nevertheless, I was greatly impressed at how quickly a project could begin and get off the ground. The Electron name is a great piece of wordplay, being the ‘shell’ within which GitHub’s ‘Atom’ project exists. Keep on punning and developing guys, it’s only version one and it’s already looking great!

Let’s have a look at it all in action in our short video:


A Quick Summary

This blog began as a vehicle to explore the JSON features in Reappt and any challenges encountered connecting it to something else, but has grown into something more ornate drawing in real data, and visualizing it a familiar manner:

Demo Architecture

We encountered essentially zero issues handling the JSON between MongoDB and Reappt. Using JSON made it trivial to populate MongoDB with data delivered as CSV, and the JavaScript environment inside Electron made is trivial to build and update an HTML table from the delivered JSON.

Read our latest eBook to learn the features of JSON and why it's become dominant for web-based integration. Brought to you in partnership with Reappt.

Topics:
features ,mongodb ,data ,topics ,json ,exchange ,collection ,reappt

Published at DZone with permission of Martin Cowie, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}