Node Web App

An as close to realtime as possible results/events monitoring service. The results were being written at high speed to files on the server.

Skills & Technologies

Javascript
Websockets (socket.io)
Node.js
Jade
express

Backend

The backend of this app was written javascript running under NodeJS, using the express library to serve the HTTP requests and Socket.IO for the websocket pub/sub service.

Once a client has authenticated with the server and setup the socket connection they indicate via a message on the socket which results files they wished to see events from.

Assuming the files were not already being monitored by the service, it opens the files on the server using the node “tail” package which monitors the files for events and alert us when new lines appear. We then push these lines down the socket(s) monitoring them.

Frontend

Built using vanilla javascript (with the socket.io client library). It authenticates via tokens passed in the query string and allows input from the user of which files they wish to monitor. When it starts receiving events on the socket it parses them into a readable format and appends them to a tabular interface taking care to trim or reuse older rows so as not to exhuast memory and remain performant.