Coder Social home page Coder Social logo

smart-meter's Introduction

Smart Meter

This sample project is used as live demo material for "Spring Boot 2.0 Web Applications". The recording of the session is available here.

Building

To build this project, you need Java 1.8, Maven 3.5 and a bash-like shell.

Just invoke the following at the root of the project:

$ mvn clean install

Running

To run this project, you also need a mongo server running your machine with default settings. If mongo is running somewhere else, please refer to the documentation to know more how you can configure Spring Boot to use that custom location.

Tip
This assumes that you are running the application on the command line. You can also very easily run this application from your IDE.

First start the aggregator, from the root of the project:

$ cd smart-meter-aggregator
$ mvn spring-boot:run

You should be able to check that the aggregator is running by issuing the following command:

$ curl http://localhost:8081/measures/firehose

If you prefer to use HTTPie you can use this command:

$ http :8081/measures/firehose --stream

Once you’ve made sure the aggregator is running, you can start the dasbhoard. From the root of the project:

$ cd smart-meter-dashboard
$ mvn spring-boot:run

If you go to http://localhost:8080 you should see a list of zones. If you click on one of them, you should see a graph updating itself every 10s

Tip
Initially the graph is empty as there is no data. Please wait a bit for the application to collect metrics from the aggregator.

Cleaning old data

If you’ve been running this project a long time ago, the application will try to fetch the latest 40 entries which may create a huge gap. To restart from scratch you can remove the collection in MongoDB.

If the dashboard is running, stop it first and then invoke the following:

$ mongo
> db.powergridsamples.drop()

smart-meter's People

Contributors

snicoll 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.