Git Product home page Git Product logo

meter-data-analytics's Introduction

Meter Data Analytics

Smart meter data analytics app built with the MEVN stack (MongoDB, Express, Vue, Node.js).

The app visualizes smart meter measurements time-series data and provides simple analytics.

The external-api simulates an external REST API providing smart meter measurements data. It implements authentication using JWT (JSON Web Tokens).
The back-end provides a REST API to retrieve the smart meter measurements data from the MongoDB database. It also provides an endpoint to import the data from the external-api into the database.
The front-end provides a single-page application to visualize the smart meter measurements data retrieved from the back-end REST API. It also provides simple analytics with graphs showing the data grouped by different time intervals.

All the smart meter data being used is just test data.

Requirements

Setup

1. external-api setup

1.1 Switch into the external-api directory

cd external-api

1.2 Install NPM packages

npm install

1.3 Create your .env file

See file .env.example for an example

1.4 Compiles and hot-reloads for development

npm run start

1.5 Runs tests

npm run test

1.6 Compiles for production

npm run build

1.7 Starts production

npm run start:production

2. back-end setup

2.1 Switch into the back-end directory

cd back-end

2.2 Install NPM packages

npm install

2.3 Create your .env file

See file .env.example for an example

2.4 Import some measurements data into MongoDB

File measurements.json.example contains some sample data and the following mongoimport command could be used to import it:

mongoimport --db=meter-data-analytics_db --collection=measurements --file=measurements.json.example

2.5 Compiles and hot-reloads for development

npm run start

2.6 Runs tests

npm run test

2.7 Compiles for production

npm run build

2.8 Starts production

npm run start:production

3. front-end setup

3.1 Switch into the front-end directory

cd front-end

3.2 Install NPM packages

npm install

3.3 Create your .env file

See file .env.example for an example.

3.4 Compile and hot-reload for development

npm run dev

3.5 Run unit tests

npm run test:unit

3.6 Type-check, compile and minify for production

npm run build

3.7 Preview production build

npm run preview

meter-data-analytics's People

Contributors

gianantoniopini avatar

Stargazers

 avatar

Watchers

 avatar  avatar

meter-data-analytics's Issues

unable to run back end

I tried to run the external api but getting the following error
E:\karthi\workspace\react\meter-data-analytics-master\external-api>npm run start

[email protected] start
nodemon --exec ts-node --require tsconfig-paths/register src/server.ts

[nodemon] 2.0.15
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: ts,json
[nodemon] starting ts-node --require tsconfig-paths/register src/server.ts
E:\karthi\workspace\react\meter-data-analytics-master\external-api\src\server.ts:8
throw new Error(no PORT found in process.env);
^
Error: no PORT found in process.env
at Object. (E:\karthi\workspace\react\meter-data-analytics-master\external-api\src\server.ts:8:9)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Module.m._compile (C:\Users\Asus\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1455:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Object.require.extensions. [as .ts] (C:\Users\Asus\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:1458:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at phase4 (C:\Users\Asus\AppData\Roaming\npm\node_modules\ts-node\src\bin.ts:567:12)
at bootstrap (C:\Users\Asus\AppData\Roaming\npm\node_modules\ts-node\src\bin.ts:85:10)
[nodemon] app crashed - waiting for file changes before starting...

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.