-
Node
6.10.3
-
Docker
-
git clone git@github.com:sudokrew/energy-monitor-frontend.git
-
npm i
-
npm run dev
-
Navigate to
/login
in the browser
-
git clone git@github.com:sudokrew/energy-monitor-api.git
-
npm i
-
Add a
.env
file to the root of the project -
Paste this into the
.env
file:
ENERGY_MONITOR_API_VERSION=1.0.0
SERVER_PORT=3001
NODE_ENV=development
POSTGRES_HOST=energy-monitor-postgres
POSTGRES_PORT=5432
POSTGRES_NAME=energy_monitor_dev
POSTGRES_USER=brockinit
POSTGRES_PSWD=null
POSTGRES_CLIENT=postgres
INFLUXDB_HOST=energy-monitor-influxdb
INFLUXDB_PORT=8086
INFLUXDB_NAME=energy_monitor_dev
INFLUXDB_USER=root
INFLUXDB_PSWD=root
INFLUXDB_DATA_MEASUREMENT=energy_monitor_data
-
npm run dev
-
docker exec -it energy-monitor-postgres psql -d energy_monitor_dev -U brockinit
-
In the root of the project, copy the contents of
seed.sql
and paste them into the terminal. This should run your seed script and create the database tables -
\q
to exit postgres -
Place the
dev.txt
file in the root of the project -
Follow the following steps to seed the influx time-series database:
docker cp dev.txt energy-monitor-influxdb:/dev.txt
docker exec -it energy-monitor-influxdb bash
- Verify that dev.txt is there by typing
ls
- Exit docker container by typing
exit
docker exec -it energy-monitor-influxdb influx -import -path=dev.txt -precision=ms
docker exec -it energy-monitor-influxdb influx -precision rfc3339
use energy_monitor_dev
show measurements
exit
node fakeData.js
At this point, you will have started the docker container, seeded both databases, and began the script that generates fake data for the live-feed.
-
Refresh the browser window at the
/login
route -
Register a new user
-
Go to the "Device List" tab and create a device with a serial of "bravo"
-
Go to the "Live Feed" tab and add device "bravo"
-
Use the slider below the graph to adjust the data displayed
-
Feel free to change to different types of graphs (bar, line, area, etc)