← Home

Application Authentication with JSON Web Tokens

Published on August 22, 2014 at projekt202.com

Out in this jungle we call the world wide web, you can find many programming languages used to build and publish content. HTML and CSS for front-end development, C# and Ruby for backend development and SQL for databases. But one language seems to be the most popular no matter what it is used for and that brings us to our special guest: JavaScript.

Usually when you hear people talk about JavaScript, they are referring to jQuery. But nowadays JavaScript can do so much more than HTML document traversal and manipulation. So let’s get into it.

Front-end Web Development

A lot of what people use JavaScript for is web development so we can start there. I already mentioned jQuery, but it’s worth mentioning again. jQuery is the most popular JavaScript framework and it is used for document traversal and manipulation.

Another type of web development that JavaScript gets used for is to build single-page applications. The are websites where all of the front-end logic is built into one HTML file. Single-page app development has been growing very quickly in popularity and because of that you can find many frameworks to help you streamline the development process. A couple of my favorites are AngularJS and Backbone.js. Both are used to create single-page apps but have their own approach to the development.

Mobile web development falls into the category of front-end web development because the same techniques are used to build both and with more sites being built responsive from the start, mobile sites and non-mobile sites share the same code. There are some frameworks that specifically help with mobile web development, but they aren’t used too often because mobile web and non-mobile web development ends up utilizing the same HTML, CSS and JavaScript files. Some of mobile web frameworks that I have found useful in the past are jQuery Mobile, JQTouch and React.js.

Backend Web Development

Backend web development with JavaScript is a relatively new thing but is growing in popularity as fast or faster than most new technologies thanks to NodeJS. Created by a developer named Ryan Dahl, NodeJS allows developers to use something that they are already familiar with, JavaScript, and build powerful web applications with backend code.

NodeJS is good at handling a bunch of concurrent users at one time which makes it really powerful if you are building web applications. If your goal is to build a marketing site then NodeJS might be too much.

Since NodeJS was created, a couple of frameworks have come out, Express and Meteor, that make building web apps with NodeJS incredibly easy. Express has become that standard when building web apps with NodeJS and has already created the parts of a web app that you would recreate every time you start a new project. Meteor is built on top of Express and has created some really powerful features, like live page updates, for web apps.

Native Mobile App Development

Native mobile app development with JavaScript has been around almost as long as mobile development has been around. Frameworks like PhoneGap and RedFoundry have made it incredibly easy for web developers to build both iPhone and Android native apps without having to learn Objective-C or Java.

Desktop App Development

So far, the development we have talked about with JavaScript is known by the web community. So let’s talk about some JavaScript development that isn’t well known and we’ll start with desktop app development. When web developers start out, they never think about building desktop apps - mainly because it takes development skills that do not interest most developers. But as the development world has evolved, it has become easier to build desktop apps using languages you already know.

Let’s welcome TideSDK and AppJS. Two frameworks that give JavaScript developers the power to move into a new type of development without learning new programming languages. And the best part is the same code you will write for Mac apps will get used for Windows and Linux apps. TideSDK is currently in beta and will be released soon and AppJS has been around for a little while.

Arduino, Raspberry Pi and Spark Core Development

We have been talking about different ways of using JavaScript and we have been getting further away from web development with desktop and mobile apps. Now let’s talk about something that has nothing to do with the web but still utilizes JavaScript for development.

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Thousand of projects have been made with Arduino. From sprinkler systems to robots. If you can imagine it, it can probably be built with Arduino. The Arduino community has been vastly growing over the years and from it has a ton of resources about how to build with Arduino. With JavaScript and Arduino both being incredibly popular, eventually someone was going to merge the two.

Johnny-Five is an open source, JavaScript Arduino programming framework, developed at Bocoup. Johnny-Five is built on top of NodeJS, and like the other JavaScript frameworks we have previously talked about, it makes working with an Arduino simple. You don’t have to worry about a new language, you just play with the Arduino.

IO plugins have been made for Johnny-Five that make it work for Raspberry Pi and Spark Core. Raspberry Pi is similar to Arduino, they just approach hardware and software in their own way. Spark Core is similar to Arduino, but take a cloud based approach to the industry. All three are incredible and be something that every developer should look into.