Wednesday, 2 March, 2016 UTC


Summary

The popularity and success of JavaScript is amazing. There are 1 million tagged questions on StackOverflow, according to RedMonk there are more JavaScript projects on GitHub than projects in any other language and there are 250,000 npm packages available. Impressive numbers.
Within the JavaScript community the MEAN stack is a very popular full stack framework to build backends and frontends for applications with JavaScript. I think it’s a great stack, but to make it even simpler to build applications with REST APIs, applications with role based access control and to support multiple databases, the Node.js framework LoopBack is a great addition.
Introducing the CLEAN stack for IBM Bluemix …
Just to get this out of the way. The term CLEAN is just something I’m using personally. While this model fits nicely into Bluemix, there is no such IBM product or offering.
CLEAN stands for Cloudant NoSQL DB, LoopBack, Express, AngularJS and Node.js. It’s similar to the MEAN stack with two significant differences.
1) LoopBack
With the importance of the API economy I looked for a mechanism to easily build and document APIs. LoopBack has a lot to offer along those lines and last week even more exciting announcements were made around API management.
Also a lot of applications require access control to certain information on both application and object level. I evaluated briefly other ways to do authorization in Node.js applications, but for me the built in functionality in LoopBack was much easier to use.
2) Cloudant NoSQL Database
The CLEAN stack uses Cloudant instead of MongoDB, but LoopBack actually supports MongoDB as well. One reason I chose Cloudant was just because I like it :). The other reason was that the Bluemix MongoDB service is not fully integrated in Bluemix yet and I wanted the deployment to be as easy as possible.
Open Source Sample
I’ve open sourced a simple sample that shows how to use the CLEAN stack and how to deploy the application to Bluemix. JavaScript and JSON are used everywhere.
JavaScript:
  • Node.js for business logic
  • AngularJS for web application
  • Ionic, Cordova and AngularJS for hybrid mobile apps
  • Gulp build script
JSON:
  • Definitions of business objects
  • REST APIs
  • Property files
Get the code from GitHub.
Check out the slides and the series of blog articles for more information.
Documentation:
  • Creating Business Objects and REST APIs with LoopBack
  • Usage of Cloudant in LoopBack Applications
  • Authentication in LoopBack Applications against Bluemix
  • Customization of REST APIs in LoopBack Applications
  • Authorization in LoopBack Applications on Bluemix
  • How to write AngularJS Frontends for LoopBack Applications
  • How to write Mobile Apps for LoopBack Applications
  • How to consume Bluemix Services in LoopBack Applications
The post Introducing the CLEAN Stack – JavaScript everywhere appeared first on Niklas Heidloff.