About the project

In a previous post I explained the project history, goals and involved people. Shortly saying HackDash is a dashboard where you can put your project ideas. It was specially designed for Hackatons but it was used for other purposes with really good results.

Since I received lots of mails asking how to install it in different servers I decided to make this post explaining how can you install it for yourself.

Furthermore I will explain the steps I usually do in order to install a HackDash instance using Heroku and MongoLab (you can use it for free for small projects, the free version for both services can hold a HackDash instance with an interesting amount of users and projects).

A HackDash instance screenshot

Basic Install

Installation Prequisites

HackDash is based on top of 2 open-source projects:

  • Node.js: You can install it using the install button on the home page. If you are using Linux you can build the sources or use your favorite package manager.
  • MongoDB: the downloads page will help you with the installation process.

That’s it. If you can run node.js and MongoDB, you can then install a HackDash instance.

Download the project and install the dependencies

First, download the project source. You can Download it from this link or clone the repo:

$ git clone git@github.com:danzajdband/hackdash.git

Then, inside the project folder, install the dependencies

$ npm install

Project configuration

When this process finish you’ll need to config the app. The easiest way is to copy the file called config.json.sample to config.json and keys.json.sample to keys.json.

Open your config.json file and set yur config settings.

The keys.json file allows different auth providers. You need to fill at least one of those to make your users LogIn. I want to provide email + password login for the future but now is not available at the moment.

At the moment we allow 4 different auth providers: Twitter, Facebook, Meetup and Github. Choose the services you want and fill the file with your credentials.

For example to get Twitter credentials you need to go to Twitter dev and create a new application.

Keep in mind that the callback url format is /auth/{provider}/callback while you generate the provider credentials.

Run the app

To run the app you just need to start MongoDB (the fork option is optional, it will run MongoDB in background) and init the node server.

$ mongod --fork your/log/file
$ node server.js

Then open your browser using the address you provide and will have a fully-working HackDash instance.

Deploy options

This apply to any node.js project but I left it as a good remainder (don’t forget the HackDash is not more than a ExpressJS app) some deployment good advices.

  • If you are going to deploy it in a production environment, start the script with the production flag.

    $ NODE_ENV=production node server.js

  • It is recommended to use a node script reloader. I recommend Up but is up to you. Forever is also widely used.

Make yourself the Dashboard admin

If you point your browser to yourdomain.com/install while logged in you’ll became the admin of the Dashboard. The /install route will redirect to the previous page you visited if the admin was selected before.

Installation using Heroku and MongoLab

I choose these services because I made some successful installations on this environment, and it’s pretty easy to work with.

Prequisites

  • Create a Heroku account and install the CLI.

Download and Configure

The steps (Download and Configure) are the same as the Basic installation, you’ll want to check it out above. For this type of installation I’ll ask you to clone the project instead of downloading the source tarball (It will be easy to deploy then). Once you finish configuring your project instance, this are the next steps

Create a Procfile

Create a file in the root project folder called Procfile and write inside

web: node server.js

Create the Heroku application

To create a Heroku app, follow this steps

$ heroku login
$ heroku create

Add the MongoLab add-on to the app

I choose the starter package that is free, you can select https://addons.heroku.com/mongolab.

$ heroku addons:add mongolab:starter

Then add your MongoLab URI to the config file, the url will override other db config. To get your MongoLab URI perform this command in your terminal

$ heroku config | grep MONGOLAB_URI

Commit the changes, and deploy

You need to commit the changes you made to push the files to heroku.

$ git add config.json Procfile
$ git commit -m "Heroku deploy config"
$ git push heroku master

Scale the app

If you want to use more than one process it’s cool, you just need to change the 1 in the following command

$ heroku ps:scale web=1

Logs

If you want to see the logs you can do $ heroku logs

Final notes

This is the process I usually do for both kind of deployments. If you have any questions, please contact me. The project is under development, I’ll be glad to add more people to the list of awesome contributors. Git tips are also welcome.

Comments

We live in a perfect world for open source and free software. Social networks (like twitter or GitHub at some point) connect us and offer a perfect place to work together on fun and useful projects. A cool thing about this is that you don’t have to be a Programmer in order to be a key part of a software project.

One big example is HacksHackersBA where hackers and journalists share ideas.

That was the context of the HackDash born. @blejman had an idea about a Dashboard for HacksHackersBA hackatons, and I was interested in implement that idea. If the open-source community teached me something is: “If you want to show that something is useful, just do it”.

So we started building the app hoping we can get to the Buenos Aires media party with something that doesn’t suck.

The Media Party Hackaton day came followed by a grateful surprise. Not only the people liked the HackDash implementation but a couple of coders added the improvement of the HackDash as a Hackaton project.

After the Media Party I realized that this small app is filling a real need. The Dashboard is been used now in several ways. For example by Node.js Argentina meetup, HacksHackersBA, La Nación DataFest and HackasHackersCL (using it as a Wordpress theme).

Now we are working on our free time for a new version of the web app and looking for more contributors. Feel free to contact me.

Comments

I had the pleasure to be invited to talk at the 2nd node.js Argentina meetup about ExpressJS. Because most of the attendees are starting with node the main idea was to introduce some important aspects about this llibrary and the motivations about express.

After a review of the most popular node.js web framework, I introduced Components, a brand new package manager for client-side components.

Here are the slides for the presentation

Comments

I’ve been working on Tuiter. This new release count with two major features: Automatic Reconnection and Gzip compression.

Automatic Reconnection

Streaming API connections are incredible powerful and it’s very common to keep those connections open all the time. The thing is Twitter closes valid connections very often because of:

  • Duplicate clients logins (earlier connections terminated)
  • Hosebird server restarts (code deploys)
  • Lagging connection terminated (client too slow, or insufficient bandwidth)
  • General Twitter network maintenance (Load balancer restarts, network reconfigurations, other very very rare events)

Following the Twitter Team recommendations I made this simple Automatic reconnector for the library.

Gzip compression

Twitter give us the oportunity of reduce the streams to 1/5 size using Gzip-formatted data via Accept-encoding header. Using the header and uncompressing with the help of the node.js core module ‘zlib’ now all API calls are performed with this format.

State of the art

For the next release I want to improve the performance of the library and the parameters pre-processing. Don’t forget to Fork me on gitHub!

Comments

I’ve been working on this node.js twitter library called Tuiter (That’s how Twitter sounds in spanish). I think it’s mature enough to release the first stable version of the module.

Features

For usage and installation steps you can go to the README. This are the most important features:

  • All API methods available (for Search, REST and Streaming APIs)
  • Params preprocessing: Locations as {lat: num,long:num } arrays, allow array params
  • API HTTP Error handling
  • Paging for REST API
  • Custom results for Search API

Demo

Few weeks ago I deployed a demo on Heroku using Tuiter, Google Maps, Socket.IO and ExpressJS. This is just an example of the power of the twitter Streaming API. Can’t wait to see your own demos/apps!

State of the art

I’m working on automatic reconnection for the Streaming API calls for a next version. Another feature I want to add is the possibility to filter by location names (like “Buenos Aires” or “Asia” instead of bounding boxes). Stay tuned.