Node.js integrated development environment… sort of

I started working on a Node.js project and so far it’s a quite satisfying experience. But what is Node.js?

Bildschirmfoto 2013-08-25 um 21.38.10

“Node.js is a software platform that is used to build scalable network (especially server-side) applications. Node.js utilizes JavaScript as its scripting language, and achieves high throughput via non-blocking I/O and a single-threaded event loop.

Node.js contains a built-in HTTP server library, making it possible to run a web server without the use of external software, such as Apache or Lighttpd, and allowing more control of how the web server works. Node.js enables web developers to create an entire web application in JavaScript, both server-side and client-side.” (Wikipedia)

There are a lot of things that are approached differently in Node. One of which is how you deal with code and debuggings.

I come from a world of fully integrated development environments. I had that for C#, it’s there for Java, it’s even there for Objective-C.

But with Node and Javascript it’s a bit different. Even the options you have like NetBeans and Eclipse are… well … Netbeans and Eclipse.

So it’s a bit like a toolbox you are supposed to put together yourself. And in this article I want to describe how a 2-week-beginners development environment for Node looks like. If you got anything to improve or add – go ahead, leave a comment!

Source Control

GIT! I am using GitX and command line git to work with the source control. Nothing special really.

Bildschirmfoto 2013-08-25 um 21.29.21

Code Editor

You got a lot of options here. May it be the awesome Sublime Text 2 or Eclipse or NetBeans. I chose Coda 2 since I already got it and was using it for my humble web development intermezzos. It’s awesome and if you’re on Mac you should give it a try!

Bildschirmfoto 2013-08-25 um 22.03.51

Debugging Node.js

Now things are getting interesting. To debug Node.js applications you have a lot of options from which a lot of them works quite good. Unfortunately I was not able to find the one IDE that provides all in one – great code editing and good debugging. So I chose to use a stand-alone debugging solution that does the trick in the best way I can think of. It’s called node-inspector and is available on all possible platforms as it seems.

It’s basically using the V8 Javascript engine built-in debugging interfaces and making them available through a local website that you can use to debug. And it really works wonders.

Bildschirmfoto 2013-08-25 um 21.29.33

Triggering and Glue

Yeah and the rest of that is a lot of shell. Having at least 4 Terminal windows open and arranged on my desktop alongside the javascript code that I am currently editing.

Bildschirmfoto 2013-08-25 um 21.29.16

There’s only one thing left right now which is hindering the code hacking and debugging. And it’s the fact that Node.js in it’s default state does not reload changed local code files after it loaded them once. And this means: When you edit something you would have to manually restart Node.js to see the changes you just made in effect. And that’s where a little tool called Supervisor comes into play. It watches the files of your project and kills+restarts Node.js automatically for you and takes care of that bugging restart-cycle. It just works!

If course there are some more things in regards of writing tests. But this is going to be another article.

Source 1: http://nodejs.org
Source 2: http://en.wikipedia.org/wiki/Node.js
Source 3: http://panic.com/coda/
Source 4: https://github.com/node-inspector/node-inspector
Source 5: https://github.com/isaacs/node-supervisor

Google Latitude is dead, long live Miataru!

I am a long time user of Google Latitude – and since I added a Google Latitude Module to h.a.c.s. almost the whole family started using this service. It’s all about tracking your location.

Google says:

“Latitude has been retired

Google Latitude was retired on August 9th, 2013. Products retired include Google Latitude in Google Maps for Android, Latitude for iPhone, the Latitude API, the public badge, the iGoogle Gadget, and the Latitude website at maps.google.com/latitude.

What does this mean for me?

  • You are no longer able to share your location using Latitude….”

We used it for a lot of use cases. If just to know if the other is en-route to a meeting-point or to know if someone arrived safely during a long trip. Or in terms of home automation to let the house know if you are there or somewhere else – for instance to enable or disable the house alarming system or to power up / shutdown the heating if necessary.

After the retirement of Latitude on the 9th of August all those use cases where not doable anymore. Yes there are some tools that do this and that for Location tracking. But when Google Latitude was still active it did not fullfil all use-cases I would have gotten – it was just “good enough”. Now all those subtitutes are not even close to a fraction of the use cases I would have.

Now what? Easy! If nothing works out, you gotta do it yourself!

So I started a new spare-time project I call Miataru. Weird name, eh?

“Miataru or 見当たる is Japanese and means “be found” or “to come across” and it’s meant to be a set of tools to allow the user to track locations and choose how to work with the data as well as how data is stored if at all.” (Miataru.com)

So – this should not be a replacement for anyone for Google Latitude. But the goal is to create a client+server toolset that allows you to cover a lot of use cases around location tracking and the interfacing with other software like home automation.

The server will be written in Javascript using the awesome Node.JS technology and some frameworks along with that. The clients will be written in a mobile client specific language – like Objective-C for iOS.

iOSAppViewsWireframeFor about two weeks I am working on implementing the server and the iOS client. If you want to take part you’re invited! Especially the server and maybe a Webinterface / Web-App will need more love from savvy web developers – certainly more than I am able to give. I am slowly learning my way into all those new (for me) technologies – diving deeper into Javascript and Objective-C was a plan for the longest time now.

So expect some articles here about all the funny things and learnings about NodeJS and Objective-C / iOS development.

Some quick words to all you readers:

If you want to participate in an open source project in NodeJS and Mobile devices you’re invited to join anytime!

Source: http://www.miataru.com