Here’s what I did to get the “ss-blink” demo app off the ground on my Mac notebook:
- no wallet needed: everything is either free (Xcode) or open source (the rest)
- make sure the Xcode command-line dev tools have been installed (gcc, make, etc)
- install the Homebrew package manager using this scary-looking one-liner:
ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"
- using HomeBrew, install Node.js –
brew install node
- that happens to include NPM, the Node Package Manager, all I had to do was add the NPM bin dir to my PATH (in .bash_profile, for example), so that globally installed commands will be found –
Not there yet, but I wanted to point out at this point that Xcode plus Homebrew (on Mac, other platforms have their own variants), with Node.js and NPM as foundation for everything else. Once you have those installed and working smoothly, everything else is a matter of obtaining packages through NPM as needed and running them with Node.js – a truly amazing software combo. NPM can also handle uninstalls & cleanup.
Let’s move on, shall we?
- install SocketStream globally –
npm install -g socketstream
(the “-g” is why PATH needs to be properly set after this point)
- install the nodemon utility –
npm install -g nodemon
(this makes development a breeze, by reloading the server whenever files change)
- create a fresh app, using –
socketstream new ss-blink
- this creates a dir called ss-blink, so first I switched to it –
- use npm to fetch and build all the dependencies in ss-blink –
- that’s it, start it up –
node app.jsif you insist)
- navigate to and you should see a boilerplate chat app
- open a second browser window on the same URL, and marvel at how a chat works :)
So there’s some setup involved, and it’s bound to be a bit different on Windows and Linux, but still… it’s not that painful. There’s a lot hidden behind the scenes of these installation tools. In particular npm is incredibly easy to use, and the workhorse for getting tons and tons of packages from GitHub or elsewhere into your project.
The way this works, is that you add one line per package you want to the “package.json” file inside the project directory, and then simply re-run “npm install”. I did exactly that – adding “serialport” as dependency, which caused npm to go out, fetch, and compile all the necessary bits and pieces.
Note that none of the above require “root” privileges: no superuser == better security.
These were installed using –
npm install -g js2coffee html2jade
And then hours of head-scratching, reading, browsing the web, watching video’s, etc.