Giter Club home page Giter Club logo

data-ingestion-platform's Introduction

Data Ingestion Service - NodeJS

This application is a prototype of a data ingestion service which provides the following functionalities:

  • Ability to submit data through an API call, including data validation
  • Ability to retrieve data from a database
  • Ability to define a threshold for a specific data type. If the threshold is tripped, an alert SMS will be sent to a predefined phone number.

Run locally

To run this locally, clone it on your machine and install all the dependencies with npm install. Then simply run it with node server.js In the config folder create the required configuration files for the mongodb database and the SMS alert service, as they are gitignored.

Structure:

config/db.js

module.exports = {
  url : '<DB CONNECTION STRING>',
  collection: '<COLLECTION NAME>'
};

and

config/twilio.js

module.exports = {
    twiloNumber: '+000000000000',
    accountSid : 'aaaaaaaaaaaaaaaaaa',
    authToken: 'bbbbbbbbbbbbbbbbbbbbbbbb',
    emergencyNumber: '+0000000000'
  };

Endpoints

Submit new data points

New data points can be submitted with a PUT API call to /data/, the structure needs to be as follows.

{
	"sensorId": "string",
	"time": 12,
	"value": 137
}

Retrieve data points

A GET API call to /data/ is used to retrieve data from the database, the following headers are required:

  • sensorId: Id of the sensor you want to get data from
  • since: initial time
  • until: final time

For example, a call with the following headers:

{
	"sensorId": "abc",
	"since": 12,
	"until": 18
}

would return all the data points collected by the sensor with sensorId = 'abc' from time 12 to time 18.

data-ingestion-platform's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.