Small demo app using Node.Js/Socket.IO/MongoDB/D3.Js and jQuery; Author: Sacha Barber; Updated: 7 Jan 2013; Section: Internet / Network; Chapter: General Programming; Updated: 7 Jan 2013
It has been a while since I wrote an article here at codeproject, so I apologize for that. I have been pretty busy doing um nothing I guess.
Anyway late last year I found a bit of spare time, so I looked at my to-do / must learn list, and sitting there glaring at me was "Node.Js" in 60ft letters. So I thought ok, why not give Node.js a try. At the time I was doing a fair amount of ASP MVC / JQuery at work, so thought now would be a good time to do this, as I kinda already had my head in the web zone at work, so it would be a good time to give Node.js a go.
So this article is me playing around with Node.js a bit, and coming up with a small demo project. The demo project is tiny as I did not want to overload people with too much, that said the choice of demo app I have made, ensures (at least in my mind it does) that by the time you have read this article you will get to learn about the following elements
FeaturesIncredibly fast - generate static files in a glanceMarkdown supportDeploy to GitHub Pages & Heroku with only one commandPorted Octopress pluginsHigh extendibility & customizabilityCompatible with Windows, Mac & Linux
One of the goals of our recently launched (and awesome!) new Flickr iPhone app was to further increase user engagement on Flickr. One of the best ways to drive engagement is to make sure Flickr users know what’s happening on Flickr in as near-real time as possible. We already have email notifications, but email is no longer a good mechanism for real-time updates. Users may have many email accounts and may not check in frequently causing timeliness to go right out the window. Clearly this called for… PUSH NOTIFICATIONS!
For quite some time I had my Raspi lying around. And some RGB Pixels as well. So it was about time to bring them together. The last couple of days I built a web interface that I can use to control my pixels. That’s more a technical demo, rather than something useful. But I learned quite a bit.
For the server part I decided to use node.js. For the client I wanted to use Angular.js and Bootstrap. To have the UI work on a mobile as well, I had to include Angular-touchevents.
The pixels are connected to the Raspi vi SPI. Although there are node modules for SPI and Adafruit pixels, they were not working out of the box. I had to poke around a bit to make them work. Changes are included in thenode-pixel repository.
I was inspired by PhantomJS and wanted something similar, but could be run inside of the nodejs environment, without calling out to an external process. PhantomJS is run as an external process that users can run under any language, however one must create a fancy glue wrapper so that development isn’t impaired. I created something that does exactly what phantomjs is capable of doing, except in a full js environment, called Chimera.
I’ve been having a lot of fun writing a little ‘re-tweeter’ this morning. We basically want to monitor our user stream and then re-tweet any status with a particular hash tag. I thought this would be an excellent little project for node, and indeed it proved to be extremely easy to do. I used the node-twitter library which worked fine for what I wanted to do.