astarte-platform / astarte-dashboard

Astarte dashboard
http://astarte-platform.org
Apache License 2.0
17 stars 15 forks source link
astarte dashboard hacktoberfest iot iot-dashboard iot-data-visualization iot-platform

Astarte Dashboard

Astarte Dashboard is a web UI that allows visualizing the status of your realm and to perform administrative tasks such as installing interfaces and triggers, managing devices, pipelines and flows.

Dashboard Home Screen Shot

Table of Contents

Try it!

Astarte Dashboard is deployed by default on all Astarte instances.

When deploying locally using docker-compose, visit http://localhost:4040.

On a kubernetes cluster, the URL is specified in the Astarte Voyager Ingress configuration.

Or try out Astarte as a service on Astarte Cloud.

Run it locally

Prerequisites

Before starting you must have:

Configuration

Astarte Dashboard relies on a configuration file for parameters like the Astarte API URL. As soon as you open Astarte Dashboard, it will search for a file config.json containing the following keys:

An example config would look like this:

{
  "astarte_api_url": "https://api.example.com",
  "enable_flow_preview": true,
  "default_realm": "myrealm",
  "default_auth": "token",
  "auth": [
    {
      "type": "token"
    },
    {
      "type": "oauth",
      "oauth_api_url": "https://auth.example.com"
    }
  ]
}

Run it

You can easily run the Astarte Dashboard using the official Docker images from the public Dockerhub registry.

For example, to run it locally on port 4040, you can use the following command:

docker run \
  -p 4040:80 \
  -v /absolute/path/to/config.json:/usr/share/nginx/html/user-config/config.json \
  astarte/astarte-dashboard:snapshot

Contributing

Dependencies

Astarte Dashboard is written in TypeScript using the React framework and npm to manage dependencies.

Starting up a local server

  1. Clone this repo locally
    git clone git@github.com:astarte-platform/astarte-dashboard.git && cd astarte-dashboard
  2. Install the project dependencies
    npm install
  3. Place your configuration file in src/user-config/config.json
  4. Start the dev server
    npm run start
  5. Open the browser at the displayed URL, usually http://localhost:8080

Testing

Tests are carried out using Cypress, which in turn uses a headless browser to simulate user interactions. So before testing, a server from which the browser can access Astarte Dashboard is needed. The command start-ci serves the purpose.

npm run start-ci

Once the server is up, you can run tests in the CLI by running the command test

npm run test

But if you want to test specific pages or components, you can open the Cypress GUI with

npm run cypress:open

Other routine tests are formatting and typescript checks

 npm run check-format
 npm run check-types

License

Distributed under the Apache2.0 License. See LICENSE for more information.