Git Product home page Git Product logo

drec-origin's Introduction


EnergyWeb
EnergyWeb Origin - DREC

Repository for Origin DREC project

How to use

Install rush, pnpm if you don't have it:

npm i -g @microsoft/rush
npm i -g pnpm
rush install
rush build

Copy .env.example to .env and adjust .env with your environment specific parameters.

Start Postgres instance

docker pull postgres
docker run --name origin-postgres -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 postgres

Create Postgres DB table

psql -h localhost -p 5432 -U postgres -c "CREATE DATABASE origin"

Create InfluxDB to store smart meter readings

docker run --rm --env-file ./.env -v $PWD/influxdb-local:/var/lib/influxdb influxdb:1.8 /init-influxdb.sh

Run the InfluxDB instance

docker run --name energy-influxdb --env-file ./.env -d -p 8086:8086 -v $PWD/influxdb-local:/var/lib/influxdb -v $PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro influxdb:1.8

Create and start a Redis instance

docker pull redis
docker run --name origin-redis -d -p 6379:6379 redis

Run UI and API projects

rush start:dev

You may also want to drop local databases with

rush drop

Heroku deployment script

This repo has a script for easy Heroku deployments for UI And API project. Script assumes that Heroku applications are already created and Postgres DB is provisioned.

HEROKU_API_KEY=<APIKEY> HEROKU_STABLE_APP_API=<APP_NAME> HEROKU_STABLE_APP_UI=<APP_NAME> rush deploy:heroku

When starting containers and running the app rush start:dev (it immediately starts API and UI servers, which are accessible at ports that have to be mapped:

Application Port
UI $PORT
API 3040

D-REC Integrators:

How to use

Go inside integrators-scripts folder Create a .env, copy everything from .env.example and change the necessary variables depending on the environment

npm i
npm run start

Before running the script, make sure:

  1. You have updated the DREC_BACKEND_URL in .env with local or heroku - also update the username and password for each integrator
  2. Post generated devices to Server - Bulk Devices
  3. You updated DREC_USERNAME & DREC_PASSWORD with the Owner credentials based on the integrator (Okra, BBOX, Engie etc.)
  4. The methods in index.js should run independently. After each step, comment the completed step, uncomment the next step and restart the server

drec-origin's People

Contributors

malak67 avatar alexworker23 avatar josipbagaric avatar royki avatar

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.