This is a Yeoman generator for creating dashboards with the dashing-go library, a Go port of Shopify/dashing.
The dashboard runs on the Martini microframework, while the frontend dependencies are managed by Grunt and Bower.
For a live demo, check out the sample dashboard.
Install Yeoman, and dependencies:
npm install -g yo grunt grunt-cli bower
Install the dashing-go generator:
npm install -g generator-dashing-go
Create a new directory:
mkdir my-dashboard && cd $_
Generate the project (this will also run the initial Bower and Grunt tasks):
yo dashing-go
Grab the Go dependencies:
go get
Start the server:
go run server.go
The sample dashboard is now available at http://localhost:3000.
The init
task copies third party assets (installed by Bower) into position and compiles BatmanJS. This should have been run automatically as a post-install script, but if you've added new dependencies or need to do it manually:
bower install
grunt init
You may also start a livereload server that watches the assets
directory for changes and runs the build pipeline automatically. When you access it (port 9000 by default), it injects a script into the page that initiates a reload whenever the compiled assets are updated.
grunt serve
grunt build
If you need to build just application.js
or application.css
, you may run each task individually:
grunt js
grunt css
grunt minify
application.js
and application.css
are minified in-place.
Create new dashboards, jobs and widgets:
yo dashing-go:dashboard foo
yo dashing-go:job foo
yo dashing-go:widget foo
Note the following naming conventions (the generator automatically enforces them):
- dashed-slug for widget and dashboard names
- under_score for Go job filenames
- camelCase for Go job structs
Existing third party Dashing widgets should be compatible with dashing-go.
Released under the MIT license.