parikhv15 / egen-be-challenge

Egen Solution Coding Challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Egen Coding Challenge - Level 2

Problem Statement

The goal of this exercise is to build a system that works like an IoT platform – in this case, a personal weight

tracker. This system is responsible for,

  • Consuming data sent from different sensors (emulators)

  • Storing the received data in MongoDB

  • Running the data through different rules to make basic predictions

Dependencies : [Java 7] (http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html "JDK 7") | [Maven] (https://maven.apache.org/download.cgi "Maven Build") | [Mongo DB] (https://docs.mongodb.com/ "Mongo DB") | [Morphia Api] (http://mongodb.github.io/morphia/ "Morphia Api") | [Easy Rules] (http://www.easyrules.org/ "Easy Rules") | [Sensor-Emulator] (https://github.com/egen/sensor-emulator "Sensor-Emulator")

Steps to Run

  1. Compile Project and generate jar
mvn clean package
  1. Run Project
java -jar -Dbase.value=<base_weight> target/egen-be-challenge-0.0.1-SNAPSHOT.jar

Enter value for base_weight. [Example- -Dbase.value=150]

  1. Test Project
mvn test

OR

  1. Shell Script to compile and run the project [for unix based platform] -
./run-all.sh <base_weight>

Enter value for base_weight.

APIs Exposed

Metrics

  • Stores the data that comes from sensor
  1. Create
POST Request => http://localhost:8080/metrics/create/
  1. Read
GET Request => http://localhost:8080/metrics/read/
  1. Read by Range
GET Request => http://localhost:8080/metrics/readRange/{startTime}/{endTime}

Alerts

  • Stores the alerts that were created by the rules
  1. Read
GET Request => http://localhost:8080/alerts/read/
  1. Read by Range
GET Request => http://localhost:8080/alerts/readRange/{startTime}/{endTime}

License

VP

About

Egen Solution Coding Challenge


Languages

Language:Java 94.7%Language:Shell 5.3%