Tuesday, April 30, 2013

Open sourced nodejs web apps - missing the best practices

While it has been obvious that people open source modules, in every single language, the idea that when you write a deployable web (or mobile or cli) app you should be
 - open sourcing it
 - link the app with the open source code of it
is much less discussed.

Here are a few examples
1 npmjs.org -> https://github.com/isaacs/npm-www
travis-ci.org -> https://github.com/travis-ci/travis-ci

3 liftie.info -> https://github.com/code42day/liftie

The practice is so uncommon that there aren't "best practice" guides for this, "this" being not the writing of the web app itself but the open-source process:


- What should I include in the public repo and what should I not include?
- Should I add an overly visible link from the deployed site to the code (fork me at github) or should I leave it for people to search and find the source.
...This is a very important point - equivalent to package your open source with the binary in the old GNU inspired days..
I often find a site that has a feature/functionality I want - but I want to make it a bit different. The site seems to be written by someone with open source ideology (e.g. 1,2,4 above). So how do I find the source?
I google "github <domain>" and if that doesn't work I typically give up.

Note that googling link:liftie.info finds no results even though the github repo is pointing to the site as its web url. Either google is increasingly screwing up its advanced options or github doesn't expose this well for search engines...
And I don't think that there is a "registry" for open source apps of sorts. You cannot find npmjs.org's code in npm (I am guessing that...haven't really looked)


Anyway but that is just one type of "best practices". What do you do about the data? For example in the modulecounts  site above the author has opted to put in the DB the regexpressions/urls that extract the counts from the registries... Thats a good part of the logic. Luckily he has checked in the db migration folders as well !!! which gives access to everything one would need. But there is more.
Lets say I want to take modulecounts and just write it in nodejs for the fun of it. Or even more I want to add some of the charts that Mikeal pointed out in his post, that show growth or proportion growth.. To do that I would need the actual historical data that the service has collected.
It would be nice to have that. Modulecounts again did the right thing and gives access to the csv in their  web site! But of course the app shouldn't/couldn't share private user data...

Another area of "best practices" is dependencies and testing 
It would be nice for the web app to have a test suite and travis-ci integration.
We would be able to create dependency graphs not just for modules but for actual apps!
It would give tremendous test coverage for all the module writers to confirm the validity of their changes . 

In general as I have said in an earlier post we need best practices that allow us to produce truly open apps. And we need people that are influencers to start following the practices and publish their apps as well (and not fear that by doing so they risk losing their userbase to someone else ) even if the apps are "for profit" apps.


No comments:

Post a Comment