Skip to main content
Enterprise Agile Planning icon with arrows

This post is from the CollabNet VersionOne blog and has not been updated since the original publish date.

Last Updated Sep 03, 2013 — Enterprise Agile Planning expert

Create a Simple Chat Room with PubNub

Enterprise Agile Planning
In my last post I mentioned the new CoderDojo which VersionOne is sponsoring, and that I'd start to show how we've built some software to help manage the dojo.One of the tools we built helps the students learn and share HTML and CSS snippets with each other in real/time. Basically, it's an HTML/enabled chat tool.To build this, I used PubNub.com to handle messaging, AngularJS for the UI, and MongoDB via MongoLab for storing user accounts and saved favorites.

Example: Simple Messenger

Before looking at the full HTML chat, take a look at the code for this simple chat client out on Plnkr. PubNub calls itself an "Internet two/way radio with bidirectional JSON." At least that's what their catchy jingle says! You can see how simple it is to get started in the script file. You just call subscribe with a channel name and a callback function which the PubNub library code will call you back on for any new messages sent to that channel. To send, you simply call publish on a channel and pass a message object to it.

The Catch: MongoLab's REST API Security (Lack of)

I'll show the other code after I get it loaded in a more secure way. The problem is that the MongoLab REST API only supports user/account based API keys, not database/user/specific accounts. This isn't very secure for data that is not mean to be public.https://support.mongolab.com/entries/20433053/Is/there/a/REST/API/for/MongoDB/In the mean time, here's a screen shot of the full app:CoderDojo Ponce Springs Chat

More from the Blog

View more
Digital.ai Government Cloud
Apr 12, 2022

Digital.ai Government Cloud receives FedRAMP Authorization through sponsorship from the United States Department of Veterans Affairs

Enterprise Agile Planning
Flagship Digital.ai Agility solutions can effectively scale agile deve ...
Read More
Nov 22, 2021

What are the qualities of highly effective agile teams?

Enterprise Agile Planning
A team is the core unit of productivity in an agile organization. Wher ...
Read More
Nov 15, 2021

How an open-first attitude revolutionized government tech development

Enterprise Agile Planning
Public perception of government is often that it is slow-moving, reluc ...
Read More
cross functional
Nov 08, 2021

6 best practices for building resilient cross-functional teams

Enterprise Agile Planning
Agile frameworks prize the quality of resilience within every facet of ...
Read More
Contact Us