node.js with Liferay 6.1

Wow, it's been a while since I last posted.  Liferay 6.1 EE has just been released and it's changed so much!  I decided to build a node.js app that calls Liferay using the improved JSON web services.  Really, I think this could work just as easily with 6.0 but whatever.  The project currently grabs the layouts of the Guest community and displays the portlets as widgets and using bootstrap for default styling.  

There's no reason for this project but I did it just to do it so it's more of a hacked together project but here it is for anyone interested in improving it or playing with it:

https://github.com/david-truong/liferay-node-bootstrap.

You will need a liferay 6.1 server running on 8080 using test@liferay.com/test.

Potential use cases:

  • Write a mobile site
  • Write a new frontend 
  • Integrate Liferay with another node app using this as an example

Things that might be fun to improve:

  • Grabbing the portlet data and writing our own front end
  • Adding user authentication
  • Add token authentication to Liferay so I don't have to hard code a user in my code.

 

That's it!  Hope my next post comes a lot quicker than this one.

Take care

Blogs
Very nice, David, finally we have something working!

The first two potential use cases - to write a mobile site or a new frontend using this approach are really interesting - will be happy to participate!

Talking about improvements, what if we replace the HTTP connection with AMQP, for example?
https://github.com/postwait/node-amqp
Looks interesting. I myself having worked with Liferay, and currently working on Node.js keep thinking of use-cases where these two can be brought together.

The scenarios you suggested uses Liferay as content provider for Node.js. A scenario I thought of is other way around:
Socket.io + Node.js (on backend) with Liferay (on frontend): to display real-time streaming data (stock feeds, clock/time, monitoring dashboard, etc).
That sounds interesting.

I would like to find a way to not have to run 2 different servers.
@David,
I agree with you on that. I too wouldn't like to run 2 different servers. We can use comet libraries for Java - like Grizzly (http://grizzly.java.net/), but websocket support is not yet available in IE and webkit (AFAIK). That's where socket.io comes to rescue.
Moreover, Node.js is fares well on high load (plus: has good support for no-sql dbs like MongoDemoticon. So I wouldn't mind considering it as a backend for a Liferay app that renders realtime data.
Some changes I had to make in the code in order to try the example.
Change "local.host" to "localhost".
Change "styles.css" to style.css".