Skip to content

Commit b40ef77

Browse files
committed
Added a README and changed few source code files paths.
1 parent 1981309 commit b40ef77

File tree

8 files changed

+63
-5
lines changed

8 files changed

+63
-5
lines changed

README.MD

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Dashboard - Basic RUM
2+
3+
![Basic RUM - Core Web Vitals dashboard](./doc/basic-rum-cwv-dashboard.png)
4+
5+
This is the visualization component of Basic RUM. It's nothing more than [Grafana](https://grafana.com/), few third-party Grafana plugins, Grafana dashboards configurations and a build script that puts everything together.
6+
7+
With the help of this project we keep the Grafana dashboards in source control and build Docker images that are used when we run all the Basic RUM components together.
8+
9+
**Docker repository:** https://hub.docker.com/r/basicrum/dashboard
10+
11+
## Third-Party Grafana plugins
12+
13+
* Plotly panel - https://grafana.com/grafana/plugins/ae3e-plotly-panel/
14+
* By AE3E - https://github.com/ae3e/ae3e-plotly-panel
15+
* Altinity plugin for ClickHouse - https://grafana.com/grafana/plugins/vertamedia-clickhouse-datasource/
16+
* By Altinity - https://altinity.com
17+
18+
## Local development
19+
20+
### Prerequisites
21+
22+
* Docker
23+
* Docker Compose
24+
* Node JS
25+
26+
### What do we run locally?
27+
28+
Locally with the help of Docker Compose we run our own image/build of Grafana and in addition we spin a Docker container for [ClickHouse](https://clickhouse.com/). We use ClickHouse as a data store that is being used for feeding with data the Grafana dashboards.
29+
30+
### File structure
31+
32+
* `.github/workflows` - GitHub actions for running tests and automatic push to Docker Hub.
33+
* `artefacts` - Static files like icons and logos used during the build process for adding branding information.
34+
* `build` - This folder doesn't exist when we clone this repository. The folder is used during the build process to keep dashboards and datasources configurations.
35+
* `dashboards/defs` - Definitions/metadata information about the dashboards we are building.
36+
* `setup/ch` - Contains file used for provisioning ClickHouse locally. When the files are used required users and tables are being created in ClickHouse.
37+
* `src/lib` - Utility classes used for the dashboards build process.
38+
* `templates` - Contains configurations, SQL statements and Plotly JS specific JavaScript. The files in this folder are being used during the build process for creating the configuration for each individual Grafana panel.
39+
40+
## Local development workflow
41+
42+
We have a simple build script `build.js` based on Node JS. We need to make sure that the required Node JS modules are installed.
43+
44+
Run:
45+
```
46+
npm install
47+
```
48+
49+
Once we are sure that we have initialized the Node JS part of the project we follow this workflow:
50+
51+
1. Change things in `dashboards` or `templates` folders.
52+
2. Run `node build.js` .
53+
3. Run `make up` ... this is a wrapper around Docker Compose commands and will build and run the required Docker container.
54+
4. Load in the browser `http://localhost:3300/` in order to verify the changes.
55+
1. If you see a login screen type:
56+
1. Username: `admin`
57+
2. Password: `password`
58+

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var fs = require("fs");
22

3-
const DashboardBuilder = require("./lib/DashboardBuilder");
3+
const DashboardBuilder = require("./src/lib/DashboardBuilder");
44
const { exit } = require("process");
55
const builder = new DashboardBuilder()
66

build.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fs = require("fs");
2-
const DashboardBuilder = require("./lib/DashboardBuilder");
2+
const DashboardBuilder = require("./src/lib/DashboardBuilder");
33
const builder = new DashboardBuilder()
44

55
function getDashboard(dashboard) {

doc/basic-rum-cwv-dashboard.png

92.8 KB
Loading
File renamed without changes.

lib/DashboardBuilder.js renamed to src/lib/DashboardBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const fs = require('fs');
33
const BuilderFactory = require('./BuilderFactory');
44
const builderFactory = new BuilderFactory()
55

6-
const rootPath = __dirname + '/..';
6+
const rootPath = __dirname + '/../../';
77
const dashboardTemplatePath = rootPath + '/templates/dashboards/General.base.json';
88

99
const maxWidth = 24;

lib/PanelBuilder.js renamed to src/lib/PanelBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const fs = require('fs');
33
const merge = require('deepmerge');
44

5-
const rootPath = __dirname + '/..';
5+
const rootPath = __dirname + '/../..';
66

77
const panelMap = {
88
"ae3e-plotly-panel": true,

lib/RowBuilder.js renamed to src/lib/RowBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Includes
22
const fs = require('fs');
33

4-
const rootPath = __dirname + '/..';
4+
const rootPath = __dirname + '/../..';
55
const rowTemplatePath = rootPath + '/templates/elements/row.json';
66

77
class RowPanelBuilder {

0 commit comments

Comments
 (0)