Written by Marc Köhlbrugge
Fortunately, we already have a lot of data at our disposal. Right in our database!
Blazer makes it super easy to build a business intelligence dashboard by writing simple SQL queries. It even generates beautiful charts so you can actually understand your data at a glance.
Blazer goes further than just providing a dashboard. It can notify you of things you care about. Just write a query and Blazer will send you an email or Slack message when an SQL query starts returning results you didn’t expect.
For example we use the following check to get notified when there are users who signed up last week, but still haven’t created any todos:
SELECT users.id FROM users LEFT OUTER JOIN todos ON todos.user_id = users.id WHERE users.created_at BETWEEN (NOW() - '2 week'::interval) AND (NOW() - '1 week'::interval) GROUP BY users.id HAVING COUNT(todos.id) = 0
Blazer is meant to be added to an existing Ruby on Rails app.
After installing the gem, run the following commands:
rails generate blazer:install rails db:migrate
Then mount the dashboard in your
mount Blazer::Engine, at: "blazer"
https://localhost:3000/blazer to create your first dashboards.
I strongly advise you to configure authentication before deploying to production. The docs include some other great suggestions and advanced examples as well.