Comcast / Speed-testJS

Other
94 stars 50 forks source link

SpeedtestJS

Speed-testJS is a JavaScript based speed test that will provide users with an enriched view of their Internet speed. Providing users with not only their latency, upload and download speeds and context around their entire Internet experience. Using speed tier data to add a qualifying metric to standard speed test results users will now know whether their experience is poor, good or great

Deployment

For deploying to a test server, see the README under ansible folder.

Client Server Setup

The application consists of a node/express software running the server and plain javascript/html on the client. The server powers reset endpoints, websocket communication, database interactions and the client website.

Server

Index.js is the starting point of the app contains of the neccessary functions to run the application. Significant settings in this file are:

  1. Configuration parameters
  2. Rest Endpoints
  3. WebSockets
  4. Modules folder contains custom modules used for the application.

Client

Client: Client application resides in the public folder and consists of plain javascript. Index.html is the default start page of the application and will contain an end to end example of a Bandwidth Speed Test. The following describes the folder structure of the client application:

Manual deployment

Grunt is being used to package the needed files and folders to deploy the application to a server to run the application. The steps are listed below:

  1. run grunt package from the root folder
  2. tar, zip or compress the resulting dist folder
  3. deploy and uncompress on your server
  4. execute node index.js from the console.

Running the application

To run the application locally

  1. Clone repo
  2. run npm install from root folder
  3. run node index.js
  4. browse to the ipaddress:port number (ie. locally it will be http://localhost:port

Database

To set dynamodb locally

  1. Follow the instructions in the link to download and run dynamodb locally http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
  2. Set up AWS credentially locally http://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-credentials.html
  3. Once dynamodb is set up locally. Use the following to script to create a table and insert the data into the dynamodb (execute node database.js from terminal)
  4. While executing the script change table name and server information