Get QuickHubApp GitHub OS X client for free

Apple 12 days of Christmas are over and it is my turn to give some copies of QuickHubApp GitHub OS X client for free.

In order to get a promo code, you have to Tweet something like:

Have a look to http://wp.me/pcSx0-nn to get a free copy of QuickHubApp @github OS X client (cc @chamerling)

or something more creative which contains ‘QuickHubApp’, ‘http://quickhubapp.com’, and ‘@chamerling’.

To receive the promo code, you also have to comment this article with the reference to your tweet. Put your email address in the form so I can mail you the code directly within the next days. First ten comments will get a free version.

Simple HeartBeat Manager with Play

One more time, one more tiny (and maybe useful in some cases…) application with Play!.

WTF, my server is dead again!?

This app is a simple heartbeat manager looking at remote HTTP services and notifying you by email when something becomes unreachable. It uses the background Job feature of the Play framework and just does HTTP GETs on the specified list. That’s all, that’s simple, but that’s can be useful sometimes…

The code is located at https://github.com/chamerling/heartbeat-manager

OAuth and Desktop Apps

I started to develop QuickHub some weeks ago by focusing on features and without taking into account security issues such as this critical information which are login and password credentials… As mentioned in the GitHub developer pages, I started to use Basic Auth for all the requests QuickHub does to get retrieve data from GitHub. I started to think about moving to OAuth when a user said me that he bought QuickHub but that he did not use it because of Basic Auth. He was afraid that I can rob its credentials and so have a look to its repositories and more. I totally understand this argument and so I started to think that it limits QuickHub adoption by developers and that I should do something.

So, I discussed with GitHub guys through their support channel (Here I want to say that I am really impressed on how fast and professional is the GitHub support team!). Of course, they also told me that they will never use QuickHub if OAuth is not provided. After discussions with the guys, I started to implement a workaround to provide OAuth support in QuickHub by using the OAuth Web flow and adding some stuff to QuickHub.

Let’s see how we can do that in a generic way so that you can use it in your app if needed since every serious Internet service also provide OAuth support… Note that I will not give many details about OAuth itself but I will use some terms, so have a look to OAuth documentation for more details.

Register a Web application

The first step is to register your application to the developer portal. Here you need to provide some information such as the app name and its callback URL. Even if we are developing a desktop app and not a Web one, we need to be able to provide this HTTP based callback URL. We will see in the next section what is inside this application. By registering our application, the service will generate and give us some keys to be used in the next steps, mostly to recognize us when calling the service.

Create a Web application

We need a Web application to handle callback calls from the service we want to use OAuth. This application will only be used at authorization time and just have to be able to receive the service call, get the code sent by the service, then call the service again with the code and our application keys (there is a secret one to be used here). As a result, the service will send you back your OAuth token to be used in all the future service calls. This token is used to authenticate your service calls, no more password stuff inside! Here is a quick sequence diagram showing all the exchanges between actors…

On the QuickHub side, I chose to create this Web application by using the Play Framework I already mentioned several times in this blog. I used the Heroku paas to provide the Web application publicly.

As showed in this Gist (https://gist.github.com/1466592), the callback method is really simple (as usual with Play!): just get the code and call GitHub with it and your application keys. When all lis done, just display a result page with a specific URL. Here it starts with ‘quickhubapp://oauth?’. Let’s see what it means in the next section…

Add custom URL handlers to your desktop app

Once the desktop application is authorized, our Web application redirects the user to a Web page which embeds a button targeting an URL starting by ‘quickhubapp://oauth?’. Here you already understand that by clicking on such a link must drive you to something special. The cocoa framework allows developers to register specific URL handlers for their applications. So we need to register QuickHub handlers so that OS X knows that every link  with the quickhubapp scheme must me routed to QuickHub. This is as easy as showed in this Gist https://gist.github.com/1466628.

This code snippet just tells QuickHub to invoke the getUrl method when it receives a quickhubapp event. Up to the getUrl method to handle things. In QuickHub, I just extract the OAuth token in order to persist it locally for future use.

Done!

So now we are able to use OAuth Web flows for desktop applications. In the best of the worlds, every service provider may provide a real desktop flow to be used without the need to create this additional web application. In the real world, it is not the case but as you see it can be bypassed quite easily.

I will provide more technical details on the second section ‘Create a Web application’ with real sample and code in the next weeks.

Better Gist support in Quickhub 1.2

Gists are cool. So I updated the way Gists can be created in Quickhub 1.2 (submitted last week, should be validated by Apple this week…). The interface is cleaner and there is also drag and drop available so you can now drag a Finder file and drop it into the Quickhub gist creation window.

(No this is not the vodafone/SFR icon, it is the Quickhub one… Must really find a designer, last time it looked like a FB icon).

Open Source Tweet Wall

I am a big fan of Twitter and last week devoxx live tweet wall (http://wall.devoxx.com/) just made me want to create an open source live tweet wall. So last saturday night, I took some time to code it using the now well known Play! framework, some Web sockets and Twitter4J which supports the Twitter Stream API. This streaming API is really nice and provide a way to be notified almost instantly according to what you decided to listen to. After less than one hour (most of the time was consumed to read to Twitter4J documentation), the result is really fun. In the video below, I configured the wall to catch all the tweets containing ‘Apple’ and ‘Microsoft’ terms (I am not a MS supporter, but OMG, there are lot of tweets about it… probably only jokes and bugs…), and tweets are displayed in live on the wall (no I am not moving anything, the page is populated through a Web socket)

The resulting prototype is quite simple but works, and since I am not a front-end developer at all, it uses Twitter Bootstrap as CSS… The code is available on GitHub at https://github.com/chamerling/play-twall and is not perfect at all but just works: Twitter configuration is available in the Play! application.conf file and the Twitter connection is created in the Bootstrap…

Looks like I should start creation sort of “Coding a nice thing in one hour” collection…

QuickHub 1.0, adding GitHub stuff to OS X

Some weeks ago I was looking for an OS X GitHub client. Not a client like the official GitHub client which is one of the best OS X app I ever see and which mainly deals with raw git stuff, but one which can allow me to access to my repositories, organizations, issues and gists. My different researchs returned nothing really exiting… Since I was looking for something new to develop, I started to create a simple application which focuses on my needs.
I started to share my idea and after some nights to code it, I sent the first prototype to some twitter geeks to get their feedback. The feedback I had was really exiting (thanks @k33g_org and @aheritier, you excited me a lot!), and most of the beta testers said me that I should submit the application to the Mac App Store and make it a paid application.

So, here we are! QuickHub has been finally validated by Apple and I have chosen to try to sell it at the lowest possible price ($0.99).

The first version of QuickHub stands in the OS X status bar and allows you to directly access to :
- Your Repositories
- Your Organizations/repositories
- Your Issues
- Your Gists

It also notifies you using Growl when something changes on the previously mentioned items. For now clicking a menu item opens in your browser. It is quite simple but it was really the first idea to provide something which can quickly allows you to access your GitHub stuff.

While Apple reviewed QuickHub, I started to add some features to it. The 1.1 version will allows you to do more things (hopefully), and especially to create gists directly from QuickHub, preview some artifacts and have more better user experience with some better interface… I hope to publish it in the next days.

For now, any feedback is appreciated. You can comment here, on my personal twitter @chamerling or on the official QuickHub one @quickhubapp. Share it with your friends/co workers/followers and let’s see what happens. You can directly access to the Mac App store or have a look to the QuickHub Web site.

Christophe

Create a management application in 3 hours with Play

Story, code, compare

Yet another ‘nightly project’ (thanks to current house build project and the lack of sleep it brings). This time I needed to be able to manage the so-famous Service Bus from some Web enabled tooling. I already developed such tool in a research project but the fact is that the licence of some libraries are not compatible with the petalslink open source approach. The second thing is that it is GWT based (which bores me, has almost 100 libraries dependencies and takes 10 minutes to compile). So this application is a good candidate to compare development productivity between GWT and the Play Framework. Here is a summary of the application creation:

  • I bootstraped the application yesterday during lunch between 1PM and 2PM. I was already able to invoke most of the interesting service bus actions with the help of service bus SOAP API.
  • I added some pages and actions last night, let say that since it was between 11PM and 1AM I was not very productive…
  • I fixed some bugs this morning

As a result, I think I worked around 3 hours on this application. I think I spent one hour to resolve a dependency conflict between Play and a CXF dependency but as a result I have a good result which is almost equivalent in functionality to the GWT based application. I still miss some operations but I do not need them for now… I feel ashamed to say how long it tooks me to create the GWT version…

Deploy

Let’s talk about deployment… I did not have time to play with heroku to push this application in the cloud. Tis will be a future step but since I use Play and git, I am able to push the code to github and then pull it on an OVH server I rent. I am able to provide this instance for some project partners if they want to manage the service bus. The time it took? 5 minutes (wget play, git clone and play start…).

Code

The Play enabled application is available on github at chamerling/dsbmanager-webapp.

Some Play Framework, Service Bus, WS Notification and Web Sockets…

The Context

In the previous post I was introducing some tests I did with Play Framework and Web sockets. To summarize, it was just ‘about’ receiving messages on the Play! application and pushing them to the browser. This time, let’s go one step forward: Let’s add some infrastructure stuff to do something more real…

In the current case, I want to introduce a service bus which allows to create a real integration between service consumers and producers (I need to write another article in response to this nice videocast about integration from Zenexity guys ‘EAI & ESB n’apportent rien si les applications ne sont pas intégrables et interopérables’, but I really need more time to explain my thoughs…).
Using a service bus in the current case (and not for this case in fact…) must bring some added value. Here I choose to show that a service bus, even if it is not so lightweight at all, can provide some real cool features that you can have out of the box. Now, let’s add some event stuff to switch to an event-based world where we can have tons of event producers and let’s say thousands of event consumers. Since I can not setup such hude amount of actors, let’s say that we have one event producer and two event consumers:

  • The event producer wants to publish some stuff somewhere. To illustrate, let’s say that we have a weather sensor connected to our platform.
  • The platform provides a list of topics which producers can use to publish data. One is the weather topic which will be used by the producer above.
  • The event consumers want to be notified on new weather data i.e. as soon as the weather sensor publish new data. To keep it simple, they need to subscribe to the weather topic provided by the platform.

To recap, in the event context, the event producer only knows the service he has to push weather data to, the event consumers just have to subscribe to a topic they are interested in. All the knowledge stuff about producers, consumers, topics and all the mapping is delgated at the service bus level. Yes, true it is exactly like in some topic-based messaging stuff because at the end of the day, it is topic-based messaging stuff…

The Stuff

Now we can speak about the stuff we are going to use in the software point of view for notificaiton actors…

  • The event producer will not be a sensor but a Play! application. The application sends Web service notifications message to the service bus on a given topic.
  • The service bus is (of course) the Petals Distributed Service Bus with some Web service notification modules inside.
  • The event consumers are 1/A Play! application exposing a Web service to receive notification it subscribes to and 2/ A local java application displaying OS X notifications using Growl (let’s use JavaGrowl I published some days ago…). Note that the Play! application which have subscribed to notifications pushes them to their clients (browsers) using the funky Websocket stuff.

Let’s look at what really happens in a short video:

  • I use the Play! powered application play-soap-wsnclient to subscribe to notification on behalf of the play-soap-websocket Web application.
  • In Eclipse, I start a Web service notification powered Web service which subscribes to the same notification topic. Its listener is configured to use JavaGrowl to display incoming notifications.
  • I use play-soap-wsnclient to send notification messages to the notification service hosted on the service bus.
  • Once received, the service bus forwards the notification to all the subscribers using internal routing and WSN stuff.
  • The play-soap-websocket Web application receives a notification and push it to the client browser using Websocket.
  • At the same time, the Java application also receives a notification and display it using Growl.

One (or more) step(s) further…

And what if we have something which is not a Web service which subscribes to notifications? With the help of a service bus like Petals ESB/DSB, we just have to add a component which knows how to speak with the subscriber. For example, let’s say that SOAP is bad and that REST is the best thing ever. Can we have REST services receiving notifications? Yes, we can! Let’s just add the REST connector to the service bus. Another protocol/transport/format? Develop and add the new one. This is where the service bus can also help you. Hopefully, there are also other things which are possible with a service bus, we will see it later in other posts if I have time (as usual): Let’s think about business processes, service orchestration, transformation…
Next time we will have a look on what we can do if we use the distributed feature of the service bus, for example, receiving some notifications on one node and be able to notify subscribers which are bound to other nodes…

Source Code

Need something? Just Ask GitHub…

I am using GitHub more and more: for personal open source projects (https://github.com/chamerling), for research projects (Play for now https://github.com/organizations/play-project), for organizations (OW2 will start using it soon at least for mirroring https://github.com/organizations/ow2, and we use it for the Java USer Group we created in Montpellier https://github.com/organizations/Jug-Montpellier).

This is a really nice tool and not only one other fashion tool. There are tons of interesting features and thousands mature and interesting projects are already there.

I remember a discussion almost one year ago where someone in my company was saying that git was not ready for industry. To be honest, I was not using git at this moment and did not have time to look at it, so my opinion was… no opinion. But what I can say today is that, after some months of use and with all the work GitHub guys did and with all the projects which migrated to this platform, it is probably more than ready to be widely used by all (not only GitHub, but git too).

So to come back to the main goal of this article, I was asking on twitter some days ago, what is the best tool to use to publish GitHub gists?

Even if I got some retweets, I did not have any answers (probably since I do not have any impact on Twitter or maybe my followers are not GitHub users…). So I asked it to GitHub and the first answer is just what I need: A command line tool written in Ruby (which is published by the GitHub CEO itself) and which is named gist. Using it is sooooo simple, just launch your terminal (I still use it everyday for many things) and the gist command will do the rest. As a result, you will get the gist link you can send to your peers. Sharing a gist just take 3 seconds…
And you what are you using to gist? or even are you using Git?

Mises à jour Twitter