JavaScript for Li...
Follow
Find tag "websockets"
309.4K views | +634 today
JavaScript for Line of Business Applications
Keeping track of current JavaScript Frameworks that help design your clientside Business Logic Layers.
Curated by Jan Hesse
Beam to my Inbox:
Your new post is loading...
Your new post is loading...
Scoop.it!

Swarm.js+React — real-time, offline-ready Holy Grail web apps

Swarm.js+React — real-time, offline-ready Holy Grail web apps | JavaScript for Line of Business Applications | Scoop.it

Skipping collaborative apps, these days even a single user needs to sync his/her devices. The device landscape is getting predominantly mobile, so an average user has multiple powerful devices with unreliable internet connections.

Popular solutions suck for one simple reason: common sense fails us in distributed systems. Proper sync needs some math like a GPS device needs some relativity formulas. Yes, that is just a box that says your x and y. No, it can’t work by common sense alone; it needs math.

more...
No comment yet.
Scoop.it!

WebRTC chat with React.js

WebRTC chat with React.js | JavaScript for Line of Business Applications | Scoop.it

In this blog post I’m going to share how could be build WebRTC chat with React.js.

In the beginning of the blog post I mentioned that React.js application contains a finite amount of React.js components composed together. In this subsection I’ll illustrate, which are the different components of our application and how they are composed together.

more...
No comment yet.
Scoop.it!

WebSockets in Windows Store Apps

WebSockets in Windows Store Apps | JavaScript for Line of Business Applications | Scoop.it

In this article, Jeremy Likness shows how to connect to WebSockets using both message-based and real-time connections from Windows Store apps.

more...
No comment yet.
Scoop.it!

KWAND JavaScript Full Stack Web Development for the Next Generation

KWAND JavaScript Full Stack Web Development for the Next Generation | JavaScript for Line of Business Applications | Scoop.it
KWAND JavaScript Full Stack Web Development for the Next Generation of Web and Mobile Applications

Uses Koa · WebSockets · Angular · Node · Dokku like this:


Client:

  • AngularJS
  • AngularUI
  • Socket.IO

Server:

  • Co
  • Koa
  • Jade
  • WS

Storage:

  • MongoDB

Develop:

  • Gulp
  • Stylus
  • LiveReload
  • Nodemon

Test:

  • SuperAgent
  • Mocha
  • Travis

Package:

  • NPM

Deploy:

  • Dokku
  • Heroku
  • Forever


more...
No comment yet.
Scoop.it!

Browser to browser communication with Vert.x, websockets and HTML5

Browser to browser communication with Vert.x, websockets and HTML5 | JavaScript for Line of Business Applications | Scoop.it

I've been playing around with Vert.x for a couple of weeks and I'm really starting to like the simplicity of the framework. With very little configuration you can quickly get impressive results. In this article I'm diving a bit deeper in how to set up browser to browser communication using the Vert.x eventbus by using the javascript client side API. In short I'm going to show you the following things:

  • Use Vert.x as a simple web server
  • Configure vert.x on the serverside to act as bridge for the browser eventbus implementation
  • Create a simple example that shows how to use the eventbus from javascript


I'm going to skip the explanation on how to set up Vert.x. If you want more information on that look at this article where I explain the setup I've used in this example. So let's get started with the first step.

more...
No comment yet.
Scoop.it!

How to send live data from a C# Desktop Application to Web using Websockets

How to send live data from a C# Desktop Application to Web using Websockets | JavaScript for Line of Business Applications | Scoop.it

This is a step-by-step guide about how to expose live data from a C# console application to a web browser using WebSockets. The example has been implemented and tested on Windows7.

more...
No comment yet.
Scoop.it!

Using WebSockets to keep a local cache in sync

Given that the client didn't want to move his server for is current hosting provider, but was complaining all the time of how slow things were, I realised that I had to find a way to improve application responsiveness by having the data already stored locally when the user/UI actually needs it.
So, devised a strategy of keeping a local cache and using web sockets to notify my local cache that local data as dirty and needs to be updated.

Conceptually, I like the idea of having my cache resembling a database and and an ORM implementation. Having that I mind, my implementation would require the following components:
 * An Entity, that will map to a server side collection of data (usually a table but can actually be just a view)
 * A local cache/db, that will store a set of entities and provide convenient API's to access them

more...
No comment yet.
Scoop.it!

Making Angular.js Real-Time with Pusher

Making Angular.js Real-Time with Pusher | JavaScript for Line of Business Applications | Scoop.it

Front-end application frameworks have given developers the tools to build client side applications with rich user experiences. Let’s say your application is built with one of these frameworks and you want to notify connected clients that something on the server has changed – how can you do that while keeping a rich user experience? This is where Pusher and angular-pusher come into play.

Using Pusher will allow us to subscribe to events triggered by other clients. First I’ll show you the simple changes needed in our ItemListController to use angular-pusher. Then I’ll show you an example of using Pusher in a Node.js server when an item is updated.

more...
No comment yet.
Scoop.it!

JSONsvc - a "proxy-peer/peer" protocol for Websockets

JSONsvc defines a simple format for data to be sent between a Websocket server and its clients. It allows browser clients to view the connection as a type of "proxy-peer-to-peer" network. i.e. any client can send data to another client as if they were directly connected - the websocket server does the routing.

The protocol also allows multiple clients to automagically receive data they are interested in whenever anyone else sends it - again routed by the websocket server.

The intended interest here is in the use of general-purpose protocol with a server, rather than some ad-hoc scheme which means you would have to change client and server code to add or change any functionality.  

more...
No comment yet.
Scoop.it!

An Introduction To WebSockets

An Introduction To WebSockets | JavaScript for Line of Business Applications | Scoop.it
In this article, Shwetank Dixit introduces the WebSockets protocol and API, the problem they are designed to solve, and the first few lines of code to get you started enabling your web applications with this technology...

So why do we need WebSockets? What problem are we trying to solve by using them? The answer is easy. We need a better way for web applications running on a client browser to communicate in real time with their servers

WebSockets are a new way for clients to communicate to servers and vice versa, without the overhead of an HTTP protocol. It uses its own protocol, which is defined by the IETF. The latest version is RFC 6455. Previous versions of the protocol proved to have some security issues so while they were implemented in a few browsers like Opera, they were not enabled by default. The newest version of the protocol seems have improved on these issue, and browsers are working on supporting that now.

Apart from having its own protocol, it also has an API which can be used by web applications to open and close connections and to send and receive messages. This is called the WebSockets API and is defined in aW3C Specification.


more...
No comment yet.
Scoop.it!

Poor Man's Firebase: LevelDB, REST, and WebSockets

I wanted to build a web app that would allow data to easily be transmitted to other connected web clients. I had heard of Firebase before. So I started reading the Firebase documentation and playing around with the examples.There is a nice library that they created called AngularFire which provides some slick integration between Firebase andAngularJS. But for some reason, the provided chat example would sporadically not work. (As an aside, it seems that it would work most of the time in most of environments that I'd try, but for some reason, it rarely worked in one). So I needed to find a new solution.


According to the project page: "LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values." What's great about LevelDB is that it's fast and it doesn't have any external dependencies that users need to install before they install your app.

LevelUP is the Node.js bindings built on LevelDOWN which is the low-level Node.js bindings for LevelDB.


more...
No comment yet.
Scoop.it!

My path to the real-time Web

My path to the real-time Web | JavaScript for Line of Business Applications | Scoop.it

Among other things in this blog post I’ll describe an example of how the usage of real-time can save you 99% of backend requests, while making your code simpler and your user interface snappier along the way.

Then, about a year ago, I stumbled across an old friend of mine who happens to be the author ofAutobahn, an open-source real-time framework for Web, Mobile & Internet of Things.

It took some time until I was convinced of the simplicity of his technology, but eventually I found that I did not need to understand the inner complications of sending messages over WebSocket from A to B in order to use Autobahn.

Once I had WebSocket working in my app, I was just a tiny step away from getting server pushed messages into the client browser. I very much liked this idea to get rid of those refresh buttons everywhere in the frontend. That was a low hanging fruit then and I quickly got some really nice changes in interface design (like live chat, object locking in the frontend and real-time refresh).


more...
No comment yet.
Scoop.it!

Lightstreamer: Visual Layer of the JavaScript Client Library for real time messaging

Lightstreamer: Visual Layer of the JavaScript Client Library for real time messaging | JavaScript for Line of Business Applications | Scoop.it

Lightstreamer enables several forms of real-time messaging and is flexible enough to be used in any scenario, including mission critical applications.

Before we could release the visual layer, we had to release a common layer of utilities we shared across our whole library. The idea of a second project, to host the various utilities, was born... Following closer, came the idea to isolate the logging infrastructure in its own project and to also publish our testing framework. In the end, we had 4 projects to publish.

Let me introduce the various libraries to you:

* The toolkit

* The logger

* The test framework

* The visual layer


more...
No comment yet.
Scoop.it!

A chatroom for all! Part 3 - Building a Backend with Node, Mongo and Socket.IO

A chatroom for all! Part 3 - Building a Backend with Node, Mongo and Socket.IO | JavaScript for Line of Business Applications | Scoop.it

In this part, I will show you how to use your existing express-based node.js app to create a chatroom backend with WebSocket support.

Now we have a chat system capable of broadcasting a message received via websockets to all other connected clients, it saves the message to the database and retrieves the last 10 messages to give context to every new user who joins the chatroom.

more...
No comment yet.
Scoop.it!

Horizontally Scaling Node.js and WebSockets with Redis

Horizontally Scaling Node.js and WebSockets with Redis | JavaScript for Line of Business Applications | Scoop.it

The Node.js cluster module is a common method of scaling servers, allowing for the use of all available CPU cores. However, what happens when you must scale to multiple servers or virtual machines?

That is the problem we faced when scaling our newest HTML5 MMORPG. Rather than trying to cluster on a single machine, we wanted to get the benefit of a truly distributed system that can automatically failover and spread the load across multiple servers and even data-centers.

more...
No comment yet.
Scoop.it!

Transforming WebSockets

An introduction to WebSockets and why Primus might be a better fit for your project.

Jan Hesse's insight:

http://primus.io

more...
No comment yet.
Scoop.it!

Realtime bandwidth

Realtime bandwidth | JavaScript for Line of Business Applications | Scoop.it

One of our key products is a trading dashboard that handles hundreds of thousands of events from football matches and related betting markets. To consistently deliver value, we need to be able to handle this flurry of messages over a WebSocket connection and reliably keep the UI in sync.

At its peak, on a typical Saturday afternoon, each WebSocket connection will receive upwards of 500 messages per second. Translating each of these messages into a UI update yields incredibly bad performance: the incumbent dashboard does just that, but as the business has scaled, we are hitting the limits of the current solution.

So that we can continue to provide value to our users, we need to think about ways we can separate the concerns of receiving messages and updating the UI. Doing so has pushed us to evaluate our tech stack and rebuild portions of our dashboard from the ground up.

more...
No comment yet.
Scoop.it!

Finding the right Node.JS WebSocket implementation  

Finding the right Node.JS WebSocket implementation   | JavaScript for Line of Business Applications | Scoop.it
A journey with ws, Socket.IO, Engine.IO, and Primus

For a current project at WhoScored, I needed to learn JavaScript, Node.JS and WebSocket channel, after seven years of writing web applications with Java and Spring framework. We wanted an application that can send data to thousands of concurrent users, and Node.JS appeared to be the right way of doing it with its event-driven, non-blocking I/O model that can scale up easily.


Compared Frameworks

* einaros / ws
* Socket.IO
* Engine.IO
* Primus


Performance limits
* Changing the flow based on limitations
* Test 1: The impact of data size
* Test 2: The impact of concurrent connection size
* Test 3: The impact of data broadcasting frequency


more...
No comment yet.
Scoop.it!

Twitter Streaming API with Node.js, Socket.io and ReactJS

Twitter Streaming API with Node.js, Socket.io and ReactJS | JavaScript for Line of Business Applications | Scoop.it

I have been working in a prototype using the Twitter Streaming API with Socket.io and ReactJS for the frontend, Node.js in the backend, cool stuff!

I used several articles as a reference, the one using the streaming API using socket.io(but AngularJS and ntwitter npm package), real-time django using node.js and socket.io or a modern python stack for a real time web application.

In the end as I said I used nodejs, the twit package and socket.io in the backend. With all these tools was incredibly easy to have something running fast.

And these are the different parts composing the example, the installation of the different tools is beyond the scope of this article just because I want to focus more in functionality and I don't want the article to be very long.

Anyway if you have a question/criticism here I am. :-)

Jan Hesse's insight:

More ReactJS Intro: http://javaguirre.net/2014/02/09/reactjs-by-example/

more...
No comment yet.
Scoop.it!

Remote Desktop Client with AngularJS and Yeoman

Remote Desktop Client with AngularJS and Yeoman | JavaScript for Line of Business Applications | Scoop.it

In this blog post I’m going to show you how to build a VNC client using AngularJS and Yeoman.

We should have a VNC server on the machine we want to control. This machine provides interface accessible through the RFB protocol. The proxy in the middle has RFB client, which knows how to talk to the RFB server. The proxy also provides HTTP server, which is responsible for serving static files to the client and also allows communication through socket.io. The last component in our diagram is the “AngularJS VNC client”, which consists few HTML and JavaScript files provided to the browser by the proxy. This is what actually the user of our VNC client sees. He or she use the form provided in the “AngularJS VNC client” in order to enter connection details and connect to the machine he or she wants to control

more...
No comment yet.
Scoop.it!

Creating a real-time multiplayer game with WebSockets and Node.js

Creating a real-time multiplayer game with WebSockets and Node.js | JavaScript for Line of Business Applications | Scoop.it

During the workshop I explained exactly how to take a single player HTML5 game and turn it into a multiplayer one using Node.js and WebSockets.


Each player is identified using a unique client.id number. We'll use this later when communicating game updates to other players. For now the util.log line will output the client identification number to the terminal on connection.

The client.on event listeners are used to detect when a player has either disconnected or sent a message to the server. Right now they point to handler functions that don't exist.


more...
No comment yet.
Scoop.it!

Using Node.js and Websockets to Build a Chat Service

Using Node.js and Websockets to Build a Chat Service | JavaScript for Line of Business Applications | Scoop.it

Node.js and Websockets are the perfect combination to write very fast, lag free applications which can send data to a huge number of clients. So why don't we start learning about these two topics by building a chat service! We will see how to install Node.js packages, serve a static page to the client with a basic web-server, and configure Socket.io to communicate with the client.

So why use this combo?

There are a lot of platforms which can run a chat application, but by choosing Node.js we don't have to learn a completely different language, it's just JavaScript, but server-side.

Node.js is a platform built on Chrome’s JavaScript runtime to make building applications in JavaScript that run on the server, easy. Node.js uses an event-driven, non-blocking I/O model, which makes it perfect for building real time apps.

more...
No comment yet.
Scoop.it!

Building a Real-time SMS Voting App

Building a Real-time SMS Voting App | JavaScript for Line of Business Applications | Scoop.it
A five part (and multi-year!) series from the Twilio blog recently concluded - here's the list of all the posts in the series:

Building a Real-time SMS Voting App Part 1: Node.js & CouchDB
Building a Real-time SMS Voting App Part 2: Socket.io and Highcharts.js
Building a Real-time SMS Voting App Part 3: Scaling Node.js and CouchDB
Votr Part 4: AngularJS and Authentication with CouchDB
Votr Part 5: AngularJS and CRUD Using RESTful APIs

more...
Benjamin Dean's curator insight, January 21, 9:42 AM

I've been a big fan of what Twilio can do for small organizations, and this series gives good insight on building a full-stack app with AngularJS.

Sergei Vedischev's curator insight, January 22, 7:41 AM

very interesting series

Scoop.it!

Real-Time AngularJS SDK with Live Chat Example

Real-Time AngularJS SDK with Live Chat Example | JavaScript for Line of Business Applications | Scoop.it

Over the past few months, it has been really exciting to follow the phenomenal traction and explosive adoption of AngularJS, an Open Source framework for Web Application development, originally started by developers at Google and now receiving global attention.

Over the course of building a few PubNub-enabled AngularJS applications, we came across a bunch of patterns and features that we thought would be useful for AngularJS developers, for example:

* an Angular service to inject the PubNub object into controllers.

* an Angular-friendly mechanism for binding events to the root scope.

* additional bookkeeping functions for providing easy access to collections (such as the presence and channels lists).

more...
No comment yet.
Scoop.it!

How I Built Emojitracker - Adventures in Unicode, Real-time Streaming, and Media Culture

How I Built Emojitracker - Adventures in Unicode, Real-time Streaming, and Media Culture | JavaScript for Line of Business Applications | Scoop.it

While the source code for emojitracker has been open-source since day one, the technical concepts are complex and varied, and the parts of the code that are interesting are not necessarily obvious from browsing the code. Thus, rather than a tutorial, in this post I intend to write about the process of building emojitracker: the problems I encountered, and how I got around them.

I’d been playing around with the idea of realtime streaming from the Twitter API on a number of previous projects (such as goodvsevil, which was the spiritual predecessor to emojitracker), and I was curious about seeing how far I could push it in terms of number of terms monitored. At 842 terms to track, emoji seemed like a prime candidate.

Emoji are also a great way to get insight to the cultural zeitgeist of Twitter: the creative ways in which people appropriate and use emoji symbols is fascinating, and I hoped to be able to build a lens that would enable one to peer into that world with more detail.

 

* Background Understanding: Emoji and Unicode

* Emojitracker Backend Architecture
Feeding the Machine: Riding the Twitter Streaming API
Data Storage: Redis sorted sets, FIFO, and Pubsub streams
Pushing to Web Clients: Utilizing SSE Streams
Performance Optimizations for High Frequency SSE Streams
Gotcha: Many “cloud” environments don’t properly support this (and a workaround)
Not crossing the streams: The admin interface

* Frontend Architecture
* Frontend Performance
* Deploying and Scaling
* Things I’d still like to do
* Reception and conclusions

more...
No comment yet.