The OpenEEW Dashboard is a web application currently being developed by the OpenEEW community for the purpose of managing network sensors and viewing sensor data.
Currently, the project consists of:
Creating a development environment involves cloning this repository and setting up several API keys, secrets and other environment variables for both the React application and API.
1. Create a vcap-local.json file from the template provided to store API credentials
Make a copy of the vcap-local.template.json
file located in the web/api
directory and rename it vcap-local.json
(this file is ignored by Git) using this command:
# from the root directory
cp ./web/api/vcap-local.template.json ./web/api/vcap-local.json
2. Add IBM Cloud service credentials and required environment variables to vcap-local.json
This step will require a IBM Cloud account.
AppID
Writer
.vcap-local.json
file located in web/api
under AppID
and credentials
. You can leave the scopes
field as an empty array.apiKey
from your service credentials and add it to vcap-local.json
in the api_key
field under ibm_cloud
Cloudant
vcap-local.json
file, under Cloudant_sensors
: url, username, passwordOptional: Add mock device data to Cloudant
openeew-devices
in your Cloudant instance (Go to Dashboard -> Create Database)web/api/mockdata.json
.MQTT
Connecting a MQTT broker is not necessary for development. The MQTT client will only attempt to connect if there are credentials available.
Other required environment variables
Also add the following environment variables to your vcap-local.json
file:
session_secret
For development, this can be any random string of characters
openeew_api_key
For development, this can be any random string of characters. This is used to send authenticated requests to the API
jwt_secret
For development, this can be any random string of characters
All of these should be changed and kept secret in production.
3. Add a Mapbox access token to the React client
If you don't already have a Mapbox account, create one, and then navigate to your account's access token page to view your tokens. You can use the Default public token or create a new one.
After you have copied your token, create a file called .env.local in the web/client directory.
In .env.local add the following, replacing your_token with your Mapbox access token. Save -- the application should include the key as an environment variable.
REACT_APP_MAPBOX_ACCESS_TOKEN=your_token
3. Install dependencies for both the mock API and application
# setup scripts are located in /web
cd web
# this might take a few minutes
npm run setup
4. Start the mock API and application concurrently
# From the /web directory
npm start
5. Start developing!
The application should be running on http://localhost:3000.
The mock API should be running on http://localhost:4000
Install Docker and build your own image.
cd web
docker build --tag openeew/dashboard:dev .
Then run a development container:
docker run \
--interactive \
--detach \
--publish 3000:3000 \
--name openeew-dashboard-dev \
openeew/dashboard:dev
It is planned to expand this application so that in future, it will allow for the following:
For every new addition to this application, there is a process in which prototypes and designs are discussed and approved by the OpenEEW community and Technical Steering Committee before development starts. To join the conversation, and to begin contributing to this project, please join our slack channel and review the Contributing and Developer Information section below.
You can view the current prototype here.
Enjoy! Give us feedback if you have suggestions on how to improve this information.
The community welcomes your involvement and contributions to this project. Please read the OpenEEW contributing document for details on our code of conduct, and the process for submitting pull requests to the community.
This information is licensed under the Apache Software License, Version 2. Separate third party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 (DCO) and the Apache Software License, Version 2.