To run this tutorial, you only need a Golang development environment, and the Dashborg SDK. You’ll also need a rudimentary knowledge of HTML (basic syntax, tags, and attributes).
Dashborg is designed to be simple to get started with. The most basic concept in Dashborg is the App. An App has a small configuration, HTML (layout), and an optional runtime to send data to the UI and respond to UI events.
Let’s jump right in and define a very simple static Dashborg App. We’ll create two files “demo.go” for the logic, and “demo.html” for our layout.
<app ui="dashborg"> <h1>Hello World</h1> </app>
Now run the program:
go run demo.go
You should see output that looks similar to:
DashborgCloudClient KeyFile:dashborg-client.key CertFile:dashborg-client.crt AccId:[ACC-ID] SHA-256:[PUBLIC-KEY-SHA256] DashborgCloudClient Connected, AccId:[ACC-ID] Zone:default Dashborg App Link [demo]: https://acc-[ACC-ID].console.dashborg.net/app/demo?jwt=[LONG-JWT-KEY]
Copy and paste your app link (console.dashborg.net) into your browser to see your live dashboard!
That’s it, you’ve created a new Dashborg account and defined your first Dashborg App!
- Because we called
app.SetOfflineAccess(true)you can view our app even when our program is not running. If we set this to false, then the app will only be accessible when your program is running.
- We used
app.WatchHtmlFile()to set our HTML. This creates a fsnotify watcher and re-uploads your HTML anytime it detects a change while your program is running. For production you can use
- All hosted Dashborg apps are secure. The generated JWT token provides access for 24-hours (configurable). After claiming your account, you can set up alternate authentication methods like simple passwords or logins.