Libraries, frameworks and environments.
In our case we are gonna use Express.js. Express.js is a Node.js web framework based on Sinatra. It’s very easy to start with it and that’s the reason why I’m gonna use it.
- Jade. It’s a Node.js template engine ‘heavily influenced by Haml‘ that help us to write HTML5 code in a efficient and smart way. We are writting our HTML5 pages using this template engine. What we are going to do is create a layout from where other pages are going to inherit some configuration.
- Less. It’s a dynamic stylesheet language that provides us a way to create CSS3 very easily. With it you can use some concepts like variables, inheritance or mixins in your CSS3. There are some other dynamic stylesheet languages out there like SaSS or Stylus (you cand find a nice comparison here).
- Twitter API. Provides REST support to get any data we want from Twitter. For our application we need to use to resources URL:
- Get search. We are interested in getting tweets regarding some topic we can search for. You have to add a query parameter to the URL in order to look for specifics tweets within Twitter.
- Get users/show. We need to indicate to the user_id parameter the user’s id from who we want to extract some information such location or screen name.
- Yahoo API. Yahoo probably has the better API along Google in order to use its services. There are some many services you can use with it. Some of them were explained in a previous post. In this project we are going to use:
To use the Twitter API we don’t need to posses a developer key, but we have some limitations in the users/show services (we are restricted to use more than 150 request per hour). In the case of the Yahoo API we need to sign up in order to get a valid App identifier.
Deploying our application.
Well, so we want to develop our application and test it in our local enviroment and after that we want to deploy it to the cloud. I’ve choosen some PaaS in order to upload it.
- Heroku. Heroku is a PaaS (Platform as a Service) that is built to upload your application to the cloud. Besides that it gives us many services (NoSQL, Message Queue services and so on) to make our applications better. You need to sign up to get an account. Fortunately, there is a special account where you can upload your application for free.
- Cloud Foundry: Cloud Foundry is a PaaS created by VMWare quite similar to Heroku. It has support for several development stacks (JEE, Ruby or Node.js). As with Heroku it gives you some services (not as many than with Heroku) to your application. You can sign up for a free acount here.
- Amazon Web Services. Both Heroku and Cloud Foundry can be consider PaaS, but with AWS we are talking about Iaas (Infrastructure as a Service). With AWS you have a machine (an instance) where you can install, deploy or use any stuff you like (a node.js application in our case). Althought, it’s quite easy to start with Heroku or Cloud Foundry than AWS I want to try AWS because it’s the base from some PaaS (Heroku uses AWS for example). We are using Amazon Elastic Compute Cloud (Amazon EC2) to deploy our application to the Cloud.
A few words about the project.
The project is quite simple. We want a simple HTML5 page with a text field and a search button. We write a work in the text field and we will look for tweets relating to that word in Twitter. Besides that we will show some extra information of it and use leaflet to present it. Easy, isn`t it?. I’ll explain in the next write up how to develop it.
You could be interested in reading the other posts:
- Basic Node.js and Backbone.js application I
- Basic Node.js and Backbone.js application II
- Basic Node.js and Backbone.js application III. Cloud deployment to Cloud Foundry, Heroku and AWS
- Basic Node.js and Backbone.js application IV. Redis and Socket.io support